Indonesian ID Card OCR
I built an API and browser demo that extract fields from Indonesian identity cards. The pipeline detects and straightens the card, locates fields, and runs OCR. It flags uncertain values so they can be checked before use.
Overview
I built an API and browser demo that extract fields from Indonesian identity cards. The pipeline detects and straightens the card, locates fields, and runs OCR. It flags uncertain values so they can be checked before use.
Context
Photos of identity cards can be rotated, blurred, poorly lit, or tightly cropped. An incorrect character can change an identity field, so the output needs review flags and downstream checks.
My Role
- Developed and packaged the OCR runtime workflow.
- Added orientation and card-normalization logic.
- Integrated field detection with adaptive OCR processing.
- Designed structured API responses and review-oriented statuses.
- Added a local web interface, Windows setup scripts, Docker packaging, and integration documentation.
- Added unit tests for preprocessing, normalization, and adaptive field OCR behavior.
Approach
I process the card image before reading individual fields. Runtime modes allow a faster pass or additional OCR attempts. Low-confidence and inconsistent values remain marked for review.
Architecture
Uploaded image
-> file and image validation
-> card detection and orientation correction
-> field detection
-> adaptive PaddleOCR passes
-> controlled normalization
-> field confidence and review flags
-> structured JSON responseValidation and Evidence
The repository includes focused unit tests, API integration documentation, Docker configuration, Windows launch scripts, health checks, and distinct runtime modes. Training metrics and end-to-end OCR accuracy are treated as different measurements.
Results
The project includes a packaged OCR service, browser demo, and defined API response. It returns review flags alongside extracted values. I have not published an end-to-end field-accuracy benchmark.
Limitations
- Model detection performance does not equal end-to-end field accuracy.
- Real-world accuracy requires a legally usable, anonymized test set with human-reviewed ground truth.
- OCR output must not be used as trusted identity data without downstream verification.
Technology Stack
Python, FastAPI, YOLO, PaddleOCR, OpenCV, Docker, Docker Compose, unittest.
Privacy and Publication Note
No real KTP image, NIK, name, address, OCR response, debug crop, or training dataset should be included in a public repository. Portfolio examples must use fully fictional documents and identities.
Checks and current status
System assessment
The service and browser demo are documented; field accuracy has not been published.
The project includes API documentation, packaging, and tests. Measuring extraction accuracy needs reviewed ground truth, per-field checks, review rates, and latency measurements.
Delivery evidence
AvailableAPI documentation, browser demo, Docker, health checks, and launch scripts exist.Reliability approach
Review firstUncertain fields are exposed for human verification.Public field accuracy
Not evaluatedNo real identity data is used to manufacture a benchmark.Limitations: OCR output must not be treated as trusted identity data without human or downstream verification.