JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 Enhancing OCR Accuracy on Indonesian ID Cards Using Dual-Pipeline Tesseract and Post-Processing Rendy Dwi Reksiyano. Syafrial Fachri Pane. Rolly Maulana Awangga Informatics Engineering. Universitas Logistik dan Bisnis Internasional. Jl. Sariasih No. 54 Sarijadi. Kecamatan. Sukasari. Kota Bandung. Indonesia Article Info Abstract Manual transcription of data from Indonesian identity cards (KTP) Article history: remains prevalent in public institutions, often resulting in Received: 18 September 2025 inefficiencies and human errors that compromise data accuracy. Revised: 26 October 2025 While Optical Character Recognition (OCR) technologies such as Accepted: 3 November 2025 Tesseract have been widely adopted. However, the performance on KTP images is still inconsistent due to non-uniform layouts, low contrast, and background noise. This study proposes a dual-pipeline OCR framework designed to enhance the recognition accuracy of Keyword: OCR Indonesian KTPs under real-world conditions. First, the pipeline Indonesian ID Card performs static region segmentation based on predefined Regions of Tesseract Interest (ROI), then uses dynamic keyword heuristics to locate text Dual-Pipeline adaptively across varying layouts. The outputs of both pipelines are Post-Processing merged through a voting and regex-based post-processing mechanism, which includes character normalization and field validation using predefined dictionaries. Experiments were conducted on 78 annotated KTP samples with diverse resolutions and quality of Evaluation using Character Error Rate (CER). Word Error Rate (WER), and field-level accuracy metrics resulted in an average CER of 69. WER of 80. 20%, and character-level accuracy of Despite moderate performance in free-text areas such as address or occupation, structured fields achieved higher accuracy above 60%. The method runs efficiently in a CPU-only environment without requiring large annotated datasets, demonstrating its suitability for low-resource OCR deployment. Compared to conventional single-pipeline approaches, the proposed framework improves robustness across heterogeneous document layouts and illumination conditions. These findings highlight the potential of lightweight, rule-based OCR systems for practical e-KYC digitization and form a foundation for integrating deep-learning-based layout detection in future research. Corresponding author: DOI: https://doi. org/10. 54732/jeecs. Rendy Dwi Reksiyano, rendydwi38@gmail. This is an open access article under the CCAeBY license. Introduction The rapid digital transformation in Indonesia has increased the demand for automated identity data processing, particularly in banking, government services, and administrative operations . However, manual transcription of data from the Indonesian National Identity Card (KTP) remains common, causing inefficiencies and potential errors that reduce the reliability of digital services . , . Optical Character Recognition (OCR) is widely adopted to automate such tasks, with Tesseract being one of the most frequently used open-source engines . Numerous improvements have been proposed to enhance Tesseract performance, including grayscale preprocessing, adaptive thresholding such as the Otsu method . , contrast enhancement with CLAHE . , and robust layout-aware segmentation . Integration of Tesseract and OpenCV has been successfully Available online: https://ejournal. id/jeecs | 119 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 applied in diverse areas such as multilingual OCR . , vehicle license plate recognition . , . Braille text conversion . , and parsing of administrative documents . In the Indonesian context. OCR has also been used in social assistance systems, achieving up to 98% character-level accuracy . Despite these developments. KTP images pose unique challenges, including inconsistent layouts, variations in fonts, noisy backgrounds, and poor capture conditions . , . Most existing OCR research on identity documents focuses on general text recognition without structured field validation . , . Several techniques such as Levenshtein distance . , keyword-based matching . , and rule-based post-processing . have been proposed to increase reliability. However, these methods remain insufficient for noisy, low-quality identity card images where characters are often degraded . Recent advances in deep learning such as Long Short-Term Memory (LSTM) . , high-performance OCR with recurrent architectures . Faster R-CNN for layout detection . , and synthetic data augmentation . show promising results in text recognition. Deep learning methods including Fully Convolutional Networks . , hybrid OCR for historical documents . , and multilingual models . , . outperform rule-based pipelines in many contexts. Nonetheless, these approaches often require large annotated datasets and high computational resources, which may not be feasible in low-resource settings . To address these limitations, this research proposes a lightweight dual-pipeline OCR framework specifically optimized for Indonesian KTPs. The system leverages traditional computer vision methods with rule-based reasoning to improve structured text recognition without relying on deep learning. The key contributions of this paper are summarized as follows: C A modular dual-pipeline OCR architecture that combines static Region of Interest (ROI) segmentation and dynamic keyword-based extraction. Pipeline-1 employs OpenCV preprocessing (LAB color space. CLAHE with tileGridSize = 31y31, grayscale normalization, and truncated thresholdin. with static ROIs for structured fields . NIK. RT/RW), recognized by Tesseract configured with --oem 3 and --psm 4/7. Pipeline-2 performs full-page OCR with keyword proximity heuristics to extract unstructured fields such as name and address. Outputs from both pipelines are merged through a voting and regex-based post-processing stage that reduces character ambiguity and standardizes field values. C An expanded dataset and realistic evaluation scenario consisting of 78 annotated KTP samples selected from a total of 112 collected images, representing various resolutions . y274 Ae 1400y883 p. and capture conditions . lur, shadow, and uneven illuminatio. Each image is labeled at the field level (NIK. Name. Address. RT/RW. Religion. Occupation, etc. ) to support reproducible evaluation and parameter benchmarking (ROI coordinates. CLAHE settings, and regex validation rule. This scaleup from the initial 2-image testbed provides statistically meaningful insights into OCR behavior under real-world variability. C Comprehensive evaluation metrics and efficiency analysis. System performance is measured using Character Error Rate (CER). Word Error Rate (WER), and field-level accuracy, computed via the jiwer evaluation toolkit. The proposed method achieved an average CER of 69. WER of 80. 20%, and character-level accuracy of 30. 18% across 78 test images, with structured fields such as NIK and Religion exceeding 60% accuracy. The framework runs efficiently on a CPU-only environment . s per imag. , requiring no GPU acceleration or large-scale training, confirming its suitability for lowresource e-KYC digitization workflows. Research Methodology This study employed an experimental research and development (R&D) approach to design a lightweight OCR pipeline tailored for Indonesian KTP images. The methodology is summarized in a structured workflow that includes preprocessing, text extraction, merging, and evaluation . , . , . Research Workflow The research workflow of the proposed system is shown in Figure 1. Enhanced research workflow of the proposed dual-pipeline OCR system. The process begins with Dataset Collection, where Indonesian KTP images are acquired from multiple regions and devices under varying capture conditions . lean, blurred, skewed, and low contras. The Image Preprocessing stage applies LAB color conversion. CLAHE contrast enhancement, and thresholding to normalize illumination and suppress background noise. Two parallel OCR flows are then executed: Pipeline 1 (Static ROI Regex Validatio. : This pipeline is engineered for fields with fixed, predictable locations on the KTP, such as the NIK and Nama (Nam. It uses predefined coordinates Available online: https://ejournal. id/jeecs | 120 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 to define a static Region-of-Interest (ROI) for each field, ensuring that OCR is performed only on the relevant area. Post-extraction. Regex-based validation is applied to enforce structural rules, such as confirming that a NIK contains exactly 16 digits. Pipeline 2 (Dynamic Keyword Matchin. : This pipeline provides robustness for fields whose positions may vary slightly due to image skew or different card printings, like Alamat (Addres. or Pekerjaan (Occupatio. It performs OCR on the entire document and then scans the full text output to locate specific keywords. The data associated with these keywords is then extracted, making the process resilient to layout inconsistencies. The results are combined in the Voting. Merging, and Cleaning stage, which applies regex-based normalization and character-mapping correction . OIi0, i1. SIi. Finally, the Evaluation and Analysis stage measures the system's efficacy. The final predictions are compared against a ground truth dataset using standard metrics: Character Error Rate (CER) and Word Error Rate (WER), alongside field-level The workflow concludes with a planned error categorization analysis, where incorrect extractions are classified based on input image defects . lurred, skewed, cropped, damage. to guide future system Dataset The dataset used in this study consists of 78 anonymized Indonesian ID card (KTP) images collected under internal institutional permission, samples were used for detailed evaluation. Each image was captured using various mobile devices under real-world e-KYC conditions, representing both clean and degraded acquisitions . lur, low contrast, uneven illumination, and shadow artifacts, broke. All personal information was anonymized prior to analysis in compliance with IndonesiaAos Personal Data Protection Law (UU 27/2. The dataset covers 23 provinces and more than 24 regencies/cities across Indonesia, including Jakarta Utara. Bandung. Pamekasan. Samarinda. Tarakan. Gorontalo, and Biak Numfor, ensuring diverse regional representation. Each of the 78 evaluated samples was manually annotated at the field level (NIK, name, address. RT/RW, religion, occupation, and citizenshi. to establish consistent ground truth for quantitative comparison. Image resolutions range from 384 y 274 to 1400 y 883 pixels, with an average of 1341 y 848 pixels, ensuring a realistic variety of capture conditions rather than uniform image scaling. Table 1 summarizes the dataset distribution across provinces, while Figure 2 illustrates representative examples of clean and noisy KTP images used in this research. Figure 1. Research methodology workflow for dual-pipeline OCR system Table 1. Summarizes the dataset distribution Province Number of Images West Java Central Java East Java Jakarta Banten South Sumatra Available online: https://ejournal. id/jeecs | 121 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 North Sumatra Yogyakarta Special Region West Kalimantan South Kalimantan East Kalimantan South Sulawesi Jambi Southeast Sulawesi Central Sulawesi Aceh Lampung Riau Bangka Belitung Islands Central Kalimantan North Sulawesi Gorontalo North Maluku Papua Figure 2. Examples of anonymized KTP images used in this study Image Preprocessing To improve text visibility and reduce background noise, preprocessing was performed using LAB color conversion. Contrast Limited Adaptive Histogram Equalization (CLAHE), truncated thresholding (THRESH_TRUNC) and Otsu thresholding . , . This combination was empirically found to improve recognition consistency in low-contrast and bluish-tinted KTP backgrounds compared to binary thresholding methods. Dual-Pipeline Text Extraction Two pipelines were implemented to maximize accuracy: C Pipeline 1 (Static ROI Rege. : fixed cropping coordinates were applied to extract structured fields such as NIK and RT/RW, followed by regular expressions for validation . , . This pipeline uses OpenCV preprocessing (CLAHE grayscale normalizatio. and Tesseract OCR configured with -oem 3 --psm 4/7, suitable for line-level text segmentation. C Pipeline 2 (Dynamic Keyword Matchin. : the full-page OCR output was analyzed using keyword proximity rules and linguistic patterns, enabling extraction of free-text fields like name and address . , . This dynamic approach enables flexible extraction of unstructured fields such as Name. Address, and Occupation across multiple provincial KTP layouts. Merging and Post-Processing Outputs from both pipelines were fused using a voting mechanism and refined with regex-based cleaning and character mapping. The post-processing stage corrected frequent OCR confusions such as O/0. I/1, and S/5 . , . Additional normalization was performed for date formats (DD-MM-. , casing, and categorical fields such as AuLAKI-LAKIAy and AuPEREMPUANAy using predefined CSV dictionaries (RELIGIONS. JENIS_KELAMIN. Evaluation Method The system performance was evaluated against manually labeled ground truth using three metrics: C Character Error Rate (CER) . C Word Error Rate (WER) . C Field-Level Accuracy (%) . Available online: https://ejournal. id/jeecs | 122 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 Table 2. Experiment detail Old New 2 anonymized images 78 annotated for evaluation 430y309 px avg Real measured 1341y848 px grayscale Otsu LAB CLAHE THRESH_TRUNC General added Tesseract config, regex logic, fuzzy matching qualitative only added formulas. CER/WER/ACC definitions, runtime efficiency not mentioned added GDPR-style data privacy Aspect Dataset info Resolution Preprocessing Method detail Evaluation Compliance The metrics are mathematically defined as: ycI ya ya ycI ya ya CER = , ycOyaycI = , yayaya = . Oe yayaycI) ycu 100% ycA ycO where S. D, and I represent the number of substitutions, deletions, and insertions, while N and W denote the total number of characters and words respectively. All evaluations were implemented using the jiwer library in Python to ensure reproducibility. The experiments were conducted in a CPU-only Google Colab environment, achieving an average processing time of 0. 4 seconds per image, demonstrating computational efficiency in low-resource scenarios, as presented in Table 2. Results and Discussions This section presents both the experimental results and comprehensive discussion of the proposed OCR system. Results are shown quantitatively using evaluation metrics and qualitatively through visual samples before and after post-processing. System Performance Overview The proposed dual-pipeline OCR framework was evaluated on 78 annotated KTP images representing diverse real-world conditions . lean, blurred, low-contrast, and shadowe. Performance was measured using Character Error Rate (CER). Word Error Rate (WER), and field-level accuracy (ACC) computed via the jiwer library. The results are summarized in Table 3. Structured fields such as NIK. Religion, and Marital Status consistently achieved Ou 60 % accuracy, while free-text fields like Address and Occupation were more affected by image noise. Compared with the earlier 2-sample experiment that yielded > 99 % accuracy under ideal conditions, the expanded 78-image dataset produced more realistic metrics and exposed field-specific weaknessesAidemonstrating the frameworkAos robustness test under real-world variability. Field-Level Evaluation The figure illustrates the static Region of Interest (ROI) segmentation used in Pipeline-1 to isolate structured text regions such as Nama. Tempat/Tgl Lahir. Alamat, and RT/RW. Each bounding box corresponds to a predefined coordinate range that ensures consistent text extraction across different KTP This segmentation step enables the system to focus on relevant identity fields while minimizing background noise and layout variations, thereby improving recognition accuracy in subsequent OCR stages. Table 3. Summarizes the overall quantitative performance Evaluation Metric Mean Value Average CER Average WER Average Accuracy Available online: https://ejournal. id/jeecs | 123 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 Figure 3. Examples of ROI segmentation result on a KTP Image Sample Outputs Before and After Post-Processing To further illustrate improvements. Figure 3 presents sample outputs before and after applying regex cleaning and character mapping. The post-processing stage successfully corrected frequent OCR confusions, especially in numeric fields . O vs 0. I vs 1. S vs . , improving overall field-level reliability . Figure 4. OCR Results Before Post-Processing Figure 5. OCR Results After Post-Processing Available online: https://ejournal. id/jeecs | 124 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 Error Analysis The main sources of error were: C Low contrast and motion blur, typical of mobile-captured ID images . , . C Similar-looking characters leading to substitution errors . C Irregular layout in unstructured text zones. Despite these errors, the proposed method improved robustness compared with baseline Tesseractonly extraction. We categorize failure cases into five acquisition conditions commonly observed in Indonesian KTP images: . low-contrast, . otion/out-of-focu. , . damaged card surface . cratch/ink bleedin. , . skew/rotation, and . cropped/missing margins. On the 78 matched images, overall performance drops from near-perfect accuracy on clean samples to an average CER 69. 8% / WER 2% / character accuracy 30. 2%, indicating that quality degradations severely affect TesseractAos line finding and character modeling. Qualitatively, our logs show frequent breakups of field labels (AuTempat/TgiAAy. AuKel/Desa. and heavy numeric confusion in NIK/RTAeRW . OIi0, i1. SIi5. BIi8. GIi. , consistent with low SNR and defocus. We summarize typical manifestations and their impact as presented in Table 4. Static ROI regex is robust for structured fields (NIK. RT/RW, religio. when regions are present. dynamic keyword extraction recovers free text . ame, addres. on clean to moderately noisy images. The system fails when . the KTP is detected incorrectly . isdetection in the photo fram. , . large skew/rotation so the ROI is misaligned, and . cropping removes labels/content so that voting results in no valid candidates. These failure modes explain the sharp degradation from the two clean exemplars to the 78 real-world images. Comparison with Related Works Unlike Sporici et al. , who focused on convolution-based preprocessing without applying to ID documents, our system directly addresses structured and unstructured zones in KTPs. Samantaray et al. and Kounlaxay et al. achieved high accuracy on license plates but did not evaluate identity The novelty of this work lies in the dual-pipeline architecture combined with regex-based validation, which has not been emphasized in prior literature . Compared with deep-learning OCR approaches that require thousands of annotated samples and GPU computation, our rule-based dualpipeline runs entirely on CPU . 4 s per imag. and achieves competitive accuracy on 78 low-resource The combined use of static ROI segmentation and regex validation has not been emphasized in prior KTP literature, demonstrating a practical balance between accuracy and efficiency for e-KYC Condition Low contrast Blur . otion/out-offocu. Damaged . cratched/bleedin. Skew/rotated . Cropped . Table 4. Manifestations and impact Observable Symptoms Dominant Example Trace on KTP Image Impact on OCR in Logs Background/printed Word breaks Degraded labels overwhelms and missing such foreground text regex AuTempat/TgiAAy, fails to recover AuKecamatan : Ai address/jobs Ay Letter Character NIK/RTAeRW defocused glyphs substitutions in frequently numeric fields wrong. (OIi0, i1, digits SIi. NIK/RTAeRW Scratches, ink bleeding. Broken words. Spurious AuNama/AlamatAy fragments . surface artifacts jump lines or AuMPAy. Auoat ang TE a. Text lines not horizontal Line finding Labels field order misaligned with missing Au:Ay Missing margins/fields Entire fields Many . RT/RW, Kel/Des. Available online: https://ejournal. id/jeecs Mitigation in the Proposed System CLAHE thresholding. per-ROI adaptive binarization Character mapping regex validation. mild deblurring Dual-pipeline voting word-level language model Angle detection & deskew prior to OCR Card detection check coverage and re-crop | 125 | JEECS (Journal of Electrical Engineering and Computer Science. Vol. No. December 2025, pp. e-ISSN: 2579-5392 p-ISSN: 2528-0260 Conclusion This study proposed a dual-pipeline OCR framework for Indonesian identity cards (KTP), combining Tesseract OCR with structured ROI-based segmentation, dynamic keyword extraction, and regex-driven post-processing. The architecture was designed to improve recognition accuracy under variable capture conditions commonly encountered in e-KYC workflows. The initial experiment conducted on two annotated KTP samples achieved OO96% average character accuracy and 100% field-level accuracy on clean, highquality images. However, this limited dataset did not fully represent real-world conditions. Therefore, the experiment was extended to 78 KTP images covering diverse acquisition qualities . lur, skew, cropped, damaged, and low-contrast card. The larger-scale evaluation revealed an overall Character Error Rate (CER) of 69. Word Error Rate (WER) of 80. 20%, and an average field-level accuracy of 30. indicating that recognition performance significantly decreases on degraded inputs. Despite the overall drop in quantitative metrics, the expanded evaluation provided a clearer understanding of the systemAos strengths and weaknesses. Structured fields such as NIK. RT/RW, and religion maintained relatively higher accuracy due to their predictable patterns and regex validation. In contrast, free-text fields like name, address, and occupation were more vulnerable to errors caused by blur, skew, and incomplete cropping. Error analysis also showed that frequent misclassifications such as OIi0, i1. SIi5, and BIi8 were effectively reduced by the character-mapping rules in the post-processing stage. Compared to a conventional single-pipeline Tesseract baseline, the proposed dual-pipeline approach demonstrated higher resilience on mixed-quality datasets by leveraging voting and rule-based validation to recover missing or misaligned fields. While deep-learning-based OCR systems may achieve higher accuracy, this rule-based hybrid design remains advantageous for low-resource and on-device deployments due to its minimal computational cost and interpretability. Future work will focus on three key directions: Dataset expansion and categorization into image-quality classes . lean, blur, skew, cropped, damage. for more balanced evaluation. Integration of lightweight deep learning modules . MobileNet-based layout detection or transformer-assisted text-line groupin. to complement rule-based extraction. Synthetic data generation and augmentation to simulate noise, distortion, and rotation for robust model generalization. Overall, the results highlight that the dual-pipeline OCR architecture provides a promising and explainable foundation for KTP digitization in low-resource Indonesian contexts, while emphasizing the necessity of larger, more diverse datasets to ensure consistent real-world performance. References