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
“/extract-id route (ID extraction). An AWS Lambda function receives the ID image”
2
Primary OCR via Amazon Textract
ai_action
“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”
4
LLM structuring via Claude Sonnet 4
ai_action
“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 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 checks in parallel”
7
Visual fraud pattern detection
ai_action
“Amazon Bedrock (Claude Sonnet 4) analyzes the image for screen photo artifacts and digital manipulation”
8
Background similarity search
ai_action
“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 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 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…”
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
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.