Method for judging documents based on vectorizing position features of visual structure algorithm
By extracting the regional content and positional features of the document title page using a visual structure algorithm, constructing a topological relationship vector, and training a document structure feature extraction model, the problem of rapid document classification is solved, and efficient and accurate document recognition is achieved.
Patent Information
- Application Number
- CN202610803755.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-07-03
AI Technical Summary
There are many types of documents in police work, making them difficult to categorize quickly.
The document classification process involves extracting the regional content and location features of the document title page using a visual structure algorithm, constructing a topological relationship vector, training a document structure feature extraction model, and then classifying the document.
It improves the speed and accuracy of document recognition, bypassing content differences and focusing on structural stability.
Smart Images

Figure CN122332567A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of document archiving technology, specifically a method for determining document category based on extracting title position features from visual structure vectors. Background Technology
[0002] Official documents refer to formatted text documents, generally written materials with specific formats created and used by government agencies, enterprises, institutions, organizations, and individuals for a specific purpose in social activities. They have strong standardization, emphasize the presentation of text, and require editing and typesetting of characters, paragraphs, and page formats. They may also contain elements such as graphics, tables, and images. Examples include reports, letters, notices, meeting minutes, and telegrams. Currently, there are many types of documents in public security work, including case registration forms, arrest warrants, detention warrants, summonses, etc. When there are many documents, it is difficult to quickly classify them into categories. Summary of the Invention
[0003] The purpose of this invention is to provide a method for judging documents based on vectorized positional features using a visual structure algorithm, in order to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for determining documents based on vectorized positional features using a visual structure algorithm, comprising the following steps: Step S1: Obtain the unfilled standard document template and extract the content of the title page area of the standard document; Step S2: Analyze the content and location information of all areas in the document title page. Using the topological relationship algorithm between the areas of the document title page, construct the topological relationship vector between different areas, and integrate it with the features of the area content itself to construct the document title page structure dataset. Step S3: Based on the document structure data classification dataset, the topological relationship vector of the document title page area structure layout and the corresponding document title area image data are used as training data and input into the document title page structure feature extraction model for training. The training model learns the representation method of document title page structure features. After training is completed, the feature dimension vector is extracted based on the document structure feature extraction model. Step S4: Based on the document structure feature extraction model trained above, construct a document structure feature vector dataset; Step S5: Classify and identify documents based on the document structure feature vector dataset.
[0005] Preferably, in step S1, the main process of constructing the structure of a standard document is as follows: sorting out the title pages of documents in the application scenario, constructing a blank document in a standard format, converting the blank document into an image format, and analyzing the page area of the title page of each type of document, wherein the page area includes the title area, document number area, stamp preset area, handwritten area, reserved area to be filled, filled text area, and table existence.
[0006] Preferably, based on the image of the document's title page, the division areas of the title are located, and the content features and position features of each division area are extracted.
[0007] Preferably, the main method for constructing the document title page structure dataset is: setting each area of the page as... The content features are as follows: the image patch in the region is extracted into a content vector using a convolutional encoder. The location feature is: recording its normalized vector. Combined with type-based one-hot encoding, it forms a position vector. The construction of inter-regional topological relationship vectors adopts a regional topological relationship algorithm, which is used for any two regions. and Calculate the geometric relation vector: ,in: (Relative offset of center) (Central Euclidean distance) (Relative angle) (Intersection, Union, and Comparison) (Area ratio), of which The horizontal and vertical projection overlap ratios are respectively used, and each region is treated as a graph node. As the initial feature, with For edge features, construct a topological relationship graph, and aggregate it through two layers of graph convolution: After global pooling, the topological relationship vector is obtained: The topological relationship vector is fused with the content features of each region using a splicing method: Perform the above operations in batches on the title page images of all known categories of documents, and then aggregate and fuse the feature vectors. And its category labels, thus constructing the document title page structure dataset.
[0008] Preferably, in step S3, the main steps of training the document structure feature extraction model are as follows: Based on the existing standard document structure data classification dataset, an interference dataset is generated for the standard document structure dataset through data augmentation, and data that cannot maintain the standard document structure is defined as a non-standard structure document dataset. The two datasets are merged and the document structure feature extraction classification model is trained. The standard structure document features in the dataset are compared with other document structure features. If the number of standard document structure features is complete and without missing features, and similar features are removed, and the document completely matches the standard vector, it is determined to be a document of the current standard structure category. If there is a difference compared with the standard document structure, it is determined to be a non-standard structure document. Through the above process, the model learns the mapping from feature vector comparison to classification label, and finally completes the training of the document structure feature extraction classification model.
[0009] Preferably, when processing documents, the physical documents need to be preprocessed first. The preprocessing method is to preprocess the document title page with the filled content, including image tilt correction, handwritten content removal, and seal removal. Among them, image tilt correction is to detect the tilt angle of the text or table in the image and perform rotation correction; handwritten content removal is to use image processing technology to erase the handwritten marks and retain the printed structure; seal removal is to detect and remove the red or other colored seal areas to avoid the seal from obscuring key layout information.
[0010] Preferably, in step S5, during the document feature vector comparison and classification: the preprocessed image is input into the document structure feature extraction model to obtain the structure feature vector of the image. The feature structure vector of the image is compared with the feature structure vector of a standard document to determine whether the structure feature vector of the image can conform to the value of the structure feature vector of a certain type of standard document. If the feature structure vector can conform to the value of the feature vector of a certain type of standard document, the corresponding document category is returned. If neither conforms to the standard document structure vector, the input document is defined as a non-standard document and output for further processing.
[0011] Compared with the prior art, the beneficial effects of the present invention are: This invention, based on visual structure vectors and using a topological relationship algorithm, solidifies the basic structure of documents, enabling rapid identification of document categories, bypassing content differences, focusing on structural stability, and greatly improving the speed and accuracy of document recognition. Attached Figure Description
[0012] Figure 1 This is a flowchart of the method in this invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example
[0014] This invention provides a method for judging documents based on vectorized positional features using a visual structure algorithm, comprising the following steps: Step S1: Obtain an unfilled standard document template. The standard document template mainly consists of documents in public security criminal and administrative case files, such as case registration forms, arrest warrants, detention warrants, summons warrants, etc. Extract the content of the title page area of the standard documents. The main process for extracting the content of the title page area of the standard documents is as follows: For example, in the application scenario of intelligent file assembly of public security documents, sort out the title pages of the documents in the scenario, construct a standard format blank document, convert the blank document into an image format, and analyze the page area of the title page of each type of document, such as analyzing the page areas of case registration forms, arrest warrants, detention warrants, and summons warrants. The page area includes the document title area, document number area, stamp preset area, handwritten area, reserved area to be filled, filled text area, and table existence. Through the image format converted from the blank document, based on these images, the division area of the title can be located, and the content features and position features of each division area can be extracted. Step S2: Using the standard document template and its page areas obtained above, analyze the content and position information of all areas in the document title page. Using a topological relationship algorithm between areas of the document title page, construct topological relationship vectors between different areas, and integrate these vectors with the features of the area content itself to construct a document title page structure dataset. The main method for constructing the document title page structure dataset is: setting each area of the page as... The content features are as follows: the image patch in the region is extracted into a content vector using a convolutional encoder. The location feature is: recording its normalized vector. Combined with type-based one-hot encoding, it forms a position vector. The construction of inter-regional topological relationship vectors adopts a regional topological relationship algorithm, which is used for any two regions. and Calculate the geometric relation vector: ,in: (Relative offset of center) (Central Euclidean distance) (Relative angle) (Intersection, Union, and Comparison) (Area ratio), of which The horizontal and vertical projection overlap ratios are respectively used, and each region is treated as a graph node. As the initial feature, with For edge features, construct a topological relationship graph, and aggregate it through two layers of graph convolution: After global pooling, the topological relationship vector is obtained: The topological relationship vector is fused with the content features of each region using a splicing method: Perform the above operations in batches on the title page images of all known categories of documents, and then aggregate and fuse the feature vectors. And its category labels, that is, to construct the document title page structure dataset, in which These refer to the x-axis and y-axis coordinates of the top-left corner of the current structural region on the corresponding image after normalization, as well as the width and height of the current region.
[0015] Step S3: Based on the document title page structure dataset constructed in the above steps, the topological relationship vector of the document title page area structure layout and the corresponding document title area image data are used as training data and input into the document title page structure feature extraction model for training. The training model learns the representation method of document title page structure features. After training, the feature dimension vector is extracted based on the document structure feature extraction model. The specific steps of training the document structure feature extraction model are as follows: Based on the existing title page structure dataset, i.e., the standard document structure data classification dataset, interference datasets targeting the standard document structure dataset are generated through data augmentation, and the data that cannot maintain the standard document structure are excluded. Defined as a non-standard structure document dataset, the interference dataset is merged with the standard structure document dataset to train a document structure feature extraction and classification model. The standard structure document features in the dataset are compared with the structure features of other documents. During the comparison process, if the number of structural features is complete and without missing parts when compared with standard documents and among standard documents, and after removing similar features, they completely match the standard vector, then the document is judged as a document of the current standard structure category. If there are differences compared with the standard document structure, it is judged as a non-standard structure document. Therefore, through the above process, the model learns the mapping from feature vector comparison to classification label, and finally completes the training of the document structure feature extraction and classification model.
[0016] Step S4: Based on the document structure feature extraction model trained above, construct a document structure feature vector dataset.
[0017] Step S5: Using the document structure feature vector dataset mentioned above, the processed documents can be classified and identified. Before processing the documents, preprocessing is required, primarily on the document title page with filled content. Preprocessing methods include image tilt correction, handwritten content removal, and seal removal. Image tilt correction involves detecting the tilt angle of text or tables in the image and rotating it for correction. Handwritten content removal uses image processing techniques to erase handwritten characters while preserving the printed structure. Seal removal detects and removes red or other colored seal areas, primarily by erasing content identified as red based on color tones in the image, thus avoiding... By preprocessing physical documents, such as seals obscuring key layout information, new documents can be classified and identified. During actual comparison, the preprocessed image is input into a document structure feature extraction model to obtain its structural feature vector. This vector is then compared to the feature vectors of standard documents. If the image's feature vector matches the values of a particular type of standard document, the corresponding document category is returned. Otherwise, the input document is defined as a non-standard document and output for further processing. This method not only solidifies the basic structure of documents but also enables rapid category determination, bypassing content differences and focusing on structural stability, significantly improving the speed and accuracy of document recognition.
[0018] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments are to be regarded in all respects as exemplary and not restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for judging a document based on a visual structure algorithm vectorized position feature, characterized in that, Includes the following steps: Step S1: Obtain the unfilled standard document template and extract the content of the title page area of the standard document; Step S2: Analyze the content and location information of all areas in the document title page, construct the topological relationship vector between different areas through the topological relationship algorithm between the areas of the document title page, and integrate it with the features of the area content itself to construct the document title page structure dataset; Step S3: Based on the document title page structure dataset, the topological relationship vector of the document title page area structure layout and the corresponding document title area image data are used as training data and input into the document title page structure feature extraction model for training. The training model learns the representation method of document title page structure features. After training is completed, the feature dimension vector is extracted based on the document structure feature extraction model. Step S4: Based on the document structure feature extraction model trained above, construct a document structure feature vector dataset; Step S5: Classify and identify documents based on the document structure feature vector dataset. 2.The method of claim 1, wherein the method further comprises: determining the type of the document based on the vectorized position feature. In step S1, the main process of extracting the title page area content of standard documents is as follows: sort out the title pages of documents in the application scenario, construct a blank document in a standard format, convert the blank document into an image format, and analyze the page area of the title page of each type of document. The page area includes the title area, document number area, stamp preset area, handwritten area, reserved area to be filled, filled text area, and table existence. 3.The method of claim 1, wherein the method further comprises: determining the type of the document based on the vectorized position feature. Based on the image of the document's title page, the title's divided regions are located, and the content and position features of each divided region are extracted.
4. The method for determining documents based on vectorized positional features using a visual structure algorithm according to claim 1, characterized in that: The main method for constructing a document title page structure dataset is to set each area of the page as... The content features are as follows: the image patch in the region is extracted into a content vector using a convolutional encoder. ; The location feature is: recording its normalized vector. Combined with type-based one-hot encoding, it forms a position vector. The construction of inter-regional topological relationship vectors adopts a regional topological relationship algorithm, which is used for any two regions. and Calculate the geometric relation vector: ,in: (Relative offset of center) (Central Euclidean distance) (Relative angle) (Intersection, Union, and Comparison) (Area ratio), of which The horizontal and vertical projection overlap ratios are respectively used, and each region is treated as a graph node. As the initial feature, with For edge features, construct a topological relationship graph, and aggregate it through two layers of graph convolution: After global pooling, the topological relationship vector is obtained: The topological relationship vector is fused with the content features of each region using a splicing method: Perform the above operations in batches on the title page images of all known categories of documents, and then aggregate and fuse the feature vectors. And its category labels, that is, to construct the document title page structure dataset, in which These refer to the x-axis and y-axis coordinates of the top-left corner of the current structural region on the corresponding image after normalization, as well as the width and height of the current region.
5. The method for determining documents based on vectorized positional features using a visual structure algorithm according to claim 1, characterized in that: In step S3, the main steps of training the document structure feature extraction model are as follows: Based on the existing standard document structure data classification dataset, an interference dataset is generated for the standard document structure dataset through data augmentation. Data that cannot maintain the standard document structure is defined as a non-standard structure document dataset. The two datasets are merged and the document structure feature extraction classification model is trained. The standard structure document features in the dataset are compared with other document structure features. If the number of standard document structure features is complete and without missing features, and similar features are removed, and the document completely matches the standard vector, it is determined to be a document of the current standard structure category. If there is a difference compared with the standard document structure, it is determined to be a non-standard structure document. Through the above process, the model learns the mapping from feature vector comparison to classification label, and finally completes the training of the document structure feature extraction classification model.
6. The method for determining documents based on vectorized positional features using a visual structure algorithm according to claim 1, characterized in that: When processing documents, the physical documents need to be preprocessed first. The preprocessing method is to preprocess the document title page with the content already filled in, including image tilt correction, removal of handwritten content, and removal of seals. Image tilt correction involves detecting the tilt angle of text or tables in an image and performing rotation correction. Handwritten content removal involves using image processing technology to erase handwritten marks while preserving the printed structure; stamp removal involves detecting and removing red or other colored stamp areas to prevent stamps from obscuring key layout information.
7. The method for determining documents based on vectorized positional features using a visual structure algorithm according to claim 1, characterized in that: In step S5, during the document feature vector comparison and classification: the preprocessed image is input into the document structure feature extraction model to obtain the structure feature vector of the image. The feature structure vector of the image is compared with the feature structure vector of the standard document to determine whether the structure feature vector of the image can match the value of the structure feature vector of a certain type of standard document. If the feature structure vector can match the value of the feature vector of a certain type of standard document, the corresponding document category is returned. If neither can match the standard document structure vector, the input document is defined as a non-standard document and output for further processing.
