Intelligent Authentication and System Optimization Methods Based on Passport Data and Knowledge Base
By acquiring dual-source data through a microscopic imaging architecture, combined with grayscale processing and multi-dimensional feature extraction, and employing a nationality-certificate number dual-index multi-level matching strategy, a dynamic decision matrix is constructed. This solves the problems of single data collection, low recognition accuracy, and low rule matching efficiency in passport verification, and achieves efficient and accurate passport verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中华人民共和国上海出入境边防检查总站
- Filing Date
- 2025-12-26
- Publication Date
- 2026-07-31
AI Technical Summary
Existing passport verification technologies suffer from problems such as limited data collection dimensions, limited character recognition accuracy, low efficiency in matching issuance rules, and lack of closed-loop optimization in the verification process. These make it difficult to cope with the challenges of forgery technologies, and there is insufficient quantification of image quality assessment, field separation accuracy, and rule consistency.
By acquiring dual-source data through a microscopic imaging architecture, combining grayscale processing and multi-dimensional feature extraction, and employing a nationality-certificate number dual-index multi-level matching strategy, a dynamic decision matrix is constructed to achieve the linkage verification of images and structured information, and closed-loop optimization is performed through a rule management module.
It achieves complementary verification of images and structured information, improves the reliability of character recognition and the quantitative evaluation of recognition results, adapts to the issuance policies of different countries, improves verification efficiency and accuracy, and reduces long-term maintenance costs.
Smart Images

Figure CN121838116B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security and anti-counterfeiting technology, specifically involving an intelligent identification and system optimization method driven by passport data and knowledge base. Background Technology
[0002] Currently, passport verification still has the following areas for improvement: In the context of globalized personnel mobility and cross-border transactions, passports, as core internationally recognized identity documents, play a crucial role in verifying their authenticity and validity in areas such as customs clearance, cross-border finance, and foreign affairs services. With the iterative advancements in forgery technology, traditional passport verification methods relying on manual checks and single-field comparisons are no longer sufficient to address the challenges posed by complex forgery techniques. Therefore, there is an urgent need to build an efficient, accurate, and automated verification system.
[0003] Current passport verification technologies suffer from the following key pain points: First, data collection is limited to a single dimension. Most solutions rely solely on structured information extracted by document readers or image data obtained through microscopic imaging, failing to achieve dual-source data fusion of image features and structured information. This results in incomplete verification criteria—for example, structured information alone cannot identify physical tampering traces in characters within an image, and relying solely on image data makes it difficult to quickly match country-specific issuance rules. Second, character recognition accuracy is limited. Traditional optical character recognition (OCR) is based on single grayscale features or standard template matching, without optimization for characters in the machine-readable area of passports. This makes it prone to recognition errors due to insufficient grayscale contrast and noise interference, and lacks quantitative assessment of the reliability of recognition results, further affecting the accuracy of subsequent verification decisions. Third, the efficiency of matching issuance rules is low, as different countries / There are significant differences in passport issuance standards across regions. Existing solutions mostly use a fixed rule base for item-by-item matching, which cannot achieve multi-level rapid indexing of nationality, document number, and standards. Furthermore, rule base updates rely on manual maintenance, making it difficult to adapt to dynamically changing issuance policies. Fourth, the verification process lacks closed-loop optimization. The feedback data from manual review is not linked with the recognition template library and rule base, leading to the recurrence of historical misidentification cases. Verification accuracy cannot iteratively improve with the accumulation of actual application data. At the same time, the decision-making response mode is rigid and fails to achieve flexible adaptation between machine autonomous decision-making and precise manual intervention based on the type of verification deviation, affecting verification efficiency.
[0004] Furthermore, existing technologies also have shortcomings in key sub-steps such as image quality assessment, field separation accuracy, and rule consistency quantification: for example, image quality judgment only focuses on the single dimension of sharpness, without combining multiple dimensions such as grayscale contrast and noise interference for comprehensive evaluation, resulting in low-quality images directly entering the recognition stage and causing errors; machine-readable area field separation relies on fixed regular expressions and does not introduce a dual confirmation mechanism of semantic verification and boundary verification, which is prone to field splitting errors due to mismatch of character fragments; rule consistency judgment lacks quantitative standards and mostly adopts binary results of conformity or non-conformity, which cannot accurately reflect the degree of conformity between the certificate and the issuance specifications, and is difficult to support refined decision-making. Summary of the Invention
[0005] To address the aforementioned problems in the existing technology, this invention provides an intelligent identification and system optimization method driven by passport data and knowledge base.
[0006] The objective of this invention can be achieved through the following technical solutions: S1: Preset microscopic imaging architecture to acquire passport and document image data, extract the structured information of the passport and document through document reader, and obtain dual-source data of image data and structured information; S2: Based on the passport image data, the contrast grayscale features of the passport image data are obtained through grayscale processing. The character regions after orientation correction are obtained by locating characters in the image data through data tags of structured information. Based on the feature parameters of the character regions, the matching analysis is performed with the standard character template library to generate optical character recognition codes and corresponding recognition confidence levels. S3: Based on optical character recognition codes, independent fields are obtained by matching fields using predefined regular expression patterns; machine-readable area fields of passport documents are separated using heuristic rules, and the nationality code and document number of the machine-readable area fields are used as search conditions to perform multi-level rule matching queries in a pre-set issuance rule base to obtain the original issuance specifications that the document information should follow; based on the original issuance specifications, a candidate rule set corresponding to the document is generated using a specification gene chain matching strategy, and a weighted credibility matching is performed on the candidate rule set to generate a quantified rule consistency identifier; S4: Based on the rule consistency identifier and character recognition confidence level, generate verification decision rule instructions and make dynamic responses; update the issuance rule base through the rule management module, adjust the character recognition template base and confidence level correction parameters, and obtain the closed-loop processing of passport document verification.
[0007] As a preferred technical solution of the present invention, the acquisition of contrast grayscale features of passport image data specifically includes: enhancing the local grayscale contrast of the machine-readable region of the passport in the grayscale image using an adaptive histogram equalization algorithm; calculating the local grayscale difference in the enhanced grayscale image, statistically analyzing the mean and variance of the difference to obtain a local contrast feature matrix; marking pixels in the local contrast feature matrix that are greater than a threshold as contrast pixels, statistically analyzing the distribution density and connectivity of the contrast pixels to obtain contrast grayscale features characterizing the difference between the grayscale of the characters and the background.
[0008] Specifically, the process of obtaining the character region after direction correction includes: based on the contrast grayscale image corresponding to the contrast grayscale features, removing high-frequency noise in the image through Gaussian filtering to obtain the grayscale gradient features of the character edges; and using adaptive threshold segmentation to enhance the grayscale contrast between the character and the background to obtain the boundary features between the character region and the background region. Based on the boundary features, the Sobel operator is used to calculate the gray-level gradient values of the image in the horizontal and vertical directions to obtain the gradient image of the character edge; based on the gradient image, the character tilt angle is obtained through projection analysis, and the gradient image is rotated along different angles. By comparing the concentration of projection peaks and the uniformity of intervals under different rotation angles, the horizontal rotation angle of the character line is obtained. The original contrast grayscale image is rotated and corrected based on the horizontal rotation angle of the character line. The character region after orientation correction is obtained by comparing the distribution characteristics of the characters in the corrected image with the boundary features obtained in the previous step.
[0009] Specifically, the machine-readable area of the passport includes extracting core features such as grayscale statistics, edge morphology, texture, geometry and projection for the character regions corresponding to each character bounding box, and constructing a multi-dimensional feature vector representing character attributes; calling the field labels related to the machine-readable area in the structured information extracted by the document reader, using them as auxiliary positioning parameters, and performing association verification with the multi-dimensional feature vector; Based on the constructed standard character template library, the multi-dimensional feature vector of the character to be recognized is matched by the minimum Euclidean distance, and the matching results are filtered by the preset character length value in the structured information to obtain the corresponding OCR character code; By using distance matching to preset a basic confidence level, and combining the physical size parameters of the document recorded in the structured information, the clarity and noise interference parameters of the character area are corrected to obtain a confidence level that reflects the reliability of recognition. The character order is determined by sorting the characters by their horizontal coordinates. Referring to the machine-readable area format specifications in the structured information, vertically aligned continuous bounding box sequences are selected. After pixel fusion and splicing, the sequences are double-compare with the standard specifications of the passport machine-readable area and the length of the machine-readable area field in the structured information to verify the machine-readable character area.
[0010] Specifically, obtaining the image quality coefficient of a passport document includes: using the edge gradient magnitude statistical method to extract the edge contours of characters within the machine-readable region, calculating the mean and standard deviation of the edge gradient magnitudes, and obtaining the character sharpness in the first dimension; By analyzing the grayscale difference between the character and the background, the machine-readable area of the character is divided into a character sub-region and a background sub-region. The average grayscale difference between the two types of sub-regions is calculated to obtain the grayscale contrast in the second dimension. By combining noise density statistics and filter residual analysis, the number of noise points in the machine-readable area of the character is counted. After Gaussian filtering, the grayscale residual of the image before and after filtering is calculated. The two are weighted to obtain the third dimension of noise interference quantification value. The weights of the first, second, and third dimensions are calculated to obtain corresponding values. Based on these values, they are compared with a preset threshold to determine the quality coefficient of the passport image.
[0011] Specifically, the step of obtaining independent fields by matching fields through predefined regular expression patterns includes scanning character by character based on the machine-readable OCR code, using predefined regular expression triples to locate the start and end boundaries of the nationality, certificate number, and issuance date fields, and obtaining the first boundary slice. The sliced fields are compared in parallel with single-field rules and relational database combined field rules. The same logical cycle outputs three levels of quantitative indicators: complete match, partial match and rule conflict. Based on the three-level quantization identifier and the original field value, a structured format frame with a timestamp is encapsulated to obtain an independent field for the authenticity decision.
[0012] Specifically, the method of separating the machine-readable area fields of passport documents using heuristic rules includes: employing a three-level heuristic instantaneous parsing mechanism, performing a character-by-character sliding scan of the optical character recognition code in the machine-readable area, loading a pre-set field boundary regularity library; when a character fragment is scanned and completely matches the boundary regularity of the field, the field start and end positioning is triggered, and the start index-end index offset pair of the field in the OCR code is output, and the boundary slice of a single field is obtained in a single clock cycle; The independent fields obtained by boundary-heuristic slicing are fed in parallel into a multi-dimensional semantic verifier. The verifier loads exclusive semantic rules for different field types: for document numbers, it calls the private weighting factor algorithm of the corresponding country; for date fields, it performs logical verification that the issuance time is less than or equal to the expiration time; for document type and issuing agency fields, it performs byte-by-byte comparison with the pre-set document type and agency correspondence table; the verification logic is operated synchronously, and the three levels of semantic level of each field are output at the same clock tick to obtain semantic compliance verification. In the trigger array, the boundary-heurized offset is XORed with the validity result and the semantic-heurized verification level to generate a conflict decision result; based on the conflict decision result of the field, a structured data frame with a timestamp is generated to obtain independent and verified machine-readable area fields that are separated from the machine-readable area OCR code, including nationality code, document number, issuance time, validity period, document type, and issuing authority.
[0013] Specifically, the step of performing multi-level rule matching queries in the pre-set issuance rule base to obtain the original issuance specifications that the document information should follow includes anchoring the nationality code separated by the machine-readable region as the top-level hash index through dual index anchoring of nationality and document number, and locating the rule subset of the corresponding country and region in the issuance rule base; Based on the rule subset, the feature fragments in the certificate number are used as secondary prefix indexes. Within the rule subset, certificate number template rules with the same features are matched to obtain a candidate rule pool and obtain the preliminary range of the original issuance specification. The initial scope locking based on the original issuance specifications utilizes multi-dimensional template dynamic adaptation to obtain a secondary fine screening: for each rule in the candidate rule pool, template elements are extracted, and the template elements are matched with the machine-readable area field execution elements and fields dimension by dimension to obtain the target rule set; a third-level determination is achieved through combined logic tracing verification: for the rules in the target rule set, the rule-specification mapping engine is invoked to logically associate the certificate number encoding logic, validity period limit, and issuing agency authority fields in the rule with the pre-set national and regional issuance specification library, and the unique matching official issuance specification is confirmed through multi-field logical association to obtain the original issuance specification that the certificate information should follow.
[0014] Specifically, the generation of the candidate rule set corresponding to the certificate includes: decomposing the original issuance specification into a four-dimensional specification gene chain consisting of nationality code, certificate number encoding logic, certificate type permissions, and validity constraints; the system calls the gene chain index engine to perform multi-dimensional feature code parallel matching in the pre-set rule gene chain library in the issuance rule library; the matching process adopts a feature code weight progression strategy to quantify and score the matching degree between the rule gene chain and the specification gene chain, and aggregates the matched rules into a candidate rule set corresponding to the certificate.
[0015] Specifically, generating a quantified rule consistency identifier includes employing a spatiotemporal-time-effectiveness dual-factor dynamic weighting and evidence network aggregation mechanism. Dynamic weights are calculated using the recent matching frequency, effective duration, and historical conflict rate of a rule. Evidence from the certificate number matching degree, time interval fit degree, and institutional authority matching degree fields of a single rule are logically linked into an evidence chain. The evidence chain of the entire rule set is then fused with confidence through an evidence network model to obtain a quantified rule consistency identifier.
[0016] Specifically, the process involves generating verification decision rules and responding dynamically. A dynamic decision matrix is constructed based on the rule consistency identifier and character recognition confidence level. Intelligent triage instructions are generated according to the deviation dimension. For fields whose confidence level meets the benchmark but whose rules conflict, historical verification cases are automatically associated and reference solutions are pushed. For fields whose confidence level does not meet the benchmark, real-time character enhancement recognition is triggered, and a priority list of manual review is generated simultaneously, resulting in a dynamic response of machine autonomous decision-making and human intervention.
[0017] Specifically, the closed-loop processing of passport document verification utilizes a rule management module to verify the entire chain of data and construct a self-evolution mechanism. For manually corrected misidentification cases, feature parameters are extracted to update the character recognition template library. For rule mismatches, the matching weights of fields in the rule library are dynamically adjusted based on the conflict frequency. The decision benchmark is automatically calibrated as the document version iterates and the issuance rules change, resulting in a closed-loop processing of passport document verification data - rule optimization - accuracy improvement.
[0018] The beneficial effects of this invention are as follows: This method acquires passport and document image data through a preset microscopic imaging architecture, and simultaneously extracts structured information using a document reader, constructing a dual-source data system of image and structured information data, breaking through the limitation of traditional verification relying solely on single data. On the one hand, image data can capture microscopic features such as physical tampering traces and edge morphology of characters, while structured information provides benchmark parameters such as the field format and physical size of the machine-readable area. The two complement each other, making the verification basis more complete. On the other hand, in steps such as character positioning and machine-readable area verification, structured information serves as an auxiliary parameter and is linked with image features for verification. For example, during character recognition, structured information is used to correct noise interference parameters, and after matching, double comparison is performed using field length, significantly reducing recognition deviations caused by single data errors and providing accurate data support for subsequent verification steps.
[0019] To address the characteristics of characters in the machine-readable area of passports, contrast grayscale features are extracted through grayscale processing (combined with adaptive histogram equalization to enhance contrast and statistical distribution of contrasting pixels). Multi-dimensional features such as grayscale statistics, edge morphology, and texture are then integrated to construct vectors, replacing traditional single grayscale matching. At the same time, a recognition confidence quantification mechanism is introduced, which dynamically corrects the results by combining parameters such as the physical size and clarity of the document. This effectively solves the recognition errors caused by printing noise and wear, making the reliability of OCR recognition results quantifiable and traceable.
[0020] The system innovatively adopts a multi-level matching strategy with a dual index of nationality and document number. It uses the nationality code as the top-level hash index to lock a subset of rules, and the document number feature fragments as the second-level prefix index to filter candidate rules. Then, it determines the original issuance specifications through multi-dimensional template adaptation and logical tracing verification, avoiding the inefficiency of item-by-item matching in traditional fixed rule bases. At the same time, the issuance specifications are decomposed into a four-dimensional specification gene chain. A candidate rule set is generated through progressive matching of feature code weights. Combined with spatiotemporal-time validity dual-factor weighting and evidence network aggregation, a quantitative rule consistency identifier is generated, replacing the binary judgment of conformity or non-conformity. This accurately reflects the degree of conformity between the document and the specifications and adapts to the differentiated issuance policies of different countries and regions.
[0021] A dynamic decision matrix is constructed based on rule consistency identifiers and character recognition confidence. Differentiated instructions are generated for different deviation dimensions. When the confidence meets the standard but the rules conflict, historical case references are pushed. When the confidence does not meet the standard, character enhancement recognition is triggered and a priority review list is generated. This achieves "flexible adaptation between machine autonomous decision-making and precise human intervention, avoiding the efficiency loss caused by traditional fixed response, and improving the processing efficiency of customs clearance, foreign affairs services and other scenarios while ensuring the accuracy of verification".
[0022] By constructing a full-link data self-evolution mechanism through the rule management module, misidentification cases from manual review are transformed into optimization resources—feature parameters are extracted to update the character recognition template library, and field matching weights are adjusted based on the frequency of rule conflicts, so that the decision benchmark is automatically calibrated as the document version iterates and the issuance rules change; at the same time, the verification data throughout the entire process continuously feeds back into the system to avoid the recurrence of historical misidentification cases, realizing a closed loop of verification data-rule optimization-accuracy improvement, reducing long-term maintenance costs, and ensuring that the system maintains high-accuracy verification capabilities even in scenarios such as forgery technology upgrades and document aging. Attached Figure Description
[0023] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0024] Figure 1 This is a flowchart illustrating the intelligent identification and system optimization method based on passport data and knowledge base of the present invention. Figure 2 This is a structural block diagram of multidimensional rule matching in this invention. Detailed Implementation
[0025] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.
[0026] Please see Figure 1-2 A method for intelligent identification and system optimization based on passport data and knowledge base.
[0027] Obtaining contrast grayscale features from passport image data specifically includes: enhancing local grayscale contrast in the machine-readable region of the passport in the grayscale image using an adaptive histogram equalization algorithm; calculating local grayscale differences in the enhanced grayscale image, statistically analyzing the mean and variance of the differences to obtain a local contrast feature matrix; marking pixels in the local contrast feature matrix that are greater than a threshold as contrast pixels, statistically analyzing the distribution density and connectivity of contrast pixels to obtain contrast grayscale features characterizing the difference between character and background grayscale.
[0028] In this embodiment, the local gray-level difference is calculated by traversing the image using a 3×3 sliding window, and the gray-level difference between the center pixel and its neighboring pixels within the window is calculated. The formula for the local gray-level difference is as follows:
[0029] Where ΔI(x, y) is the "local gray-level difference" calculated at coordinates (x, y). It is a scalar value. I(x, y) is the gray-level value of the center pixel (x, y). I(x+i, y+j) is the gray-level image function. I represents the image, and (x+i, y+j) is the coordinate of a pixel in the image. The value of the function I(x+i, y+j) is the gray-level intensity of that pixel (for example, 0 represents pure black, and 255 represents pure white).
[0030] Calculate the mean μ and variance of all differences. Generate local contrast feature matrix Set the dynamic threshold T = μ + 2σ, and... Pixels with a value greater than T are marked as high-contrast pixels; the percentage of high-contrast pixels in the total number of pixels in the machine-readable region is calculated (e.g., 15%). Connectivity: Through 8-neighborhood connectivity analysis, the clustering degree of high-contrast pixels is statistically analyzed; the contrast grayscale features are output, where:
[0031] This feature is used for subsequent character localization and OCR recognition; high-density and highly connected contrast pixels usually correspond to character edges.
[0032] Specifically, the process of obtaining the character region after direction correction includes: based on the contrast grayscale image corresponding to the contrast grayscale features, removing high-frequency noise in the image through Gaussian filtering to obtain the grayscale gradient features of the character edges; and using adaptive threshold segmentation to enhance the grayscale contrast between the character and the background to obtain the boundary features between the character region and the background region. Based on the boundary features, the Sobel operator is used to calculate the gray-level gradient values of the image in the horizontal and vertical directions to obtain the gradient image of the character edge; based on the gradient image, the character tilt angle is obtained through projection analysis, and the gradient image is rotated along different angles. By comparing the concentration of projection peaks and the uniformity of intervals under different rotation angles, the horizontal rotation angle of the character line is obtained. The original contrast grayscale image is rotated and corrected based on the horizontal rotation angle of the character line. The character region after orientation correction is obtained by comparing the distribution characteristics of the characters in the corrected image with the boundary features obtained in the previous step.
[0033] In this embodiment, the image may have an unknown clockwise or counterclockwise tilt. Gaussian filtering is used to smooth the image, suppressing high-frequency noise and providing clean data for subsequent edge detection. A 5x5 Gaussian convolution kernel is used to convolve the contrast grayscale image. The result is a smooth image where the edges of character regions are preserved, while most of the noise is effectively suppressed.
[0034] The grayscale image is converted into a binary image to clearly separate the character foreground and background. Otsu's method is used to calculate an optimal global threshold T, classifying all pixels in the smoothed image into two categories: grayscale values greater than T are set to white, and those less than or equal to T are set to black. This step yields clear boundary features between the characters and the background. The direction and intensity information of the character edges are accurately extracted. The original contrast grayscale image is convolved using Sobel kernels in both the horizontal and vertical directions. A gradient image is generated, where the brightness value of each pixel represents the edge intensity at that point.
[0035] Tilt angle detection in projection analysis accurately calculates the horizontal tilt angle of the image. Radon transform or projection peak-valley analysis: Generate a candidate angle set: Set an angle range, and for each candidate angle θ, rotate the gradient image around the center by -θ degrees. For the rotated gradient image, calculate the sum of the gradient values of each row of pixels to obtain a one-dimensional horizontal projection curve. When the image is correctly aligned, the projection values of the rows corresponding to the character lines will form sharp and evenly spaced peaks. Calculate the peak concentration and spacing uniformity of this projection curve. Select the candidate angle θ_best that gives the highest peak concentration and the best spacing uniformity, which is the horizontal rotation angle of the character lines. Use the rotation transformation in affine transformation, with the image center as the rotation center, to rotate the original contrast grayscale image by -θ_best degrees. Bilinear interpolation is used during rotation to ensure image quality, resulting in a horizontally oriented corrected grayscale image.
[0036] In the corrected image, the region of each character is precisely outlined. Adaptive thresholding is then performed again on the corrected image to obtain a corrected binary image. Using the previously acquired boundary features and character distribution characteristics, a connected component analysis algorithm is used to mark all connected white regions in the image. By setting constraints such as area and aspect ratio, noise blocks that are clearly not characters are filtered out. The minimum bounding rectangle of each qualified connected region is calculated. The region enclosed by these rectangles is the final orientation-corrected character region.
[0037] Specifically, the machine-readable area of the passport includes extracting core features such as grayscale statistics, edge morphology, texture, geometry and projection for the character regions corresponding to each character bounding box, and constructing a multi-dimensional feature vector representing character attributes; calling the field labels related to the machine-readable area in the structured information extracted by the document reader, using them as auxiliary positioning parameters, and performing association verification with the multi-dimensional feature vector; Based on the constructed standard character template library, the multi-dimensional feature vector of the character to be recognized is matched by the minimum Euclidean distance, and the matching results are filtered by the preset character length value in the structured information to obtain the corresponding OCR character code; By using distance matching to preset a basic confidence level, and combining the physical size parameters of the document recorded in the structured information, the clarity and noise interference parameters of the character area are corrected to obtain a confidence level that reflects the reliability of recognition. The character order is determined by sorting the characters by their horizontal coordinates. Referring to the machine-readable area format specifications in the structured information, vertically aligned continuous bounding box sequences are selected. After pixel fusion and splicing, the sequences are double-compare with the standard specifications of the passport machine-readable area and the length of the machine-readable area field in the structured information to verify the machine-readable character area.
[0038] Specifically, obtaining the image quality coefficient of a passport document includes: using the edge gradient magnitude statistical method to extract the edge contours of characters within the machine-readable region, calculating the mean and standard deviation of the edge gradient magnitudes, and obtaining the character sharpness in the first dimension; By analyzing the grayscale difference between the character and the background, the machine-readable area of the character is divided into a character sub-region and a background sub-region. The average grayscale difference between the two types of sub-regions is calculated to obtain the grayscale contrast in the second dimension. By combining noise density statistics and filter residual analysis, the number of noise points in the machine-readable area of the character is counted. After Gaussian filtering, the grayscale residual of the image before and after filtering is calculated. The two are weighted to obtain the third dimension of noise interference quantification value. The weights of the first, second, and third dimensions are calculated to obtain corresponding values. Based on these values, they are compared with a preset threshold to determine the quality coefficient of the passport image.
[0039] Specifically, the step of obtaining independent fields by matching fields through predefined regular expression patterns includes scanning character by character based on the machine-readable OCR code, using predefined regular expression triples to locate the start and end boundaries of the nationality, certificate number, and issuance date fields, and obtaining the first boundary slice. The sliced fields are compared in parallel with single-field rules and relational database combined field rules. The same logical cycle outputs three levels of quantitative indicators: complete match, partial match and rule conflict. Based on the three-level quantization identifier and the original field value, a structured format frame with a timestamp is encapsulated to obtain an independent field for the authenticity decision.
[0040] In this embodiment, based on the combined field issuance rules including the nationality template, certificate number template, and single-field issuance rules defined by regular expressions, the system scans the machine-readable OCR code character by character. It locates the start and end boundaries of the nationality, certificate number, and issuance date fields using preset regular expression triples and completes the first boundary slicing. Subsequently, the sliced fields are compared in parallel with the single-field rules and the combined field rules of the relational database. Within the same logical cycle, three levels of quantification identifiers—complete match, partial match, and rule conflict—are output. Finally, the three-level quantification identifiers and the original field values are encapsulated into a structured format frame with a timestamp, resulting in an independent field used for authenticity determination. This realizes the core logic in the technical disclosure document of identifying the authenticity of documents by analyzing the interrelationships of issuance information.
[0041] Specifically, the method of separating the machine-readable area fields of passport documents using heuristic rules includes: employing a three-level heuristic instantaneous parsing mechanism, performing a character-by-character sliding scan of the optical character recognition code in the machine-readable area, loading a pre-set field boundary regularity library; when a character fragment is scanned and completely matches the boundary regularity of the field, the field start and end positioning is triggered, and the start index-end index offset pair of the field in the OCR code is output, and the boundary slice of a single field is obtained in a single clock cycle; The independent fields obtained by boundary-heuristic slicing are fed in parallel into a multi-dimensional semantic verifier. The verifier loads exclusive semantic rules for different field types: for document numbers, it calls the private weighting factor algorithm of the corresponding country; for date fields, it performs logical verification that the issuance time is less than or equal to the expiration time; for document type and issuing agency fields, it performs byte-by-byte comparison with the pre-set document type and agency correspondence table; the verification logic is operated synchronously, and the three levels of semantic level of each field are output at the same clock tick to obtain semantic compliance verification. In the trigger array, the boundary-heurized offset is XORed with the validity result and the semantic-heurized verification level to generate a conflict decision result; based on the conflict decision result of the field, a structured data frame with a timestamp is generated to obtain independent and verified machine-readable area fields that are separated from the machine-readable area OCR code, including nationality code, document number, issuance time, validity period, document type, and issuing authority.
[0042] In this embodiment, the rule operation module employs a three-level heuristic instantaneous parsing mechanism: It slides through the machine-readable OCR code character by character, loading a pre-defined field boundary regularity library. This library conforms to the regularity constraints of combined field issuance rules, such as nationality templates and certificate number templates. When a character fragment completely matches the field boundary regularity, it triggers field start-end positioning and outputs a start-end index offset pair. A single clock cycle is used to obtain a boundary slice of a single field. The independent fields obtained from the slices are then fed in parallel into a multi-dimensional semantic verifier. The verifier loads specific semantic rules for different field types, such as calling the corresponding country's private weighted factor algorithm for certificate numbers, performing logical checks on date fields (issuance time ≤ validity expiration time), and comparing certificate types with a pre-defined correspondence table of issuing agency fields. Each field's three semantic levels are output in the same clock cycle. Finally, in the trigger array, an XOR operation is performed on the validity result of the boundary-heuristic offset pair and the semantic-heuristic verification level to generate a conflict decision result. Based on this result, a timestamped structured data frame is generated and transmitted from the machine-readable OCR code. The design goal is to separate the verified nationality code, document number, issuance time, validity period, document type, and issuing authority from the code, and to enhance the document reader's ability to identify counterfeit documents using specific relationships or rules.
[0043] Specifically, the step of performing multi-level rule matching queries in the pre-set issuance rule base to obtain the original issuance specifications that the document information should follow includes anchoring the nationality code separated by the machine-readable region as the top-level hash index through dual index anchoring of nationality and document number, and locating the rule subset of the corresponding country and region in the issuance rule base; Based on the rule subset, the feature fragments in the certificate number are used as secondary prefix indexes. Within the rule subset, certificate number template rules with the same features are matched to obtain a candidate rule pool and obtain the preliminary range of the original issuance specification. The initial scope locking based on the original issuance specifications utilizes multi-dimensional template dynamic adaptation to obtain a secondary fine screening: for each rule in the candidate rule pool, template elements are extracted, and the template elements are matched with the machine-readable area field execution elements and fields dimension by dimension to obtain the target rule set; a third-level determination is achieved through combined logic tracing verification: for the rules in the target rule set, the rule-specification mapping engine is invoked to logically associate the certificate number encoding logic, validity period limit, and issuing agency authority fields in the rule with the pre-set national and regional issuance specification library, and the unique matching official issuance specification is confirmed through multi-field logical association to obtain the original issuance specification that the certificate information should follow.
[0044] Specifically, the generation of the candidate rule set corresponding to the certificate includes: decomposing the original issuance specification into a four-dimensional specification gene chain consisting of nationality code, certificate number encoding logic, certificate type permissions, and validity constraints; the system calls the gene chain index engine to perform multi-dimensional feature code parallel matching in the pre-set rule gene chain library in the issuance rule library; the matching process adopts a feature code weight progression strategy to quantify and score the matching degree between the rule gene chain and the specification gene chain, and aggregates the matched rules into a candidate rule set corresponding to the certificate.
[0045] Specifically, generating a quantified rule consistency identifier includes employing a spatiotemporal-time-effectiveness dual-factor dynamic weighting and evidence network aggregation mechanism. Dynamic weights are calculated using the recent matching frequency, effective duration, and historical conflict rate of a rule. Evidence from the certificate number matching degree, time interval fit degree, and institutional authority matching degree fields of a single rule are logically linked into an evidence chain. The evidence chain of the entire rule set is then fused with confidence through an evidence network model to obtain a quantified rule consistency identifier.
[0046] Specifically, the process involves generating verification decision rules and responding dynamically. A dynamic decision matrix is constructed based on the rule consistency identifier and character recognition confidence level. Intelligent triage instructions are generated according to the deviation dimension. For fields whose confidence level meets the benchmark but whose rules conflict, historical verification cases are automatically associated and reference solutions are pushed. For fields whose confidence level does not meet the benchmark, real-time character enhancement recognition is triggered, and a priority list of manual review is generated simultaneously, resulting in a dynamic response of machine autonomous decision-making and human intervention.
[0047] Specifically, the closed-loop processing of passport document verification utilizes a rule management module to verify the entire chain of data and construct a self-evolution mechanism. For manually corrected misidentification cases, feature parameters are extracted to update the character recognition template library. For rule mismatches, the matching weights of fields in the rule library are dynamically adjusted based on the conflict frequency. The decision benchmark is automatically calibrated as the document version iterates and the issuance rules change, resulting in a closed-loop processing of passport document verification data - rule optimization - accuracy improvement.
[0048] In this embodiment, the rule management module retrieves the full-link data of three misjudgment cases: including machine-readable OCR codes, character recognition confidence scores (all ≥0.85, meeting the benchmark), rule consistency identifiers (all partially matched, with conflicting fields indicating the issuing authority), and manual review records (confirming that the Bangkok Consulate of the Thai Immigration Bureau is a legitimate issuing authority, which was not included in the original rule database).
[0049] Analysis of the reasons for the misjudgment: The issuing authority field of Thai passports in the issuance rule database only includes the Thai Immigration Bureau, Chiang Mai Consulate, and the Bangkok Consulate has not been updated; the BKK character feature corresponding to the institution code of the Bangkok Consulate in the character recognition template database was not entered, which caused the OCR recognition to fail to match the rules.
[0050] Rule base update: Based on the results of manual review, the rule management module automatically adds the combination rule of nationality=THA + certificate number prefix=T + issuing agency=Bangkok Consulate (code BKK) to the issuance rule base and adjusts the matching weight of the rule (due to its recent high frequency of occurrence, the historical conflict rate weight is reduced from 0.3 to 0.1 to improve the matching priority).
[0051] Grayscale statistics and edge morphology features of the BKK characters in three cases were extracted to generate multidimensional feature vectors, which were then added to the standard character template library. Simultaneously, the confidence parameter was adjusted, with the recognition confidence correction coefficient for the BKK field increased from 1.0 to 1.05 to improve recognition stability. According to the new rules, the rule consistency threshold for the Thai passport issuing authority field was changed from a perfect match to a match only requiring a list of legitimate institutions, avoiding misjudgments due to rigid rules. Within one week of the optimization, the border inspection station received 12 Thai ordinary passports (including 2 documents issued by the Bangkok Consulate). The system accurately identified the issuing authority field in all cases, with rule consistency indicators showing a perfect match, and no misjudgments were found.
[0052] The rule management module generates a closed-loop optimization report, recording the reasons for misjudgments, optimization measures, and verification results, thus completing the closed loop of data verification, rule optimization, and accuracy improvement. Subsequent similar cases of newly added issuing institutions can be automatically adapted through this mechanism without the need for repeated manual intervention.
[0053] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. Passport data-knowledge base driven intelligent authentication and system optimization method, characterized in that, include: S1: Preset microscopic imaging architecture to acquire passport and document image data, extract structured information of passport and document through document reader, and obtain dual-source data of image data and structured information; S2: Based on the passport image data, the contrast grayscale features of the passport image data are obtained through grayscale processing. Specifically, obtaining the contrast grayscale features of the passport image data includes: enhancing the local grayscale contrast of the machine-readable area of the passport in the grayscale image using an adaptive histogram equalization algorithm; calculating the local grayscale difference of the enhanced grayscale image, and statistically analyzing the mean and variance of the difference to obtain a local contrast feature matrix; marking pixels in the local contrast feature matrix that are greater than a threshold as contrast pixels, and statistically analyzing the distribution density and connectivity of the contrast pixels to obtain the contrast grayscale features representing the difference between the grayscale of the characters and the background. Character localization is performed on image data using structured information data labels to obtain orientation-corrected character regions. Obtaining orientation-corrected character regions includes extracting corresponding features based on character bounding boxes and constructing multi-dimensional feature vectors representing character attributes. The field labels related to the machine-readable area in the structured information extracted by the document reader are called and used as auxiliary positioning parameters to perform correlation verification with the multidimensional feature vector; Based on the constructed standard character template library, the multi-dimensional feature vector of the character to be recognized is matched by the minimum Euclidean distance, and the matching results are filtered by the preset character length value in the structured information to obtain the corresponding OCR character code; By using distance matching to preset a basic confidence level, and combining the physical size parameters of the document recorded in the structured information, the clarity and noise interference parameters of the character area are corrected to obtain a confidence level that reflects the reliability of recognition. The character order is determined by sorting the horizontal coordinates of the character bounding boxes. Referring to the machine-readable area format specifications in the structured information, vertically aligned continuous bounding box sequences are selected. After pixel fusion and splicing, the sequences are double-compared with the standard specifications of the passport machine-readable area and the length of the machine-readable area field in the structured information to verify the character machine-readable area. Based on the feature parameters of the character region, a matching analysis is performed with a standard character template library to generate an optical character recognition code and the corresponding recognition confidence level. The image quality coefficient of a passport document is obtained by using the edge gradient magnitude statistical method to extract the edge contour of characters within the machine-readable region, calculating the mean and standard deviation of the edge gradient magnitude, and obtaining the character sharpness in the first dimension. By analyzing the grayscale difference between the character and the background, the machine-readable area of the character is divided into a character sub-region and a background sub-region. The average grayscale difference between the two types of sub-regions is calculated to obtain the grayscale contrast in the second dimension. By combining noise density statistics and filter residual analysis, the number of noise points in the machine-readable area of the character is counted. After Gaussian filtering, the grayscale residual of the image before and after filtering is calculated. The two are weighted to obtain the third dimension of noise interference quantification value. The weights of the first, second, and third dimensions are calculated to obtain corresponding values. Based on these values, they are compared with a preset threshold to determine the quality coefficient of the passport image. S3: Based on optical character recognition codes, independent fields are obtained by matching fields using predefined regular expression patterns; machine-readable area fields of passport documents are separated using heuristic rules, and the nationality code and document number of the machine-readable area fields are used as search conditions to perform multi-level rule matching queries in a pre-set issuance rule base to obtain the original issuance specifications that the document information should follow; based on the original issuance specifications, a candidate rule set corresponding to the document is generated using a specification gene chain matching strategy, and a weighted credibility matching is performed on the candidate rule set to generate a quantified rule consistency identifier; S4: Based on the rule consistency identifier and character recognition confidence level, generate verification decision rule instructions and make dynamic responses; update the issuance rule base through the rule management module, adjust the character recognition template base and confidence level correction parameters, and obtain the closed-loop processing of passport document verification.
2. The method of claim 1, wherein, The step of obtaining independent fields by matching fields through predefined regular expression patterns includes scanning character by character based on the machine-readable OCR code and using predefined regular expression triples to locate the start and end boundaries of the nationality, certificate number, and issuance date fields to obtain the first boundary slice. The sliced fields are compared in parallel with single-field rules and relational database combined field rules. The same logical cycle outputs three levels of quantitative indicators: complete match, partial match and rule conflict. Based on the three-level quantization identifier and the original field value, a structured format frame with a timestamp is encapsulated to obtain an independent field for the authenticity decision.
3. The method of claim 1, wherein, The step of performing multi-level rule matching queries in the pre-set issuance rule base to obtain the original issuance specifications that the document information should follow includes anchoring by nationality and document number dual indexes, using the nationality code separated by the machine-readable identifier as the top-level hash index to locate the rule subset of the corresponding country and region in the issuance rule base; Based on the rule subset, the feature fragments in the certificate number are used as secondary prefix indexes. Within the rule subset, certificate number template rules with the same features are matched to obtain a candidate rule pool and obtain the preliminary range of the original issuance specification. The initial scope locking based on the original issuance specifications utilizes multi-dimensional template dynamic adaptation to obtain a secondary fine screening: for each rule in the candidate rule pool, template elements are extracted, and the template elements are matched with the machine-readable area field execution elements and fields dimension by dimension to obtain the target rule set; a third-level determination is achieved through combined logic tracing verification: for the rules in the target rule set, the rule-specification mapping engine is invoked to logically associate the certificate number encoding logic, validity period limit, and issuing agency authority fields in the rule with the pre-set national and regional issuance specification library, and the unique matching official issuance specification is confirmed through multi-field logical association to obtain the original issuance specification that the certificate information should follow.
4. The method of claim 1, wherein, The generated candidate rule set for the certificate includes: decomposing the original issuance specification into a four-dimensional specification gene chain consisting of nationality code, certificate number encoding logic, certificate type permissions, and validity constraints; the system calls the gene chain index engine to perform multi-dimensional feature code parallel matching in the pre-set rule gene chain library in the issuance rule library; the matching process adopts a feature code weight progression strategy to quantify and score the matching degree between the rule gene chain and the specification gene chain, and aggregates the matched rules into a candidate rule set corresponding to the certificate.
5. The method of claim 1, wherein, The generation of a quantified rule consistency identifier includes, A dynamic weighting mechanism combining spatiotemporal and time-effect factors and an evidence network aggregation mechanism is adopted. Dynamic weights are calculated using the recent matching frequency, effective duration, and historical conflict rate of rules. Evidence in the fields of certificate number matching degree, time interval fit, and institutional authority matching degree of a single rule is logically linked into an evidence chain. The evidence chain of the entire rule set is fused with confidence through an evidence network model to obtain a quantitative rule consistency identifier.
6. The method of claim 1, wherein, The process involves generating verification decision rules and making dynamic responses. A dynamic decision matrix is constructed based on the rule consistency identifier and character recognition confidence level. Intelligent triage instructions are generated according to the deviation dimension. For fields whose confidence level meets the benchmark but whose rules conflict, historical verification cases are automatically associated and reference solutions are pushed. For fields whose confidence level does not meet the benchmark, real-time character enhancement recognition is triggered, and a priority list of manual review is generated simultaneously, resulting in a dynamic response of machine autonomous decision-making and human intervention.
7. The method of claim 1, wherein, The closed-loop processing of passport document verification utilizes a rule management module to verify data across the entire chain and construct a self-evolution mechanism. For manually corrected misidentification cases, feature parameters are extracted to update the character recognition template library. For rule mismatches, the matching weights of fields in the rule library are dynamically adjusted based on the conflict frequency. The decision benchmark is automatically calibrated as the document version iterates and the issuance rules change, resulting in a closed-loop processing of passport document verification data, rule optimization, and accuracy improvement.