How to improve the accuracy of AI OCR and MRZ verification in KYC: metrics, errors and working solutions

In KYC processes, even minimal errors in AI OCR and MRZ verification turn into serious consequences: the rejection of legitimate customers, rising operating costs for manual verification, and the risk of letting forged documents through. An accuracy of 98% means two incorrect results for every hundred checks — a critical figure for financial services with thousands of registrations daily. In this article we break down the nature of typical AI OCR and MRZ validation problems, explain the mechanisms behind them, and offer practical methods of prevention at each stage of remote identification.

What exactly “the accuracy of document and MRZ recognition” means in KYC

In the context of KYC, the accuracy of document recognition determines the system’s ability to correctly extract data from passports, driver’s licenses and other identity documents for the subsequent verification of the customer. This is not just the percentage of correctly recognized characters — it is a comprehensive assessment that includes the correctness of extracting all critically important fields (full name, date of birth, document numbers), the validity of the data structure, and its compliance with regulatory requirements.

In the NeuroVision IDP / AI OCR module, data extraction is built as a managed pipeline: document search and classification, image quality checking, the extraction of text/photos/objects, document integrity checking, and machine-readable zone (MRZ) verification are performed. The pipeline supports working with handwritten and printed text, which is important for scenarios where some fields are filled in by hand or contain marks/stamps.

For financial organizations and online services, each recognition error means either the loss of a customer due to the need for repeated verification, or the risk of letting a fraudster with forged documents through. At an accuracy threshold below 95%, the system becomes economically inefficient: the costs of manual checking and repeated verification attempts exceed the benefit of automation.

The machine-readable zone (MRZ) adds an additional level of verification. This standardized area on documents contains encoded information with checksums, which makes it possible not only to recognize the data but also to check its integrity. The accuracy of MRZ verification is measured not only by the correctness of character recognition but also by the system’s ability to identify discrepancies between the visual fields of the document and the machine-readable lines — a key indicator of forgery.

Basic AI OCR quality metrics for documents (field accuracy, WER/CER, confidence)

Field Accuracy is the main metric for KYC systems, showing the percentage of fully correctly recognized document fields. If in the “Name” field the system recognized “Ivan” instead of “Ilan”, the entire field is considered erroneous, even with three out of four characters matching. For critical fields (document number, date of birth), the acceptable level is 98-99%, for less critical ones (place of issue, subdivision code) — 95-97%.

Word Error Rate (WER) and Character Error Rate (CER) measure accuracy at the word and character level respectively. CER is calculated as the ratio of the sum of character substitutions, insertions and deletions to the total number of characters in the reference text. WER uses a similar formula for words. In modern AI OCR systems, the CER for Latin script is 0.5-1%, for Cyrillic 1-2%, for Arabic script and hieroglyphs 2-4%.

Confidence Score is a probabilistic assessment of the system’s confidence in the correctness of the recognition of each character or field. A value from 0 to 1 (or from 0% to 100%) shows how confident the model is in the result. Fields with a confidence below the established threshold (usually 85-90%) are sent for manual checking. The correct calibration of confidence is critical: an overstated confidence lets errors through, an understated one creates an excessive load on operators.

It is important to understand the interrelation of the metrics: a high CER automatically reduces field accuracy, but a low CER does not guarantee the correctness of the fields — a single critical error in the document number nullifies the result of the entire verification. Therefore, in KYC processes, priority is given to field accuracy with mandatory confidence control for each critical field.

Additional metrics for MRZ verification (positioning, completeness, character and field accuracy)

MRZ positioning accuracy measures the system’s ability to correctly locate the machine-readable zone in the document image. The metric includes the percentage of successful MRZ detection (it must exceed 99.5% for quality images) and the accuracy of determining the boundaries with an error of no more than 2-3 pixels. Inaccurate positioning leads to the cropping of edge characters or the capture of extraneous elements, which critically reduces recognition quality. In NeuroVision IDP / AI OCR, MRZ verification is included in the standard document processing loop, and input image quality control is performed before recognition — as a separate step of the pipeline. This makes it possible to reduce the share of “technical” MRZ errors caused not by the model but by the source image (cropping, rotation, perspective distortion).

Extraction Completeness shows the percentage of successfully recognized mandatory MRZ fields. For documents of the ICAO 9303 standard, the system must extract all 88 characters for passports (two lines of 44 characters) or 90 characters for ID cards (three lines of 30 characters). Missing even one mandatory field makes verification impossible.

Image

Character accuracy in the MRZ has particular specifics due to the limited set of allowed characters (only Latin letters, digits and the filler character “<“). This simplifies recognition but requires strict adherence to the format: the system must distinguish similar characters (O and 0, I and 1, S and 5) with an accuracy of 99.8-99.9%. Each error can lead to a checksum mismatch.

Checksum validation is a metric unique to the MRZ, showing the percentage of documents that have correctly passed the verification of all check digits. The ICAO standard defines checksums for the document number, date of birth, expiration date, and a composite checksum. A mismatch of any of them signals either a recognition error (a repeat is required) or a document forgery (an in-depth check is required).

MRZ processing speed is also critical for the user experience: the full cycle from image capture to the validation of all fields must not exceed 1-2 seconds on modern hardware, while maintaining the indicated accuracy figures.

Typical AI OCR errors when recognizing documents in KYC

Document recognition in KYC processes faces a set of technical challenges that lead to errors at different processing stages. Understanding the nature of these errors is critical for building a reliable verification system. Modern AI OCR systems achieve an accuracy of 98-99%, but the remaining 1-2% of errors can create substantial risks for the business — from refusing legitimate customers to letting fraudsters through.

Document recognition errors form a cascading effect: a problem at the image capture stage is amplified during field detection and becomes critical during data validation. Let’s look at the main categories of errors and their impact on the quality of KYC verification.

Image capture errors (resolution, focus, glare, tilt, cropping of fields)

The quality of the input image determines the accuracy ceiling of the entire recognition system. At a resolution below 300 DPI, small security elements and MRZ characters become unreadable, and the algorithm begins to “guess” the outlines of letters. Studies show that reducing the resolution from 600 to 150 DPI increases the number of character errors by a factor of 3-4.

Defocused images create a blurring of character boundaries, especially critical for similar letters and digits. The characters “0” and “O”, “1” and “I” become indistinguishable with a loss of sharpness of even 15-20%. The autofocus of mobile cameras often focuses on the background instead of the document if the document occupies less than 70% of the frame.

Glare from the laminated surface of passports and ID cards obscures entire areas of text. A typical error is shooting at a right angle to the light source, when the glare hits critical fields: the series, number, date of issue. OCR systems interpret overexposed areas as spaces or generate random characters.

A document tilt of more than 5-7 degrees disrupts the work of line segmentation algorithms. The text begins to “slide” between lines, especially in densely filled zones. Perspective distortions when shooting at an angle deform the proportions of the characters — round letters become oval, vertical strokes lean.

Cropping of the document edges is a frequent problem with automatic framing. Border detection systems cut off 3-5% of the area around the perimeter, losing parts of MRZ lines, the document number, signatures. This is especially critical for documents with information placed close to the edges — driver’s licenses, visas, work permits.

Errors in determining the document type and the MRZ zone

Incorrect classification of the document type triggers the wrong data extraction template. The system mistakes an international passport for an internal one, a driver’s license for an ID card, a temporary identity certificate for a permanent one. Each type has a unique field structure — a classification error means searching for data where it is not located.

Detecting the MRZ zone is complicated by the variability of its placement. In the passports of different countries, the MRZ may be at the bottom of the first page, on the spread, or on a separate page. The algorithms look for the characteristic patterns of the “<” character, but decorative elements, watermarks, and stamps create false positives. The system may mistake a barcode, a QR code, or even an ornament for the MRZ.

Partial obstruction of the MRZ is a common problem. The finger of the person holding the document covers 2-3 characters, the scanner boundary cuts off the last positions, a page fold hides the checksums. OCR tries to reconstruct the hidden characters from context, but for the MRZ this is impossible — each character is critical for validation.

Multiple MRZs on one page confuse the prioritization algorithms. Visas, border-crossing stamps, and registration marks contain MRZ-like structures. The system must determine the document’s main MRZ among dozens of similar text blocks.

OCR character errors (character substitution, similar letters and digits, special characters)

Visually similar characters account for up to 40% of all recognition errors. The pairs “O-0”, “I-1”, “S-5”, “B-8”, “Z-2” differ by minimal graphic features. In Cyrillic documents, specific substitutions are added: “З-3”, “Ч-4”, “б-6”. The fonts of state-standard documents often reinforce the similarity — the digit “0” is printed with a diagonal stroke, making it resemble the letter “Ø”.

Special characters and diacritical marks are interpreted incorrectly in 15-20% of cases. The umlauts of German names (ü, ö, ä) turn into base Latin letters or pairs of characters. Apostrophes in Irish surnames (O’Brien) are recognized as quotation marks, periods, commas. Hyphens in double surnames are confused with dashes, minuses, underscores.

Ligatures and merged characters form phantom letters. Dense printing or low scanning quality leads to the merging of “rn” into “m”, “cl” into “d”, “vv” into “w”. The reverse problem is breaks in characters: “н” splits into “и” and “i”, “м” into “iv”, “д” into a combination of vertical strokes.

Contextual substitution occurs when OCR “corrects” correctly recognized characters, relying on a dictionary. Rare surnames are corrected to common ones, and document numbers similar to dates are formatted with the addition of separators.

Field errors and logical inconsistencies (dates, numbers, full name, field format)

Date formatting creates systematic errors in international verification. The American format MM/DD/YYYY conflicts with the European DD.MM.YYYY. The date “03/04/2023” is interpreted as April 3 or March 4 depending on the system settings. A two-digit year “25” can mean 1925 or 2025 — critical for determining the customer’s age.

The transliteration of names between alphabets generates multiple spelling variants. The surname “Щербаков” appears in different documents as Shcherbakov, Scherbakov, Shherbakov, Shtsherbakov. Matching systems must take into account all transliteration variants according to the ICAO, GOST, and BGN/PCGN standards.

Breaks in compound fields disrupt data integrity. The document number “AB 123456” may be recognized as three separate fields, the passport series is separated from the number, the subdivision code loses its hyphen. Addresses are split arbitrarily: the house number ends up in the street field, the postal code is mixed with the city.

Logical checks reveal impossible combinations: a document issue date earlier than the date of birth, a 50-year validity period for a passport, an owner’s age of 150 years. But excessive validation rejects correct data — the passports of centenarians, documents with an extended validity period, special series for diplomats.

A mismatch between the extracted data and reference formats blocks 5-7% of legitimate documents. Belarusian passports use Latin script for the MRZ but Cyrillic for the visual fields. Indian Aadhaar documents contain 12-digit numbers instead of the usual 9-10 characters. Each country introduces unique specifics that the validation system must take into account.

Specific MRZ verification errors for documents in KYC

The machine-readable zone (MRZ) is a standardized element of a document intended for automatic reading and verification. In KYC processes, the MRZ serves as a critically important component of dual verification: the algorithms first recognize the text in the visual part of the document, then read the encoded MRZ data and compare the results. The specifics of MRZ errors lie in their structural nature — even one incorrectly recognized character can lead to the complete rejection of the document by the verification system.

MRZ verification differs from standard OCR recognition by its strict requirements for the format and positioning of the data. The ICAO Doc 9303 standard defines the exact structure of each document type: the number of lines (2 or 3), the length of each line (30, 36 or 44 characters), the positions of specific fields, and the algorithms for calculating checksums. A violation of any of these rules automatically signals a problem with the document or the quality of its recognition.

Violations of the structure and format of MRZ lines

Structural MRZ errors arise from the incorrect determination of the boundaries of the machine-readable zone or the distortion of its geometry. A typical problem is the incorrect determination of the number of lines: the system may interpret a three-line passport MRZ as two-line due to the merging of lines with poor image quality or an incorrect shooting angle. In passports of the TD3 format, each line contains exactly 44 characters, in TD1 ID cards 30 characters. A shift of even one character disrupts the entire subsequent field structure.

Positional errors manifest in the incorrect alignment of characters relative to the expected field positions. The document type field always begins at the first position of the first line and occupies 2 characters (P< for a passport, I< for an ID card). If the algorithm incorrectly determined the start of the line or skipped a filler character (<), the entire subsequent interpretation of the fields will be incorrect. The country code must be at positions 3-5, the name begins at position 6 — a shift of one position makes the correct extraction of data impossible.

Breaks and merges of lines are a separate category of structural violations. With perspective distortions of the document or glare on the laminated surface, OCR may perceive one MRZ line as two separate ones or, conversely, combine adjacent lines. This is especially critical for documents with a three-line MRZ, where the third line contains additional personal data and the final checksum of the entire document.

Errors in checksums and character encoding

Checksums in the MRZ are calculated using a modulo-10 algorithm with weighting coefficients of 7-3-1 repeating cyclically. Each character is assigned a numeric value: digits keep their value, letters A-Z receive values of 10-35, the filler character (<) has a value of 0. A recognition error of even one character in a protected field leads to a checksum mismatch.

In a passport of the TD3 format there are five checksums: for the document number (position 10), date of birth (position 20), expiration date (position 28), personal number (position 43), and the composite checksum of the second line (position 44). The incorrect recognition of the digit 0 as the letter O or the digit 1 as the letter I instantly disrupts validation. Statistics show that O/0 and I/1 substitutions account for up to 15% of all MRZ checksum errors.

The encoding of special characters in the MRZ follows strict transliteration rules. Letters with diacritical marks are replaced with base Latin equivalents (Ü→U, É→E, Ñ→N), apostrophes and hyphens are omitted, double names are separated by the < character. Transliteration errors when matching against the visual zone of the document often lead to false positives from the security system. The name MÜLLER in the visual zone must correspond to MUELLER in the MRZ — a mismatch is interpreted as a sign of forgery.

Mismatches between MRZ data and the visual zone of the document

Cross-validation of data between the MRZ and the visual part of the document reveals discrepancies in key fields. Dates in the MRZ are stored in the YYMMDD format without separators, whereas the visual zone uses national formats (DD.MM.YYYY, MM/DD/YYYY). An error in converting the format or an incorrect interpretation of the century (19XX vs 20XX for persons over 25) creates a critical discrepancy.

First names and surnames are truncated when written into the MRZ due to the field length limit. The full name АЛЕКСАНДР КОНСТАНТИНОВИЧ in the visual zone of a Russian passport may be shortened to ALEKSANDR<KONSTANTI in the MRZ. The validation algorithm must take the truncation rules into account and not interpret this as a mismatch. However, if characters appear in the MRZ that are absent in the visual zone, this is an unambiguous sign of a problem.

Document numbers often contain spaces or separators in the visual zone (AB 1234567) but are written continuously in the MRZ (AB1234567<<<). The system must correctly normalize both representations before comparison. National documents with alphanumeric serial numbers present a particular challenge, where OCR may confuse visually similar characters in different parts of the document.

MRZ anomalies indicating forgery or editing

Physical signs of manipulation with the MRZ include unevenness of the font, violation of inter-character spacing, and deviation from the standard height of OCR-B characters (4 mm according to ISO 1073-2). Modern systems analyze micro-deviations in the positioning of characters: a genuine MRZ is printed as a single block with an accuracy of ±0.1 mm, whereas with a forgery deviations of up to ±0.5 mm are observed between individual characters or groups.

Logical anomalies are revealed through the analysis of the internal consistency of the data. The country-of-issue code must correspond to the format of the document’s serial number — Russian passports always begin with a two-digit series, US documents contain alphanumeric combinations of a certain structure. A mismatch of the serial-number template with the declared country of issue indicates a forgery with a probability above 95%.

Temporal inconsistencies represent a separate class of anomalies. The issue date cannot exceed the expiration date, and a passport’s validity period cannot exceed 10 years for adults or 5 years for children in most jurisdictions. The discovery of a document with the owner’s date of birth falling on a non-working day in the corresponding country may indicate a forged document — many countries do not register births on non-working days.

Statistical anomalies are revealed through the analysis of the frequency of field combinations. Certain combinations of dates of birth and document numbers occur significantly more often in forged documents — fraudsters use a limited set of templates. Machine learning systems, trained on arrays of genuine and forged documents, identify such patterns with an accuracy of up to 92%, complementing traditional methods of MRZ verification.

Image

How to set up an AI OCR pipeline to reduce document recognition errors

The correct configuration of the document recognition pipeline determines the difference between an accuracy of 85% and 99%. Each processing stage — from receiving the image to final validation — affects the resulting quality of the KYC process. Let’s look at the critical optimization points that radically reduce the number of recognition errors.

Requirements for input image quality and UX prompts to the customer

The quality of the input image determines the accuracy ceiling of the entire pipeline. At a resolution below 300 DPI, OCR accuracy drops by 15-20%, at 150 DPI by 40%. The optimal resolution for documents is 300-600 DPI, for the MRZ zone a minimum of 250 DPI per line of characters.

Critical image parameters include even lighting (brightness deviation of no more than 20% across the document area), the absence of shadows in the zone of text fields, and text-to-background contrast of at least 70%. The document must occupy at least 70% of the frame, the edges fully visible, the tilt not exceeding 5 degrees.

UX prompts substantially improve capture quality. A visual frame with automatic detection of the document corners increases the share of quality shots on the first attempt to 82%. A real-time quality indicator (checking focus, lighting, positioning) reduces the number of repeat attempts by 60%.

Text prompts must be specific: instead of “Photograph the document”, use “Place the passport horizontally in the frame, avoid glare from lamps”. Automatic shooting when the optimal conditions are reached works more effectively than manual in 73% of cases.

Image preprocessing before OCR (cropping, alignment, normalization)

Automatic detection of the document boundaries through contour-search algorithms (Canny edge detection with adaptive thresholds) ensures a cropping accuracy of 98.5%. Adding a margin of 2-3% of the document size after cropping prevents the loss of characters at the edges.

Perspective correction through a homographic transformation corrects distortions when shooting at an angle of up to 30 degrees. Automatic horizontal alignment based on the detection of text lines reduces recognition errors by 8-12%.

Normalization of brightness and contrast through adaptive histogram equalization (CLAHE) improves the readability of text under uneven lighting. The application of a bilateral filter removes noise while preserving the sharpness of character boundaries. Binarization by the Otsu or Sauvola method is effective for documents with watermarks and security features.

Removing background elements through morphological operations (opening, closing) cleans the image of scanning artifacts. Sharpening through unsharp masking increases the recognition accuracy of small text by 5-7%.

Post-processing of OCR results: formats, dictionaries, regular expressions, correction of typical errors

Validation of field formats through regular expressions cuts off 95% of logical errors. Passport numbers are checked against the mask of the country of issue, dates against the acceptable ranges and chronological sequence (the issue date cannot be earlier than the date of birth).

Dictionaries of first names and surnames of specific regions correct transliteration errors. A database of the 50,000 most common names covers 92% of cases. The Levenshtein algorithm with a distance threshold of 1-2 characters corrects typical substitutions (O→0, l→1, rn→m).

Contextual correction takes into account the interrelations of fields: the region code in the passport series must correspond to the place of issue, the check digits of the INN are verified algorithmically. Cross-validation of the visual fields with the MRZ data reveals discrepancies in the spelling of names and dates.

Automatic correction of frequent OCR errors (substitution of similar characters, merging/splitting of letters) through substitution tables increases accuracy by 3-5%. Normalizing spaces, removing extra characters, and bringing everything to a single case unifies the output data.

Using confidence thresholds and manual checking for borderline cases

A multi-level threshold system divides the results into categories: automatic acceptance (confidence > 95%), requires checking (85-95%), mandatory manual verification (< 85%). The thresholds are configured individually for each field type — critical data (document number, full name) requires higher confidence.

Intelligent routing directs complex cases to operators with the appropriate specialization. Documents with non-standard fonts, damage, or rare languages are handled by experts. The system learns from the operators’ decisions, gradually increasing the share of automatic processing.

Partial manual checking focuses only on fields with low confidence, reducing verification time by 70% compared with a full check. The operator’s interface highlights the problem zones and offers options from OCR with an indication of the probability.

Dynamic adjustment of thresholds based on error statistics optimizes the balance between automation and accuracy. When the false positive rate grows, the automatic acceptance threshold is raised; when there is an excessive load on operators, it is lowered within acceptable limits.

How to build reliable MRZ verification of documents in the KYC process

The machine-readable zone (MRZ) remains a critically important element of the automated verification of documents, despite the development of technologies for recognizing visual data. Properly configured MRZ verification identifies up to 95% of forged documents at the initial check stage, substantially reducing the load on operators and the risks of fraud. Building such a system requires a clear understanding of the technical nuances and the correct sequence of validation steps.

The sequence of MRZ verification: detection, recognition, structuring of data

01
Searching for characteristic patterns
MRZ detection begins with searching for characteristic patterns in the document image. Modern algorithms use cascade classifiers or convolutional neural networks to determine the area with machine-readable text. It is critically important to correctly determine the MRZ type — TD1 (ID cards), TD2 (visas), TD3 (passports) or MRVA/MRVB (type A and B visas), since all subsequent checks depend on this. The algorithm must take into account possible perspective distortions, partial obstruction of the zone, and variations in lighting.
02
Character-by-character recognition
After the zone is localized, character-by-character recognition is performed using specialized OCR models trained on the OCR-B font. Here, not just high accuracy in recognizing individual characters is important (it must exceed 99.5%), but also an understanding of the context — the algorithm must distinguish the allowed characters for each position. Letters are not allowed in the date-of-birth field, digits are not allowed in the nationality field, and the filler character “<" has strictly defined positions of use.
03
Structuring the recognized data
The structuring of the recognized data happens according to the ICAO Document 9303 specifications. Each field has a fixed length and position in the line. The parser must correctly handle compound names separated by “<<" characters, and take into account possible abbreviations and transliterations. Fields with a variable data length require special attention — for example, the document number can occupy from 6 to 9 characters, and the remaining space is filled with filler characters.

Checking checksums and the acceptable ranges of field values

The algorithm for calculating checksums in the MRZ is based on a 7-3-1 weighting scheme repeating cyclically. Each character is assigned a numeric value (digits keep their value, letters receive values from 10 to 35, the “<” character equals 0), which is multiplied by the corresponding weighting coefficient. The sum of the products is divided by 10, and the remainder of the division must match the check digit in the document.

In passports, five checksums are checked: for the document number, date of birth, validity period, personal number, and the composite checksum for the entire second line of the MRZ. A mismatch of even one checksum indicates, with a probability of 90%, a recognition error or a document forgery. At the same time, the system must take known exceptions into account — some countries use non-standard calculation algorithms for certain types of documents.

Value range validation includes checking dates for realism and logical consistency. The date of birth cannot be in the future or more than 150 years ago, and the document’s validity period usually does not exceed 10 years for passports and 5 years for ID cards. The country code must correspond to the official ISO 3166-1 alpha-3 list, and sex can take only the values M, F or X (for undetermined). The document number is checked for compliance with the known formats of the issuing country — for example, Russian passports have a format of 10 digits divided into a series and a number.

Cross-validation of the MRZ with the visual part of the document and external databases

Matching the MRZ data against the visually readable zone of the document reveals a significant portion of forgeries, where fraudsters change only the visible information without affecting the machine-readable zone. The algorithm must extract text data from the visual fields of the document and compare it with the decoded MRZ, taking into account possible differences in transliteration and formatting. Discrepancies in dates, names, or the document number require an additional manual check or automatic rejection.

Checking against external databases includes several levels of validation. The first level is checking the format and checksums of the document number against a database of known templates for each issuing country. The second is a query to available government databases of invalid documents, if such are provided (for example, the MVD of Russia’s database of lost and invalid passports). The third level is checking the correspondence of the biographical data against sanctions lists and PEP (politically exposed persons) databases.

Biometric matching of the photograph from the document with the user’s selfie adds an additional level of protection. At the same time, it is important to take into account possible changes in appearance over time — the photograph in the passport may have been taken up to 10 years ago. The algorithm must set different similarity thresholds depending on the age of the document and the age of the owner.

Automatic rejection rules and risk flags based on the results of MRZ verification

The automatic decision-making system must operate with several categories of rules. Critical violations leading to immediate rejection: a checksum mismatch, an incorrect MRZ format, the use of invalid characters, a discrepancy of key data between the MRZ and the visual zone exceeding a set threshold. Such cases account for about 15-20% of the total flow of checks and are most often associated with attempts to use forged documents.

Medium-risk flags require an additional check by an operator or a request for additional documents. These include: a mismatch of the photo’s age with the document’s declared issue period, suspicious patterns in the document number (for example, the consecutive digits 123456), a mismatch of the country of issue with the declared citizenship, a validity period expiring in the next 3 months. Such cases account for 25-30% of checks and require an individual approach.

Behavioral risk indicators track patterns characteristic of fraud schemes: multiple verification attempts with different documents over a short period, the use of documents from high-risk jurisdictions, a match of biometric data with previously rejected applications, attempts to upload low-quality images or images with signs of digital processing. The system must accumulate statistics on such cases and automatically adjust the trigger thresholds of the rules.

The system’s final decision is formed based on a weighted assessment of all the checks. Each type of violation is assigned a risk weighting coefficient, and if the total figure exceeds the established threshold, the application is sent for a manual check or rejected. It is important to regularly analyze the statistics of false positives and false negatives, adjusting the weights and thresholds to achieve the optimal balance between security and convenience for legitimate users.

Quality control and monitoring of AI OCR and MRZ accuracy in production

Launching AI OCR into production is only the beginning of the journey. The real performance of a document recognition system manifests when processing thousands of diverse documents daily: worn passports, overexposed driver’s licenses, documents in rare languages. Without systematic quality control, even the most accurate model will begin to degrade under the pressure of real data.

The production environment constantly delivers surprises: new document types, changes in passport designs after legislative updates, a mass influx of customers from unexpected regions with local document specifics. The monitoring system must track these changes in real time and signal a drop in quality before it is noticed by end users or the regulator.

Setting up quality metrics and OCR/MRZ error thresholds for KYC

The basic Field Accuracy Rate (FAR) metric — the percentage of correctly recognized document fields — must be measured not globally but for each critical field separately. For the document number, the acceptable threshold is 99.5%, for the date of birth 99%, for the patronymic 95%. The difference is due to the criticality of the fields for the KYC process and the frequency of non-standard spellings.

The Character Error Rate (CER) for the MRZ zone must not exceed 0.5% per character. This strict requirement is dictated by the structure of the machine-readable zone: one error in the checksum makes the entire document invalid. At the same time, it is important to separate the metrics for different types of MRZ: TD1 (ID cards), TD2 (A5-format passports), TD3 (standard passports) have different line lengths and numbers of checksums.

The Confidence Score — the level of the model’s confidence in the result — requires a differentiated approach. For critical fields (document number, full name), a minimum threshold of 0.85 is set. Documents with a confidence below the threshold are automatically sent for manual checking. At the same time, it is important to track the False Positive Rate: an overly high confidence threshold will lead to an excessive load on operators.

Time-to-result (TTR) — the time from uploading the image to receiving the structured data — is critical for the user experience. For synchronous requests in KYC scenarios, the acceptable value is up to 2 seconds per document, including image preprocessing, OCR and MRZ validation. Exceeding the threshold by 20% should trigger an alert in the monitoring system.

The Rejection Rate — the percentage of documents rejected by the system due to low quality or discrepancies — balances between security and conversion. The optimal range is 3-7%. Below that — the risk of missing forgeries, above that — the loss of legitimate customers. The metric requires segmentation by document type and customer geography.

Error logging, incident analysis and model retraining

Structured logging begins with recording the context of each transaction: timestamp, user_id, document_type, country_code, image_quality_metrics, ocr_engine_version. Each document field is logged with an indication of the recognized value, confidence score, and processing time. For the MRZ, the raw lines before parsing and the results of the checksum verification are additionally saved.

The classification of errors speeds up their elimination. The following categories are distinguished: image quality (blur, glare, crop), detection errors (missed_field, wrong_document_type), recognition errors (character_substitution, field_format_error), logical inconsistencies (date_out_of_range, checksum_mismatch). Each category has its own priority and SLA for correction.

The automatic collection of problem cases forms a dataset for retraining. The system selects documents with a confidence < 0.7, documents with a discrepancy between the MRZ and the visual zone, and cases of manual correction by operators. It is critically important to save the source images in a de-identified form with the users’ consent — without them it is impossible to improve the model.

Incident management follows a clear protocol. When the FAR drops by 5% within an hour, a first-level alert is triggered — a check of external factors (a change in traffic quality, a mobile application update). With a systemic degradation of metrics, a rollback to the previous model version is activated with a parallel root-cause analysis.

The model retraining cycle is launched monthly or when 10,000 new annotated examples have accumulated. Important: the new model is tested not only on fresh data but also on a golden dataset — a reference set of 50,000 documents covering all supported types and countries. A regression in quality on the golden dataset blocks the deployment into production.

A/B testing and the periodic re-evaluation of AI OCR and MRZ verification engines

Shadow mode testing makes it possible to evaluate a new OCR engine without risk to production. In parallel with the main engine, a candidate is launched, processing a copy of the incoming stream. The results are compared offline on key metrics: accuracy, speed, processing cost. Testing lasts a minimum of two weeks to collect a statistically significant sample.

Canary deployment gradually switches traffic to the new version: 1% → 5% → 20% → 50% → 100%. At each stage, not only technical metrics are tracked but also business KPIs: conversion into successful verification, the percentage of support requests, the customer’s onboarding time. A rollback is possible at any stage if the metrics deviate from the baseline by more than 3%.

A multi-vendor strategy uses several OCR providers at once. The main engine processes 70% of the traffic, the backup 20%, the experimental one 10%. Routing is based on the document type and the history of success: for RF passports, engine A with an accuracy of 99.2% is used, for US driver’s licenses engine B with an accuracy of 98.8%. Dynamic redistribution of traffic maximizes the overall accuracy of the system.

A quarterly benchmark compares the performance of the current solution with the market. A control set of 1,000 documents is created, including edge cases: old passports, temporary certificates, documents with non-standard fonts. The set is run through the company’s own system and 2-3 alternative solutions. The results are recorded in a comparative table by parameters: field accuracy, MRZ processing, speed, stability.

The cost-per-verification metric balances quality and economics. It includes the cost of OCR requests, computing resources, the work of operators on manual checking, and losses from false rejects. The optimization of one parameter must not disproportionately increase the others: increasing automation by 10% is justified if the cost of manual processing decreases by at least 15%.

Version control of models and configurations is critical for the reproducibility of results. Each version of the OCR engine is tagged with an indication of: the model version, the preprocessing pipeline, the postprocessing rules, the confidence thresholds. A Git-like versioning system makes it possible to roll back to any stable configuration and conduct comparative testing between versions.

A practical checklist: how to minimize OCR and MRZ errors in KYC

Implementing AI OCR for document verification requires a systematic approach to quality control. The correct setup of testing, automatic checks, and evaluation criteria determines the success of the entire KYC process.

Mandatory tests and validations before launching into production

CategoryDescription
The test datasetThe test dataset must contain a minimum of 1,000 samples of documents of each supported type with various shooting conditions: changes in lighting, tilt angles of up to 30 degrees, partial glare, motion blur. Include documents with natural wear — scuffs, creases, faded ink. Be sure to add edge cases: documents with a non-standard font, handwritten elements, stamps over text.
Functional testingFunctional testing checks the correctness of extracting each document field with the measurement of the Character Error Rate (CER) and Word Error Rate (WER). Target figures: CER < 2% for Latin script, < 3% for Cyrillic, WER < 5% for structured fields. Separately validate the recognition of critical fields — the document number, the dates of issue and expiration, personal data.
MRZ checkingMRZ checking requires special attention. Test the recognition of all three MRZ types (TD1, TD2, TD3), the validation of checksums by the ICAO 9303 algorithm, the correctness of parsing special characters (<, >>, filler spaces). The system must correctly handle damaged MRZ zones, restoring data through checksums where this is possible.
Load testingLoad testing determines the real performance of the system. Check the processing of simultaneous requests (a minimum of 100 parallel sessions), the response time under peak loads (95th percentile < 3 seconds), the stability of operation under a prolonged load (24 hours of continuous operation without degradation of quality).
Security testingSecurity testing includes checking resistance to image-substitution attacks, the validation of the processing of incorrect data without system failures, and control over leaks of personal data in logs and API responses.

The minimum set of automatic checks for documents and the MRZ

Image quality validation is launched first. Check the resolution (a minimum of 300 DPI for text zones), sharpness through gradient analysis (Laplacian coefficient > 100), lighting and contrast through histogram analysis, the completeness of document capture through boundary detection.

Structural document validation confirms the correspondence of the extracted data to the expected format. Control the presence of all mandatory fields, the correspondence of formats (dates in ISO 8601, numbers by the document mask), the falling of values within the acceptable ranges (dates of birth from 1900, validity periods of no more than 20 years).

Cross-checking of data between the visual zone and the MRZ reveals discrepancies. Compare full names taking ICAO transliteration into account, dates with format conversion, document numbers with the removal of separators. Discrepancies should automatically raise the risk level of the transaction.

Checking the logical integrity of the data includes validating the chronology of dates (issue < expiration, birth + 14 years < issue for adult documents), the correspondence of sex and name to statistical models, the correctness of regional codes and document series.

Anti-fraud checks are launched in parallel: the detection of signs of digital editing through the analysis of compression artifacts, checking the consistency of fonts and text alignment, the analysis of image metadata for signs of manipulation.

The system must automatically form a confidence score for each field and the document as a whole. When the figures are below the threshold values (usually 0.85 for critical fields, 0.75 for auxiliary ones), a manual check or a request for re-shooting is triggered.

In NeuroVision, the minimum “skeleton” of checks is implemented as five mandatory KYC verification stages: extracting data from the document, checking the photograph for a match, anti-fraud checks, checks against databases, and liveness.

To expand the checklist, additional checks are available: automatic determination of the document type, document recognition from a video stream, analysis of the device’s digital footprint, hybrid recognition, as well as checks against sanctions lists, the list of terrorists, and other registries. 

Criteria for choosing and assessing the quality of an AI OCR provider for KYC scenarios

Technical characteristics determine the basic suitability of a solution. Assess the recognition accuracy on your real documents (a target level of > 95% for field accuracy), the processing speed taking all pipeline stages into account (< 2 seconds per document), support for the required document types and countries (a minimum of 50 countries for an international business).

Integration capabilities are critical for fast implementation. Check for the presence of a REST API with detailed documentation, an SDK for the main programming languages, ready-made modules for popular KYC platforms. The possibility of both cloud and on-premise deployment is important for complying with regulators’ requirements.

Compliance with security standards is mandatory for the financial sector. Require ISO 27001, SOC 2 Type II certificates, confirmation of GDPR compliance and compliance with local personal data protection legislation. The provider must ensure the encryption of data at rest and in transit, access auditing, and the ability to delete data on request.

Assess the quality of MRZ processing separately. The provider must support all current ICAO standards, correctly handle non-standard MRZ implementations of various countries, and provide detailed information about validation errors with recommendations for correction.

Economic parameters include not only the cost per transaction but also the payment model (subscription, pay-per-use, hybrid schemes), the availability of a free trial period with full functionality, and pricing transparency without hidden charges. Calculate the total cost of ownership, including integration, support and scaling.

The level of support becomes critical when problems arise. Assess the first response time of technical support (SLA < 4 hours for critical incidents), the availability of support in your language and time zone, the presence of a dedicated manager for corporate clients, and the quality of the documentation and training materials.

Additional capabilities can become the deciding factor. Valuable advantages would be: automatic improvement of image quality, support for a video stream for real-time verification, integration with databases for additional validation, the ability to fine-tune models on your data, regular updates to support new document types.

Conclusion
The reliability of KYC processes is built on the systematic minimization of AI OCR and MRZ errors

The accuracy of recognizing documents and machine-readable zones directly determines the quality of remote customer verification. AI OCR and MRZ verification errors are inevitable at the start, but the methodical tuning of the pipeline — from image quality requirements to the cross-validation of fields and automatic rejection rules — makes it possible to reduce them to a level acceptable for production. The preprocessing of input data, the post-processing of results, checksum control, incident logging, and the regular re-evaluation of engines ensure the stability of recognition accuracy in real operating conditions.

Companies that implement KYC solutions gain a measurable advantage by relying on proven algorithms and the experience of providers who have already fine-tuned the mechanisms for combating typical and specific errors. Properly built document verification speeds up onboarding, reduces manual checks, and protects the business from fraud, while the choice of a technology partner with confirmed recognition accuracy and flexible monitoring tools becomes a strategic decision for scalable growth.