Kyc aml · Production

Sun Finance automates ID extraction and fraud detection with generative AI on AWS

The problem

Sun Finance processed 80,000 monthly microloan applications but approximately 60% required manual operator review, primarily due to OCR extraction errors across multiple languages and ID document types. Per-document costs and approximately 3 FTEs dedicated to manual verification blocked expansion into lower-value loan markets, while about 10% of daily requests were fraudulent, requiring time-intensive manual review.

First attempt

Sun Finance's 2019 IDV system hit accuracy limits as the company expanded into regions with languages underrepresented in OCR training data and multiple ID formats. A replacement attempt using Claude Sonnet 4 alone via Amazon Bedrock achieved only 61.8% accuracy—below the existing baseline—because the model's built-in privacy safeguards refused to extract PII from identity documents, causing ID number extraction to fall to only 43%.

Workflow diagram · grounded in source
1
Loan application triggers ID check
Trigger
A loan application arrives and the ID image is submitted to the extraction pipeline via an AWS Lambda function.
source quote
“/extract-id route (ID extraction). An AWS Lambda function receives the ID image”
2
Primary OCR via Amazon Textract
Ai action
Amazon Textract performs primary OCR text extraction from the identity document image.
source quote
“Amazon Textract handled raw text extraction from ID images”
3
Fallback OCR via Amazon Rekognition
Validation
If Amazon Textract returns low-confidence results, the system falls back to Amazon Rekognition for OCR.
source quote
“If Amazon Textract returns low-confidence results, the system falls back to Amazon Rekognition for OCR”
4
LLM structuring via Claude Sonnet 4
Ai action
Amazon Bedrock (Claude Sonnet 4) structures the extracted text into seven standardized fields.
source quote
“Claude Sonnet 4 then structured the output into 7 standardized fields: document type, date of birth, name, surname, middle name, ID number, and expiry date”
5
Validation rules applied
Validation
Validation rules enforce ID number formatting, date standardization to YYYY-MM-DD, and document type normalization.
source quote
“validation rules for ID number formatting, date standardization, and document type normalization”
6
Parallel fraud detection triggered
Trigger
An AWS Lambda function triggers an AWS Step Functions workflow that runs two fraud checks in parallel.
source quote
“An AWS Lambda function triggers an AWS Step Functions workflow that runs two checks in parallel”
7
Visual fraud pattern detection
Ai action
Claude Sonnet 4 via Amazon Bedrock analyzes submitted selfie images for screen photo artifacts and digital manipulation.
source quote
“Amazon Bedrock (Claude Sonnet 4) analyzes the image for screen photo artifacts and digital manipulation”
8
Background similarity search
Ai action
Amazon Titan Multimodal Embeddings generates a vector of the background, which is queried against Amazon S3 Vectors to find matches with known fraud patterns.
source quote
“Amazon Bedrock Titan Multimodal Embeddings generates a vector representation of the background. This vector is queried against Amazon S3 Vectors to find matches with known fraud patterns”
9
Risk score output
Output
Both fraud detection results feed into a Lambda-based risk assessment function that produces a combined fraud score as JSON.
source quote
“Both results feed into a Lambda-based risk assessment function that produces a combined fraud score as JSON”
10
Confirmed fraud ingestion
Feedback loop
Confirmed fraud images are vectorized by Amazon Bedrock Titan Embeddings and stored in Amazon S3 Vectors to grow the reference database over time.
source quote
“Confirmed fraud images are ingested from Amazon S3 through a Lambda function. The images are processed by Amazon Rekognition for face masking, vectorized by Amazon Bedrock Titan Embeddings, and stored in Amazon S3 Vectors. This grows the reference database over …”
Reported outcome

The multi-tier solution improved extraction accuracy from 79.7% to 90.8%, cut per-document costs by 91%, and reduced processing time from up to 20 hours to under 5 seconds.
Manual intervention is projected to drop from 60% to 30% of applications, with staffing projected to decrease from approximately 3 FTEs to approximately 1 FTE.

Reported metrics
Overall extraction accuracy — new solution90.8%
Overall extraction accuracy — baseline79.73%
Per-document cost reduction91% reduction
Processing time — new solutionunder 5 seconds
Show all 20 reported metrics
overall extraction accuracy — new solution90.8%
overall extraction accuracy — baseline79.73%
per-document cost reduction91% reduction
processing time — new solutionunder 5 seconds
processing time — baseline (manual reviews)up to 20 hours
manual review rate — projected new30%
manual review rate — baseline60%
manual verification FTEs — baselineapproximately 3 FTEs
manual verification FTEs — projected newapproximately 1 FTE
monthly microloan applications80,000
daily fraudulent application rate10%
fraud detection accuracy81%
fraud detection recall59%
fraud detection specificity83%
screen photo detection confidence95%+
Claude-alone approach accuracy61.8%
ID number extraction — Claude alone43%
fraud detection latency reduction (parallel vs sequential)40%
average extraction processing time4.42 seconds
ID extraction cost reduction vs previous solution91% reduction
Reported stack
Amazon Titan Multimodal EmbeddingsClaude Sonnet 4Amazon API GatewayAmazon CognitoAWS WAFAWS KMSTerraform
◆ Does this fit your context?

Compare to your context

Tell us your scale, team, and constraints. We'll show what changes at your size, what fails at your scale, and whether this case is a fit, needs adaptation, or won't scale to you. Free demo, no signup.

Compare to your context →
~30 seconds · free
Source
https://aws.amazon.com/blogs/machine-learning/sun-finance-automates-id-extraction-and-fraud-detection-with-generative-ai-on-aws/
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

The multi-tier solution improved extraction accuracy from 79.7% to 90.8%, cut per-document costs by 91%, and reduced processing time from up to 20 hours to under 5 seconds.

What tools did this team use?

Amazon Titan Multimodal Embeddings, Claude Sonnet 4, Amazon API Gateway, Amazon Cognito, AWS WAF, AWS KMS, Terraform.

What results were reported?

Overall extraction accuracy — new solution: 90.8%; Overall extraction accuracy — baseline: 79.73%; Per-document cost reduction: 91% reduction; Processing time — new solution: under 5 seconds (source-reported, not independently verified).

What failed first in this deployment?

Sun Finance's 2019 IDV system hit accuracy limits as the company expanded into regions with languages underrepresented in OCR training data and multiple ID formats.

How is this kyc aml AI workflow structured?

Loan application triggers ID check → Primary OCR via Amazon Textract → Fallback OCR via Amazon Rekognition → LLM structuring via Claude Sonnet 4 → Validation rules applied → Parallel fraud detection triggered → Visual fraud pattern detection → Background similarity search → Risk score output → Confirmed fraud ingestion.

WHAT TO DO WITH THIS

Now compare it to your context

This case is one data point. Whether its pattern fits you depends on your volumes, your stack, and your exception load — that comparison is the step no case study can do for you.

Browse the Kyc aml cases →