Document image homologous identification method based on symbol space context matching
By using the symbol space context matching method, the problem of identifying documents and images with highly similar content but different sources in the existing technology is solved. It achieves efficient and accurate same-origin identification, which is suitable for industrial and consumer applications and meets the requirements of local tampering and computational efficiency.
Patent Information
- Application Number
- CN202511553126.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies struggle to efficiently and accurately identify the common origin of two-dimensional document images with highly similar content but different sources. They are particularly inaccurate when faced with local tampering and have high computational complexity, making them unsuitable for the computational efficiency requirements of industrial and consumer applications.
By constructing a symbol space context matching method, symbol detection and noise filtering are performed on document images to extract a clean symbol set. Descriptors are constructed based on the spatial relationship features between symbols. Affine transformation model is used for matching verification, and confidence scores are calculated to determine whether the images are from the same or different sources.
It achieves accurate identification of partially tampered documents, reduces computational complexity, adapts to batch processing needs, possesses semantic independence and robustness, is suitable for same-origin identification of massive documents, makes up for the application limitations of proactive defense technologies, and has a wide range of applications.
Smart Images

Figure CN121330709A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and digital information security technology, specifically relating to a method for document image homology identification based on symbol space context matching. Background Technology
[0002] In the wave of digital transformation, converting physical documents (such as handwritten contracts, printed reports, and design drawings) or native digital documents into digital images for storage, transmission, and verification through methods such as photography and scanning has become a standard procedure across various industries. However, the ease of editing mainstream image formats (such as JPEG and PNG) has brought serious issues regarding the authenticity and integrity of information sources. Malicious actors may partially tamper with critical document images (such as replacing signatures, changing amounts, or erasing key information) and attempt to replace the original image with the altered copy, thereby committing fraud, evading responsibility, or obtaining illegal profits.
[0003] Existing technologies offer several image integrity verification and matching schemes, but they suffer from a fundamental technological mismatch when addressing the core requirement of "same-origin authentication":
[0004] 1. Image matching methods based on low-level feature points (such as SIFT, SURF, ORB):
[0005] These methods aim to handle image matching of the same 3D object under different viewpoints and lighting conditions. However, when applied to 2D document images, feature points are densely and uniformly distributed across all text, lines, and other elements. For two images with highly overlapping content and differences only in minor local areas (e.g., the original of the same contract and a copy with only the signing date altered), these methods generate a massive number of indistinguishable feature matching points, failing to effectively filter out stable features that identify "homogeneity," and are overly sensitive to image cropping, scaling, and non-linear deformation. Furthermore, their computational complexity remains too high for backend systems that need to process massive amounts of documents in batches.
[0006] 2. Semantic content similarity comparison based on deep learning:
[0007] Models based on convolutional neural networks or Transformers can effectively understand the semantic content of images. However, their design goal is to determine "whether the content is similar," rather than "whether the entities are the same." In many key scenarios, multiple documents may be highly similar or even completely identical semantically (e.g., multiple copies of a standard contract, identical answers submitted by multiple students, multiple design drawings of the same product), but it is necessary to strictly distinguish whether they belong to different physical or digital entities. Semantic models will arrive at conclusions completely contrary to the objective in this case, and their huge computational overhead makes them difficult to deploy in practical systems.
[0008] 3. Proactive defense technologies: Digital watermarking and digital signatures:
[0009] This type of technology, by actively embedding authentication information when generating digital files, is an effective means of preventing counterfeiting. However, its application relies on the ability to control the beginning of the file's lifecycle. When digitizing massive amounts of existing physical documents (such as signed paper contracts and handwritten manuscripts), or for historical digital documents that were not watermarked during creation, this technology is completely ineffective and cannot provide the ability to trace back and authenticate afterward.
[0010] Therefore, there is a significant gap in the existing technological system: the lack of a passive authentication technology capable of efficiently and accurately identifying "same origin" between two-dimensional document images with highly similar content but different source entities. This technology should possess semantic independence, meaning it does not rely on content understanding; it should have local robustness, enabling it to make correct judgments even when partial tampering is allowed; and it should meet the stringent computational efficiency requirements of industrial and consumer applications. Summary of the Invention
[0011] To address the shortcomings and deficiencies of existing technologies, this invention provides a document image homology identification method based on symbolic space context matching. This method achieves homology determination through semantically independent symbolic space layout analysis, with the core being the construction of a novel spatial context descriptor and robust matching verification. First, symbol detection and noise filtering are performed on two document images to be identified, extracting a clean set of symbols containing geometric attributes. Then, for each symbol, its neighborhood is dynamically defined based on its size, and various spatial relationship features between the symbol and other symbols within the neighborhood are calculated, including relative directions that distinguish quadrants, highly normalized distances, and morphological features, thereby constructing a descriptor representing the local spatial context. Subsequently, initial matching pairs are formed by calculating the similarity between descriptors, and spatial consistency verification is performed using random sampling and an affine transformation model. An inlier set is selected, and the optimal transformation model is refitted. Finally, a confidence score is calculated based on the weighted difference between the proportion of inlier numbers and the model transformation error, and this score is compared with a preset threshold to determine whether the images are homologous. This invention innovatively abstracts documents into a set of symbolic spatial relationships for matching, effectively overcoming the interference of local tampering and improving the accuracy and reliability of the identification results.
[0012] The specific technical solution adopted by this invention to solve its technical problem is as follows:
[0013] A document-image homology identification method based on symbolic space context matching includes:
[0014] Symbol detection and noise filtering are performed on the first document image and the second document image respectively to obtain a clean symbol set; each symbol in the clean symbol set contains center point coordinates and height information;
[0015] For each symbol, the neighborhood search range is dynamically defined based on height, and at least two spatial relationship features between other symbols in the neighborhood and the symbol are calculated. The spatial context descriptor of the symbol is formed by all spatial relationship features.
[0016] An initial matching set is obtained by matching the spatial context descriptors of two images. The inlier points in the initial matching set are then filtered by an affine transformation model. Finally, the affine transformation model is obtained by refitting the inlier points.
[0017] A confidence score is calculated based on the final affine transformation model. If the confidence score is not lower than a preset threshold, the first document image and the second document image are determined to be from the same source; otherwise, they are determined to be from different sources. The confidence score is obtained by weighted combination of the inlier rate and the inlier average error. The inlier rate is the ratio of the number of inliers to the smaller value of the number of symbols in the symbol sets of the two images. The inlier average error is the average distance between the predicted position and the actual position of all inliers based on the final affine transformation model.
[0018] Furthermore, the symbol detection and noise filtering performed on the first and second document images respectively specifically include: performing preprocessing, binarization, connected component analysis, and noise filtering on the document images sequentially.
[0019] The preprocessing involves converting the document image into a grayscale image and suppressing noise using a Gaussian filter.
[0020] The binarization process employs an adaptive thresholding method, with the block size selected based on the document image resolution using a preset size. After processing, the foreground pixel region is extracted as a candidate symbol.
[0021] The connectivity component analysis employs a depth-first search method based on depth optimization to determine the boundaries of candidate symbols and obtain their center point coordinates and height information.
[0022] The noise filtering is achieved by removing candidate symbols whose pixel area is smaller than a preset area threshold and whose aspect ratio exceeds a preset range. The preset area threshold is set based on the total area ratio of the image or the absolute pixel value.
[0023] Furthermore, the radius of the neighborhood search range is determined based on the product of the height of the current symbol and a preset scale factor.
[0024] Furthermore, the spatial relationship features are selected from at least two of the following: the relative orientation of neighboring symbols that can distinguish quadrants, the distance of neighboring symbols normalized by the current symbol height, and the aspect ratio of the neighboring symbols.
[0025] Furthermore, the specific process of matching based on the spatial context descriptors of the two images to obtain an initial matching set, and filtering the interior points in the initial matching set using an affine transformation model, includes:
[0026] The similarity between two image descriptors is calculated using cosine similarity, dot product, or Manhattan distance. Descriptor pairs with similarity higher than a preset matching threshold are retained. If the same descriptor corresponds to multiple matching results, only the descriptor pair with the highest similarity is retained to form an initial matching set. A preset number of matching pairs are randomly selected from the initial matching set to solve the affine transformation model. The preset number is the minimum number required to satisfy the solution of the affine transformation model. The positional deviation of the remaining matching pairs under the model is calculated. Points with deviations less than a preset pixel threshold are considered inliers. The above process is repeated until the upper limit of the preset number of iterations is reached. The model with the most inliers is selected as the optimal model.
[0027] Furthermore, the refitting of the final affine transformation model using interior points specifically involves constructing an overdetermined system of equations for the interior points of the optimal model using the least squares method, and solving for the affine transformation parameters to obtain the final model.
[0028] Furthermore, the confidence score is calculated by the difference between the in-point rate and the weighted average in-point error, where the weighted average in-point error is the product of a preset adjustment coefficient and the average in-point error.
[0029] Furthermore, each symbol in the pure symbol set also contains width information, which, together with the height information, is used to calculate the aspect ratio of neighboring symbols.
[0030] Furthermore, a document-image homology identification system based on symbolic space context matching includes:
[0031] The symbol extraction module is used to perform symbol detection and noise filtering on the first document image and the second document image respectively to obtain a clean symbol set; each symbol in the clean symbol set contains center point coordinates and height information.
[0032] The descriptor building module is used to dynamically define the neighborhood search range for each symbol based on the height of the symbol, calculate at least two spatial relationship features between the symbol and other symbols in the neighborhood, and form the spatial context descriptor of the symbol from all spatial relationship features;
[0033] The matching and verification module is used to match the spatial context descriptors of two images to obtain an initial matching set, filter the inliers in the initial matching set through an affine transformation model, and refit the inliers to obtain the final affine transformation model.
[0034] The decision module is used to calculate a confidence score based on the final affine transformation model. If the confidence score is not lower than a preset threshold, the first document image and the second document image are determined to be from the same source; otherwise, they are determined to be from different sources. The confidence score is obtained by weighted combination of the inlier rate and the average inlier error. The inlier rate is the ratio of the number of inliers to the smaller value of the number of symbols in the symbol sets of the two images. The average inlier error is the average distance between the predicted position and the actual position of all inliers based on the final affine transformation model.
[0035] And a computer device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described above.
[0036] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0037] Compared with the prior art, the present invention and its preferred embodiments have at least the following beneficial effects:
[0038] This invention effectively addresses the limitations of traditional low-level feature point matching methods (such as SIFT, SURF, and ORB) in document image homology identification. Existing methods suffer from dense and indiscriminate feature points, making it difficult to identify stable features that indicate "homology." They are also sensitive to deformations such as cropping and scaling, and their computational complexity is unsuitable for batch processing. In contrast, this invention uses symbols (such as characters and tags) in document images as basic units. It obtains a clean symbol set through noise filtering, constructs descriptors based on the spatial relationships between symbols, and uses an affine transformation model to filter interior points and verify spatial consistency. This approach can accurately distinguish documents with highly similar content but local differences (such as minor alterations), while reducing computational complexity and making it more suitable for batch processing scenarios involving massive amounts of documents.
[0039] This invention avoids the core functional misalignment problem of semantic content similarity comparison models based on deep learning. Existing semantic models can only determine whether "content is similar" and cannot distinguish between "semantically similar entities but from different sources" (such as multiple copies of a standard contract or different assignments with the same answer). The spatial context descriptor constructed in this invention is semantically independent, does not rely on the understanding of document content, and achieves identification solely through spatial relationship features such as the relative direction and normalized distance between symbols. It can accurately distinguish between "content similarity" and "entity identity," avoiding misjudgments caused by semantic judgment bias.
[0040] This invention overcomes the limitations of proactive defense technologies (such as digital watermarking and digital signatures). Existing proactive defense technologies require embedding authentication information during document creation, making it impossible to trace the origin of existing physical documents (such as signed paper contracts and handwritten manuscripts) after digitization, or to trace historical digital documents without embedded watermarks. As a passive authentication technology, this invention does not rely on additional information embedded at the beginning of the document lifecycle and can directly identify various types of generated document images, making it more widely applicable, especially meeting the data authenticity authentication needs of historical documents and digitized physical documents.
[0041] This invention improves the robustness and reliability of homology identification. It ensures the purity of symbol extraction through adaptive threshold binarization (adapting to different resolutions), depth-optimized connected component analysis, and multi-dimensional noise filtering. The neighborhood search range is dynamically defined by symbol height, allowing descriptors to adapt to the spatial relationships of symbols of different sizes. A comprehensive decision is made by combining confidence scores with inlier rate and inlier average error, avoiding misjudgments caused by a single indicator. Overall, it exhibits good adaptability to uneven illumination, local tampering, and slight deformation, and can stably output accurate homology identification results.
[0042] It possesses clear practical value and scenario adaptability. This invention can be directly applied to fields such as judicial document authenticity authentication, financial contract signing anti-counterfeiting, educational assignment authenticity verification, and digital archive management, without relying on additional special equipment or preprocessing procedures. It can effectively meet the authentication needs of various industries for the authenticity and integrity of document image sources, and provide technical support for the application of trusted document credentials. Attached Figure Description
[0043] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0044] Figure 1 This is an overall flowchart of the method in an embodiment of the present invention;
[0045] Figure 2 This is a flowchart of the spatial consistency verification process in an embodiment of the present invention. Detailed Implementation
[0046] To make the features and advantages of the present invention more apparent and understandable, specific embodiments are described below in detail:
[0047] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0048] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0049] The ease of editing digital document images presents challenges to their use as reliable credentials. To address the issue of image source authentication for documents with highly similar content, this invention proposes a novel, semantically independent method for identifying common origins. Document images are treated as a set of spatial layouts of symbols (such as characters and tags). By extracting the local spatial context descriptor of each symbol and performing robust matching and geometric verification, it is possible to determine whether two images originate from the same physical or digital entity.
[0050] This invention is specifically a digital image authentication method based on fine-grained element spatial context matching, used to identify whether two or more digital images originate from the same physical or digital source document entity. It can be widely applied in scenarios such as digital archive management, verification of the integrity of judicial evidence chains, anti-counterfeiting of business contract signing, verification of the authenticity of educational assignments, and intellectual property protection.
[0051] This method is robust to local tampering (such as erasure or modification) and is computationally efficient. Experiments on simulated datasets show that this method outperforms traditional feature matching methods in both accuracy and recall, and can effectively serve the document authenticity authentication needs in fields such as law, finance, and education.
[0052] The following, in conjunction with the accompanying drawings, further illustrates and describes the construction and implementation process of the present invention through a specific embodiment:
[0053] The overall process of this method is as follows: Figure 1 As shown, it mainly includes three core modules: symbol region detection, spatial context descriptor construction, cross-image matching, and spatial consistency verification.
[0054] 1. Symbol Region Detection and Extraction
[0055] This stage aims to decompose the document image into independent symbolic units. The steps are as follows:
[0056] 1) Preprocessing: The input image is first converted to grayscale and then subjected to noise suppression using a Gaussian filter.
[0057] 2) Binarization and Connected Component Analysis: Otsu's adaptive thresholding method is used for binarization to overcome uneven illumination. Subsequently, a connected component analysis algorithm is employed to extract all connected foreground pixel regions, with each region considered as a candidate symbol. .
[0058] Considering that the application field of this invention is documents, the Otsu method uses block sizes of 32×32, 64×64, or 128×128 for different resolutions. When the image edges are insufficient for the specified block size, zeros are used to pad to the specified size.
[0059] The connected component analysis algorithm employs a depth-based optimization approach. Its steps include:
[0060] (1) Initialization: Create a marker array to record whether each pixel has been visited.
[0061] (2) Traverse the image: Starting from the top left corner of the image, traverse the image pixel by pixel.
[0062] (3) Depth-first search: If the current pixel is a foreground pixel and has not been visited, then a depth-first search is performed starting from that pixel. During the search, all connected foreground pixels are marked as visited and grouped into the same connected component.
[0063] (4) Repeat step 3 until all pixels have been visited.
[0064] 3) Noise filtering: Filter candidate symbols based on geometric features.
[0065] The goal of noise filtering is to eliminate components that are highly unlikely to be valid text or symbols from all foreground regions obtained from connected component analysis, leaving candidate regions that are as clean as possible. This noise typically originates from spots, wrinkles, or stains on the paper itself, shadows or moiré patterns generated during photography, sensor noise, or irrelevant patterns, lines, or binding holes in the background.
[0066] In this invention, an area-based filtering method is used, ensuring that the pixel area of effective text or symbols, no matter how small (such as the punctuation mark "."), is above a reasonable lower limit. In contrast, noise generated by image sensors and minute imperfections on the paper during scanning typically consist of only a few or tens of pixels, with a very small area.
[0067] Calculate the total number of pixels contained in each connected component. Set a minimum area threshold T_area (e.g., 0.01% of the total image area, or an absolute pixel value such as 15 pixels). All components with an area smaller than this threshold will be considered noise and filtered out.
[0068] Here are two examples of rules for setting thresholds:
[0069] (1)
[0070] (2)
[0071] After filtering, a pure set of symbols is obtained:
[0072]
[0073] For images A and B, the resulting symbol sets are named respectively. , , It contains information such as the center coordinates, length, and width of the symbol.
[0074] 2. Spatial Context Descriptor Construction
[0075] for Each symbol in Construct a feature descriptor that describes its local spatial layout.
[0076] The descriptor of a symbol is essentially "its perception of the surrounding world." This perception is formed by recording its "relationship" with each of its neighbors.
[0077] 1) Neighborhood definition: based on center point ( , With ) as the center, and Define the neighborhood search range for the radius, where height, This is the scale factor (usually set to 3-5).
[0078] 2) Relationship feature extraction: For each other symbol falling within this neighborhood... Calculate a relation feature vector The relevant indicators include:
[0079] Relative direction: , where atan2 is the arctangent function in the fourth quadrant.
[0080] Normalized distance: (Achieving scale invariance)
[0081] Morphological characteristics: (Aspect ratio of the neighboring symbol)
[0082] 3) Descriptor formation: symbols final descriptor It is the set of all its neighborhood relation vectors:
[0083]
[0084] Here is an example:
[0085] First of all, with center point ( , With ) as the center, and Define the neighborhood search range for the radius and find All Neighbor Sets .
[0086] right Each element in Perform a traversal to obtain the vector. .in . These represent the vector's angle, distance, and aspect ratio, respectively. The vector... Add to collection middle.
[0087] After iterating through each element, we can obtain descriptor .
[0088] For two images A and B, descriptor sets can be constructed respectively. , .
[0089] 3 Robust Matching and Validation
[0090] This stage aims to establish the correspondence between the symbols in the two images and verify their spatial consistency. The method first matches the descriptors of the two images, then performs a spatial consistency check, and finally makes a decision on whether the two documents are from the same source.
[0091] 1) Descriptor matching: For image A, the descriptor set... Each descriptor in In image B Each descriptor Find the nearest neighbor. This embodiment uses a set matching similarity metric to calculate the number of matching neighborhood symbol pairs between two descriptors. Symbols with similarity above a threshold are retained. The matching pairs form the initial matching set. The process can be described in pseudocode as follows:
[0092] Set similarity threshold
[0093] List = []
[0094] Foreach in :
[0095] Foreach in :
[0096] Using cosine similarity to calculate and The similarity r can also be calculated using methods such as dot product and Manhattan distance.
[0097] If r is less than If so, skip the current iteration of the loop.
[0098] If it does not exist in the List The corresponding matching pair will have the triple < , Add to List
[0099] otherwise:
[0100] Retrieve from List The corresponding matching pair < ,
[0101] if Then retain < , Otherwise use < , Replace < in the List. , .
[0102] Returns a List.
[0103] 2) Spatial consistency verification.
[0104] Following the initial symbol matching, the spatial consistency test aims to verify whether these matching relationships are reasonable in the overall spatial layout. Its task is to distinguish between "correct matches (interior points)" and "incorrect matches (exterior points)" and ultimately provide a reliable confidence score. The process is as follows: Figure 2 As shown:
[0105] Input: The initial set of matching pairs is the List in the descriptor matching, and the center coordinates of the symbols corresponding to the descriptors.
[0106] Step 1: Random Sampling
[0107] Randomly select 3 matching pairs from the List. Obtain the coordinates of 3 points. Its matching point coordinates Thus, the affine transformation matrix Matrix is obtained. (Solving the affine transformation matrix is basic image processing knowledge and is not part of the design focus of this invention, so it will not be elaborated upon.)
[0108] Step 2: Calculate the interior points that conform to the model
[0109] Transform all the symbol points of image A in set C using the transformation model Matrix calculated earlier to obtain the predicted positions of the points in image B.
[0110] For each pair of matches, calculate the Euclidean distance between the actual position of the symbol in image B and the model-predicted position.
[0111] If the distance is less than a preset threshold (e.g., 2-5 pixels), the matching pair is considered an interior point in the current model Matrix; otherwise, it is an exterior point.
[0112] Record the total number of interior points that conform to the Matrix model, and save these interior points.
[0113] The set of interior points in the i-th iteration is named .
[0114] Step 3: Select the best model with the most interior points
[0115] from Find the record item with the most interior points and obtain its transformation model Matrix.
[0116] Step 4: Refit the model using all interior points
[0117] Since the number of interior points in an item far exceeds the number of points in the calculated model matrix, we are facing an overdetermined system of equations (the number of equations exceeds the number of unknowns). In this case, no solution satisfies all the equations, and the goal of the least squares method is to find a solution that minimizes the sum of squared errors of all equations (i.e., all interior points).
[0118] In this invention, each internal point in an item contains two matching points from images A and B:
[0119]
[0120] The formula for affine transformation is:
[0121]
[0122] Then a, b, c, d, e, and f can be calculated using the following formula:
[0123] ,
[0124] A new model is obtained:
[0125] T_final= .
[0126] 3. Homologous decision: The final confidence score S is determined by both the inlier rate and the model error.
[0127] We cannot draw conclusions based on just one indicator (such as a large number of inliers), but should take into account both the "quantity of matches" and the "quality of matches".
[0128] Interior ratio:
[0129]
[0130] in This indicates the size of the interior point set, i.e., how many symbols are matched.
[0131] The smaller value represents the number of symbols in the two images.
[0132] average error :
[0133] For each pair of interior points Using the calculated final transformation matrix T_final, Transform the center point of image B into its coordinate system to obtain the predicted point P_pred. Then calculate the relationship between P_pred and the coordinate system of image B. The Euclidean distance between the actual center points P_actual and the interior point is the error of that interior point. The average error of all interior points is denoted as . .
[0134] The final confidence score S is defined as follows:
[0135]
[0136] in This is a pre-set adjustment coefficient. An additional threshold is set. ,like If the two images are from the same source, they are determined to be from different sources; otherwise, they are determined to be from different sources.
[0137] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.
[0138] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0139] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0140] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications 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 protection scope of the present invention.
[0141] This invention is not limited to the preferred embodiment described above. Anyone inspired by this invention can derive other forms of document image homology identification methods based on symbol space context matching. All equivalent variations and modifications made within the scope of the claims of this invention shall fall within the scope of this invention.
Claims
1. A document-image homology identification method based on symbolic space context matching, characterized in that, include: Symbol detection and noise filtering are performed on the first and second document images respectively to obtain a clean symbol set; Each symbol in the pure symbol set contains center point coordinates and height information; For each symbol, the neighborhood search range is dynamically defined based on height, and at least two spatial relationship features between other symbols in the neighborhood and the symbol are calculated. The spatial context descriptor of the symbol is formed by all spatial relationship features. An initial matching set is obtained by matching the spatial context descriptors of two images. The inlier points in the initial matching set are then filtered by an affine transformation model. Finally, the affine transformation model is obtained by refitting the inlier points. The confidence score is calculated based on the final affine transformation model. If the confidence score is not lower than a preset threshold, the first document image and the second document image are determined to be from the same source; otherwise, they are determined to be from different sources. The confidence score is obtained by weighted combination of the inlier rate and the inlier average error. The inlier rate is the ratio of the number of inliers to the smaller value of the number of symbols in the symbol sets of the two images. The inlier average error is the average distance between the predicted position and the actual position of all inliers based on the final affine transformation model.
2. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The symbol detection and noise filtering performed on the first and second document images respectively include: performing preprocessing, binarization, connected component analysis, and noise filtering on the document images sequentially. The preprocessing involves converting the document image into a grayscale image and suppressing noise using a Gaussian filter. The binarization process employs an adaptive thresholding method, with the block size selected based on the document image resolution using a preset size. After processing, the foreground pixel region is extracted as a candidate symbol. The connectivity component analysis employs a depth-first search method based on depth optimization to determine the boundaries of candidate symbols and obtain their center point coordinates and height information. The noise filtering is achieved by removing candidate symbols whose pixel area is smaller than a preset area threshold and whose aspect ratio exceeds a preset range. The preset area threshold is set based on the total area ratio of the image or the absolute pixel value.
3. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The radius of the neighborhood search range is determined based on the product of the height of the current symbol and a preset scale factor.
4. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The spatial relationship features are selected from at least two of the following: the relative orientation of neighboring symbols that can distinguish quadrants, the distance between neighboring symbols normalized by the current symbol height, and the aspect ratio of the neighboring symbols.
5. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The specific process of matching spatial context descriptors of two images to obtain an initial matching set, and then filtering interior points in the initial matching set using an affine transformation model, includes: The similarity between two image descriptors is calculated using cosine similarity, dot product, or Manhattan distance. Descriptor pairs with similarity higher than a preset matching threshold are retained. If the same descriptor corresponds to multiple matching results, only the descriptor pair with the highest similarity is retained to form an initial matching set. A preset number of matching pairs are randomly selected from the initial matching set to solve the affine transformation model. The preset number is the minimum number required to satisfy the solution of the affine transformation model. The positional deviation of the remaining matching pairs under the model is calculated. Points with deviations less than a preset pixel threshold are considered inliers. The above process is repeated until the upper limit of the preset number of iterations is reached. The model with the most inliers is selected as the optimal model.
6. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The specific method of refitting the final affine transformation model using interior points involves constructing an overdetermined system of equations for the interior points of the optimal model using the least squares method, and solving for the affine transformation parameters to obtain the final model.
7. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: The confidence score is calculated by the difference between the in-point rate and the weighted average in-point error, where the weighted average in-point error is the product of a preset adjustment coefficient and the average in-point error.
8. The document image homology identification method based on symbol space context matching according to claim 1, characterized in that: Each symbol in the pure symbol set also contains width information, which, together with the height information, is used to calculate the aspect ratio of neighboring symbols.
9. A document image homology identification system based on symbolic space context matching, characterized in that, include: The symbol extraction module is used to perform symbol detection and noise filtering on the first document image and the second document image respectively to obtain a clean symbol set; each symbol in the clean symbol set contains center point coordinates and height information. The descriptor building module is used to dynamically define the neighborhood search range for each symbol based on the height of the symbol, calculate at least two spatial relationship features between the symbol and other symbols in the neighborhood, and form the spatial context descriptor of the symbol from all spatial relationship features; The matching and verification module is used to match the spatial context descriptors of two images to obtain an initial matching set, filter the inliers in the initial matching set through an affine transformation model, and refit the inliers to obtain the final affine transformation model. The decision module is used to calculate a confidence score based on the final affine transformation model. If the confidence score is not lower than a preset threshold, the first document image and the second document image are determined to be from the same source; otherwise, they are determined to be from different sources. The confidence score is obtained by weighted combination of the inlier rate and the average inlier error. The inlier rate is the ratio of the number of inliers to the smaller value of the number of symbols in the symbol sets of the two images. The average inlier error is the average distance between the predicted position and the actual position of all inliers based on the final affine transformation model.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-8.