Method, computer device and computer readable storage medium for anonymizing sensitive information of a multi-modal file
By combining visual language models and other models to identify and locate sensitive information in multimodal files, this technology solves the problem of being unable to anonymize non-textual visual privacy information in existing technologies, and achieves more accurate document anonymization processing.
Patent Information
- Application Number
- CN202611217660.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies cannot effectively anonymize non-textual visual privacy information, such as facial images and seals, in document processing, resulting in poor security.
By combining visual language models, layout structure analysis models, text detection and recognition models, and visual positioning models, sensitive information in multimodal documents is identified and located, and accurate anonymization is achieved through correction processing, including the identification and replacement of signatures and seals.
It improves the accuracy of multimodal document anonymization, ensures that non-textual sensitive information is effectively identified and processed, and enhances document security.
Smart Images

Figure CN123158668A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of document anonymization, specifically to a method, computer device, and computer-readable storage medium for anonymizing sensitive information in multimodal documents. Background Technology
[0002] With the widespread adoption of digital office work, document processing often involves sensitive information such as names, images of people, or seals. Accurate and complete anonymization of sensitive information throughout the entire document processing workflow has become a fundamental requirement for data security. Existing methods often suffer from omissions in identification or semantic corruption under complex layouts, making it difficult to balance thorough anonymization with content readability.
[0003] One document modification method involves extracting the original text and using Named Entity Recognition (NER) technology to classify text entities into categories such as ID number, location, organization, person's name, and date. Simultaneously, the document is converted into an image and then subjected to OCR recognition to determine the coordinate position of the entity on the page. Finally, a masking box is generated in the corresponding area to achieve anonymization.
[0004] However, this document modification method essentially only focuses on extractable or OCR-recognizable text content, failing to cover the widespread non-textual visual privacy information within documents, such as facial images and image identifiers like seals. These visual elements also carry highly sensitive identity information within documents and cannot be processed by the aforementioned document modification method, resulting in sensitive information that cannot be anonymized and thus poor security. Summary of the Invention
[0005] The primary objective of this invention is to provide a method for anonymizing sensitive information in multimodal files to improve the anonymization completion rate.
[0006] A second objective of this invention is to provide a computer device for implementing the above-described method for anonymizing sensitive information in multimodal files.
[0007] A third objective of this invention is to provide a computer-readable storage medium for implementing the above-described method for anonymizing sensitive information in multimodal files.
[0008] To achieve the first objective of this invention, the method for anonymizing sensitive information in multimodal files provided by this invention is characterized by: obtaining a sensitive information list from a configuration list module; obtaining a multimodal file, parsing the multimodal file to obtain original image data, inputting the original image data into a visual language model, a layout structure analysis model, and a text detection and recognition model respectively, and inputting the original image data and the sensitive information list into a visual positioning model; the visual language model analyzes the original image data and outputs multiple layout blocks with first label information and first text recognition results; the text detection and recognition model analyzes the original image data and outputs multiple text boxes with second text recognition results; the layout structure analysis model analyzes the original image data and outputs boundary coordinate information of multiple classification regions and second label information of multiple classification regions; the visual positioning model outputs visual candidate boxes corresponding to the sensitive information list; the second text recognition results and the sensitive information list are input into a semantic entity recognition module, which analyzes and outputs sensitive information; the sensitive information is input into a coordinate matching algorithm to obtain text candidate boxes; correction processing is performed based on the text candidate boxes and visual candidate boxes to obtain corrected sensitive information boxes, and the corrected sensitive information boxes are anonymized.
[0009] As can be seen from the above scheme, ordinary text detection and recognition models cannot recognize image data, and handwritten signatures are often identified as organization names. Furthermore, text obscured by a seal becomes ineffective due to illegible characters, resulting in fragmented output. Therefore, a visual language model, based on visible strokes, surrounding text, and the document's contextual semantics, derives information about the obscured content. A visual localization model then outputs candidate boxes to identify handwritten signatures and seals, allowing the obscured information to be retrieved and misidentified information to be removed. This makes anonymization more accurate and improves its precision.
[0010] In a further embodiment, the visual candidate box includes a signature box; the step of correcting based on the text candidate box and the visual candidate box includes: determining whether the center of the text candidate box is within the signature box or whether the center of the signature box is within the text candidate box; if so, the text candidate box is removed.
[0011] Therefore, if the center of the text candidate box falls into the signature box, and the center of the signature box falls into the text candidate box, then the text candidate box is determined to be a misreading of handwriting and is eliminated, thus improving the accuracy of anonymization.
[0012] In a further embodiment, the first text recognition result includes multiple first text recognition information and first coordinate information corresponding to the multiple first text recognition information; the second text recognition result includes second text recognition information and coordinate information corresponding to multiple second text recognition information; the layout block includes a positioning stamp frame.
[0013] In a further proposed solution, the steps for correcting text candidate boxes and visual candidate boxes include: determining whether the center of a text candidate box is within the positioning stamp box; if so, defining the text candidate box whose center is within the positioning stamp box as the text box to be replaced, and replacing the text box to be replaced with the first text recognition information of the first text recognition result at the same coordinates to obtain the replacement text candidate box.
[0014] Therefore, by finding text candidate boxes whose center falls into the positioning stamp box, the fragmented text can be retrieved. Then, the text output by the visual positioning model is used to replace the text candidate boxes, so that the fragmented text can be recovered.
[0015] In a further scheme, the visual candidate box includes a stamp layout frame; after defining the text box to be replaced, the following steps are also performed: determine whether the center of the positioning stamp frame is within the stamp layout frame and whether the center of the stamp layout frame is within the positioning stamp frame. If so, define the stamp layout frame as a discard stamp layout frame and remove the discard stamp layout frame from the stamp layout frame to obtain the modified stamp layout frame.
[0016] In a further step, after obtaining the modified seal layout frame, the following steps are performed: combine the modified seal layout frame and the positioning seal frame to obtain a set of seal frames.
[0017] Therefore, it can be seen that by making asymmetrical choices between the seal layout frame and the positioning seal frame of the visual language model and the visual positioning model, if the centers of the seal layout frame and the positioning seal frame are mutually contained, the positioning seal frame with more precise boundaries can be retained and can divide multiple adjacent seals one by one. Furthermore, seals that are not in the positioning seal frame are supplemented to form a complete set of seal frames.
[0018] In a further step, after obtaining the set of stamp frames, the following steps are performed: classifying the replacement text candidate frames and visual candidate frames according to the sensitive information list; and removing duplicate replacement text candidate frames and visual candidate frames of the same category that are geometrically overlapping to obtain the corrected sensitive information.
[0019] Therefore, since the content that the visual candidate box may recognize may overlap with the text candidate box, duplicate content is removed by deduplication to avoid the same content being anonymized twice, thus avoiding a waste of computer resources.
[0020] To achieve the second objective, the present invention provides a computer device comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed, it implements the above-described method for anonymizing sensitive information in multimodal files.
[0021] To achieve the third objective, the present invention provides a computer-readable storage medium storing a computer program thereon, characterized in that, when the computer program is executed, it implements the above-described method for anonymizing sensitive information in multimodal files. Attached Figure Description
[0022] Figure 1 This is a flowchart of an embodiment of the method for anonymizing sensitive information in multimodal files according to the present invention.
[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments. Detailed Implementation
[0024] This invention combines a visual language model, a layout structure analysis model, a text detection and recognition model, and a visual positioning model to find all sensitive information. After correction processing, the information of the covered content can be retrieved and the incorrectly identified information can be removed, thereby making anonymization more accurate and improving the precision of anonymization.
[0025] Example of a method for anonymizing sensitive information in multimodal files: To anonymize sensitive information in a multimodal file, step S11 is first executed to obtain the sensitive information list from the configuration list module. The configuration list module is a set of atomic tags, each corresponding to a recognition item; for example, a phone number is an atomic tag, a name is an atomic tag, etc. The configuration list module includes a semantic text axis and a visual feature axis. The semantic text axis sets sensitive information input to the visual language model, layout structure analysis model, text detection and recognition model, etc., and includes at least one of the following atomic tags: name, ID number, address, organization name, and date, etc. The visual feature axis sets sensitive information input to the visual positioning model, including at least one of the following atomic tags: face, seal, signature, ID card, license plate, QR code, etc. Users can select sensitive information to be anonymized in the configuration list module, forming a sensitive information list.
[0026] After obtaining the sensitive information list from the configuration manifest module, step S12 is executed to obtain a multimodal file. The multimodal file is then parsed to obtain the original image data. Specifically, multimodal files of different formats are converted to obtain unified original image data for easier subsequent recognition. In this embodiment, the multimodal file can be a plain text file, image file, scanned document, or PDF file, etc.; the obtained original image data is obtained by unifying the multimodal file into page images.
[0027] After obtaining the raw image data, step S13 is executed, whereby the raw image data is input into the visual language model, the layout structure analysis model, and the text detection and recognition model, respectively, and the raw image data and the sensitive information list are input into the visual positioning model. The visual language model, the layout structure analysis model, and the text detection and recognition model are text-based models, mainly used for recognizing text information. The visual positioning model is used for recognizing image-based information.
[0028] The visual language model is the PaddleOCR-VL model (v1.6, approximately 0.9B), deployed as a local inference service using vLLM (OpenAI compatible interface). The visual language model takes raw image data and a list of sensitive information along the semantic text axis as input, and outputs a layout block with first label information and the first text recognition result. The first label information is of type text, table, seal, etc. That is, each layout block carries one first label. The first text recognition result contains multiple first text recognition pieces and their corresponding first coordinate information. The first coordinate information is the polygonal coordinate information of the region of the first text recognition piece.
[0029] The layout structure analysis model is the PP-StructureV3 model, running on a local PaddlePaddle GPU process. The model outputs boundary coordinates of multiple classification regions and secondary label information for each region. Classification regions include titles, tables, and body text, performing region classification on the original image data. PP-StructureV3 is an open-source model, purely for inference and without training.
[0030] The text detection and recognition model is the PP-OCRv6 model, which outputs the second text recognition results for multiple text boxes. These results include the second text recognition information and the coordinate information corresponding to each text box. The layout structure analysis model provides second label information for the second text recognition results; that is, by determining whether a text box is within a classification region, it labels the text box with the second label information corresponding to that classification region. PP-OCRv6 is an open-source model, purely for inference and without training.
[0031] The visual localization model is the LocateAnything model (3B in size, with a visual backbone of MoonViT and a text backbone of Qwen2 classes), deployed as a local service (HF inference backend, vLLM optional). The visual localization model takes raw image data and a list of sensitive information as input, and outputs visual candidate boxes corresponding to the sensitive information list, such as signature boxes and seal layout boxes. Each visual candidate box includes a category, box coordinates, and confidence score.
[0032] Then, step S14 is executed, inputting the second text recognition result and the sensitive information list into the semantic entity recognition module, and outputting the sensitive information. The semantic entity recognition module uses a locally deployed semantic NER large model (HaS class, 0.6B scale, vLLM service) to output sensitive information, which is categorized according to the sensitive information list. For example, name is sensitive information 1, and phone number is sensitive information 2.
[0033] After outputting the sensitive information, step S15 is executed, inputting the sensitive information into the coordinate matching algorithm to obtain text candidate boxes. The coordinate matching algorithm includes exact matching, fuzzy matching, and visual line matching. The sensitive information is first compared with the second text recognition result through exact matching, i.e., string comparison operation. If the sensitive information has a completely identical string to the second text recognition result, it is mapped to the text box corresponding to the second text recognition result, and that text box is defined as a text candidate box.
[0034] Then, if the sensitive information and the second text recognition result do not have a completely identical string, a fuzzy matching operation is performed. Specifically, the similarity between the sensitive information and the second text recognition result is calculated. Similarity comparison can use Jaccard similarity, Hamming distance, etc. If the similarity between the sensitive information and the second text recognition result is greater than a preset value, the sensitive information is matched with the text box corresponding to that second text recognition result, and that text box is defined as a text candidate box. The preset value can be 0.9.
[0035] If the similarity between the sensitive information and the second text recognition result is less than a preset value, visual line matching is performed. Specifically, if the sensitive information is separated in the text box, for example, the surname and given name are separated into two text boxes, visual line matching needs to be performed. First, check if any two text boxes have a vertical overlap ratio greater than a first preset threshold to ensure that they are in the same horizontal band. If so, then determine whether the difference in the Y-coordinate of the center point of the two text boxes with a vertical overlap ratio greater than the first preset threshold is less than a preset deviation threshold to ensure that their center heights are aligned. If so, then determine whether the inline spacing of the two text boxes with a center point Y-coordinate difference less than the preset deviation threshold is less than the larger line height multiplied by a multiple. The vertical overlap ratio is the ratio of the vertical overlap length of the two text boxes to the smaller of their heights. The inline spacing is the distance from the right boundary of the left text box to the left boundary of the right text box, and the multiple is a preset multiple. If the text boxes meet the above three conditions, they are grouped into a line and then concatenated to obtain a concatenated text box. The string in the concatenated text box is then matched precisely and fuzzily with the sensitive information. The first preset threshold and preset multiple are preset by the user. For example, the first preset threshold is 0.8 and the preset multiple is 2.
[0036] After the coordinate matching algorithm, the text candidate boxes and their corresponding coordinate information are obtained. Then, step S16 is executed to perform correction processing based on the text candidate boxes and the visual candidate boxes to obtain the correction sensitive information boxes. The correction sensitive information boxes are then anonymized.
[0037] The correction process based on text and visual candidate boxes includes the following steps: Visual candidate boxes include signature boxes; the correction process based on text and visual candidate boxes includes: determining whether the center of a text candidate box is within the signature box or vice versa; if so, the text candidate box is removed. The formula for this determination is... ,in, For the text boxes that need to be removed, For text candidate boxes, For visual candidate boxes, For the set of signature boxes, that is At least one visual candidate box belongs to the signature box set. The center point of the box, Here is the indicator function for when a point falls into the box. The function is calculated as follows: ,in, , Here are the coordinates of the point to be detected. Let x be the x-coordinate of the point to be detected. y is the ordinate of the point to be detected. This is an indicator function. If the condition within the square brackets is true, the function takes the value 1; if it is false, the function takes the value 0. Let x be the x-coordinate of the top-left corner of the box to be calculated. Let be the ordinate of the top-left corner of the box to be calculated. Let be the width of the box to be calculated. The boxes to be calculated are those mentioned above. or If the center of the text candidate box falls into the signature box, and the center of the signature box falls into the text candidate box, then the text candidate box is determined to be a misreading of handwriting and is eliminated, thus improving the accuracy of anonymization.
[0038] The layout block includes a positioning stamp frame, which is the layout frame with the first label information "seal". Then, it is determined whether the center of the text candidate box is within the positioning stamp frame. If so, the text candidate box whose center is within the positioning stamp frame is defined as the text box to be replaced. The text box to be replaced is then replaced with the first text recognition information of the first text recognition result at the same coordinates, thus obtaining the replacement text candidate box. The formula for finding the text box to be replaced is as follows: , To position the stamp frame, For text candidate boxes, This is a set of stamp boxes with the first label information of the seal. The text box to be replaced is obtained using this formula. By finding text candidate boxes whose center falls within the positioning stamp box, the fragmented text can be retrieved. Then, the text output by the visual positioning model is used to replace the text candidate boxes, thus allowing the fragmented text to be recovered.
[0039] The visual candidate frame includes the stamp layout frame. After defining the text box to be replaced, the following steps are performed: determine whether the center of the positioning stamp frame is within the stamp layout frame and whether the center of the stamp layout frame is within the positioning stamp frame. If so, define the stamp layout frame as the discard stamp layout frame and remove the discard stamp layout frame from the stamp layout frame to obtain the modified stamp layout frame. , To discard the stamp frame, Output a set of stamp layout frames labeled "stamp" for the visual positioning model. The formula for calculating the mutual containment criterion is as follows: .
[0040] Then, the modified stamp layout frame and the positioning stamp frame are merged to obtain the stamp frame set. The formula is: , This option allows you to modify the stamp layout frame without discarding it. This is a collection of seal frames.
[0041] Then, the candidate text and visual boxes for replacement are categorized according to the list of sensitive information; duplicate candidate text and visual boxes of the same category that are geometrically overlapping are removed to obtain the corrected sensitive information. The calculation formula is as follows: ,in, To replace any one of the detection boxes in the text candidate box and the visual candidate box, In addition to Replace other boxes in the text candidate box and the visual candidate box. The category is an item in the list of sensitive information, such as a name. For the intersection-union ratio threshold, This is the inclusion rate threshold. The crossover ratio (CUP) threshold and inclusion rate threshold are preset thresholds. It can take the value 0.3 or 0.5. The value can be 0.72 or 0.7. The formula for calculating the intersection-union ratio is: The formula for calculating the coverage ratio is: . Let the area of the frame be denoted as . If the following conditions are met... The formula shows that there are duplicates, so duplicates need to be removed. Then, the sensitive information is corrected.
[0042] After obtaining the sensitive information for correction, it undergoes manual review. Then, the sensitive information is output to the anonymization module for anonymization. Anonymization can be achieved through masking, overlaying, or intelligent replacement.
[0043] This embodiment combines visual language models, layout structure analysis models, text detection and recognition models, and visual positioning models to find all sensitive information. After correction processing, the information of the covered content can be retrieved and the incorrectly identified information can be removed, thereby making anonymization more accurate and improving the accuracy of anonymization.
[0044] This embodiment can also access and anonymize structured data, including files in formats such as CSV, Excel, JSONL, and SQLite. Structured data can be uploaded by the user or obtained by connecting to a database. After acquiring the structured data, each column is identified by a semantic entity recognition module. This module parses the structured data and a list of sensitive information, categorizing the structured sensitive data according to the sensitive information list. Then, anonymization is performed on the structured sensitive data. The structured data and the aforementioned multimodal files use the same sensitive information list and semantic entity recognition module, reducing maintenance costs.
[0045] Computer device embodiment: The computer device in this embodiment includes a processor and a memory. The memory stores a computer program, and when the processor executes the computer program, it implements the above-described embodiment of the method for anonymizing sensitive information in multimodal files.
[0046] A computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that a computer device may include more or fewer components, or a combination of certain components, or different components; for example, a computer device may also include input / output devices, network access devices, buses, etc.
[0047] Examples of readable storage media: The method embodiments for anonymizing sensitive information in multimodal files in a computer device described above can be stored in a readable storage medium as a computer program. When this computer program is executed by a processor, it can complete the steps of the above-described method embodiments for anonymizing sensitive information in multimodal files. The computer-readable medium can be a computer-readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of 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 devices, magnetic storage devices, or any suitable combination thereof.
[0048] The above are merely preferred embodiments of the present invention, but the design concept of the invention is not limited thereto. Without departing from the concept of the present invention, many other equivalent embodiments may be included. Those skilled in the art can make various obvious changes, readjustments and substitutions without departing from the protection scope of the present invention.
Claims
1. A method for anonymizing sensitive information in multimodal files, characterized in that: Get the list of sensitive information from the configuration manifest module; A multimodal file is acquired, the multimodal file is parsed to obtain raw image data, and the raw image data is input into a visual language model, a layout structure analysis model, and a text detection and recognition model, respectively. The raw image data and the sensitive information list are input into a visual positioning model. The visual language model analyzes the original image data and outputs multiple layout blocks with first label information and first text recognition results. The text detection and recognition model analyzes the original image data and outputs multiple text boxes with second text recognition results. The layout structure analysis model analyzes the original image data and outputs the boundary coordinate information of multiple classification regions and the second label information of multiple classification regions. The visual positioning model outputs visual candidate boxes corresponding to the list of sensitive information. The second text recognition result and the sensitive information list are input into the semantic entity recognition module, and the semantic entity recognition module analyzes and outputs the sensitive information. The sensitive information is input into a coordinate matching algorithm to obtain text candidate boxes; Correction processing is performed on the text candidate boxes and the visual candidate boxes to obtain correction sensitive information boxes, and the correction sensitive information boxes are then anonymized.
2. The method for anonymizing sensitive information in multimodal files according to claim 1, characterized in that: The visual candidate box includes a signature box; The steps for corrective processing based on the text candidate boxes and the visual candidate boxes include: Determine whether the center of the text candidate box is within the signature box or whether the center of the signature box is within the text candidate box. If so, remove the text candidate box.
3. The method for anonymizing sensitive information in multimodal files according to claim 1, characterized in that: The first text recognition result includes multiple first text recognition information and first coordinate information corresponding to the multiple first text recognition information; The second text recognition result includes second text recognition information and coordinate information corresponding to multiple pieces of the second text recognition information; The layout block includes a positioning stamp frame.
4. The method for anonymizing sensitive information in multimodal files according to claim 3, characterized in that: The steps for corrective processing based on the text candidate boxes and the visual candidate boxes include: Determine whether the center of the text candidate box is within the positioning stamp box. If so, define the text candidate box whose center is within the positioning stamp box as the text box to be replaced, and replace the text box to be replaced with the first text recognition information of the first text recognition result at the same coordinates to obtain the replacement text candidate box.
5. The method for anonymizing sensitive information in multimodal files according to claim 4, characterized in that: The visual candidate frame includes a stamp layout frame; After defining the text box to be replaced, the following is also executed: Determine whether the center of the positioning stamp frame is within the stamp layout frame and whether the center of the stamp layout frame is within the positioning stamp frame. If so, define the stamp layout frame as the discard stamp layout frame and remove the discard stamp layout frame from the stamp layout frame to obtain the modified stamp layout frame.
6. The method for anonymizing sensitive information in multimodal files according to claim 5, characterized in that: After obtaining the modified seal layout frame, the following steps are also performed: The modified stamp layout frame and the positioning stamp frame are combined to obtain a stamp frame set.
7. The method for anonymizing sensitive information in multimodal files according to claim 6, characterized in that: After obtaining the set of stamp frames, the following is also executed: The replacement text candidate boxes and the visual candidate boxes are categorized according to the sensitive information list; The replacement text candidate boxes and the visual candidate boxes of the same category and with geometric overlap are deduplicated to obtain the correction sensitive information.
8. A computer device, the computer device comprising a processor and a memory, characterized in that, The memory stores a computer program that, when executed, implements the sensitive information anonymization method for multimodal files as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the method for anonymizing sensitive information in multimodal files as described in any one of claims 1 to 7.
