A vector font generation method for document information hiding
By training an encoder-decoder and introducing a noise layer, a vector font that can still extract information under various distortion scenarios is generated. This solves the problems of time-consuming and laborious font design and insufficient robustness in existing technologies, and achieves efficient information embedding and extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH OF CHINA
- Filing Date
- 2023-01-15
- Publication Date
- 2026-05-29
AI Technical Summary
Existing vector font generation methods are difficult to automate, lack versatility and robustness, resulting in time-consuming and laborious font design and difficulties in information extraction during document transmission.
By training an image-based encoder-decoder, introducing a noise layer to simulate distortion, using a differentiable renderer to establish the connection between the font image and the vector font, and using an optimization algorithm to transfer information to the vector font, a vector font capable of extracting information under various distortion scenarios is generated.
It reduces the manual cost of font design, improves the success rate of traceability and evidence collection, and the generated fonts can maintain robustness when embedded in documents, such as screenshots, print photos, and print scans. It is suitable for the protection of military, government, enterprise and private documents.
Smart Images

Figure CN115879416B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of document information processing technology, and in particular to a vector font generation method for hiding document information. Background Technology
[0002] Documents are one of the most widely used media in our daily lives, allowing us to effectively acquire useful information. Furthermore, hiding more information within documents can enable large-scale practical business applications. For example, embedding hyperlinks in documents allows readers to access richer information via mobile scanning; embedding invisible watermarks helps protect the intellectual property of document owners; and embedding identification information (such as employee IDs) helps government agencies, the military, and businesses trace the leakers of confidential documents. Due to the redundancy of images, information hiding techniques in natural images have been extensively studied, primarily based on pixel-level modifications. However, compared to natural images, document images only have simple text structures and backgrounds, lacking complex textures and colors, making the concealed embedding of information within documents more challenging.
[0003] Due to the unstructured nature of vector fonts, they are more difficult to synthesize than font images. Existing methods mainly rely on hiring human designers to manually design fonts, which is time-consuming and labor-intensive. Furthermore, due to the diversity of fonts in language and style, manually designed modifications cannot be generalized to different fonts. In practice, document files undergo various distortions during transmission, making it crucial to ensure extractability under these distortions. Therefore, this field proposes three requirements for vector font generation: automation, universality, and robustness. However, existing methods cannot adequately meet all three requirements simultaneously. Summary of the Invention
[0004] The purpose of this invention is to provide a vector font generation method for document information hiding. This method can greatly reduce the manual cost of font design and ensure a higher success rate of tracing and evidence collection in real-world scenarios. The generated font can be used to embed secret information in documents that is robust to distortions caused by processes such as screenshots, print photography, print scanning, and screen photography.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] A vector font generation method for document information hiding, the method comprising:
[0007] Step 1: Train an image-based encoder-decoder to perform invisible encoding on the original font image, so that it carries different bit information;
[0008] Step 2: During the training process in Step 1, a noise layer is introduced to work with the encoder and decoder to simulate distortions in everyday document usage scenarios;
[0009] Step 3: After training is complete, use a differentiable renderer to establish the relationship between the encoded font image and the original vector font;
[0010] Step 4: The information in the encoded font image is transferred to the corresponding vector font through an optimization algorithm to obtain the encoded vector font;
[0011] Step 5: Replace the original font in the document with an encoded vector font to embed invisible information in the document, which can still be correctly extracted even after the document has undergone various distortions.
[0012] As can be seen from the technical solution provided by the present invention, the above method can greatly reduce the manual cost of font design and ensure a higher success rate of tracing and evidence collection in real-world scenarios. The generated font can be used to embed confidential information in documents that is robust to distortions caused by processes such as screenshots, print photography, print scanning, and screen photography. In common document leakage scenarios, it can be used to collect evidence and trace the source of leaked content, thereby achieving the purpose of protecting the content of military, government, enterprise, and private documents. Attached Figure Description
[0013] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a schematic diagram of a vector font generation method for hiding document information provided in an embodiment of the present invention.
[0015] Figure 2 This is a partial font result display diagram generated by an embodiment of the present invention. Detailed Implementation
[0016] 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, and do not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0017] like Figure 1The diagram shows a flowchart of a vector font generation method for document information hiding provided in an embodiment of the present invention. The method includes:
[0018] Step 1: Train an image-based encoder-decoder to perform invisible encoding on the original font image, so that it carries different bit information;
[0019] In this step, the encoder's input includes a raw font image. And multi-bit information to be encoded; the encoder output is the encoded font image with bit information, specifically:
[0020] The encoder is trained to encode bit information on each original font image while minimizing the perceptual difference between the original and encoded font images. It first applies convolutions to the input original font images to form an intermediate representation; then, the bit message to be encoded is copied to the same shape as the input image and concatenated with the intermediate representation. After several subsequent convolutions, the encoder produces the encoded font image. ;
[0021] Meanwhile, to ensure visual quality, a basic loss function is introduced. Used to calculate the original font image and encoded font image The mean square error between them is expressed as:
[0022]
[0023] To better preserve the details of the font image at the feature level, an image perceptual loss is introduced, which is achieved by calculating the feature distance between different layers of the VGG network. express;
[0024] In addition, it also introduces counter-loss measures. To further improve visual quality, specifically, a discriminator is trained to distinguish between the image output by the encoder and the original image. At the same time, the encoder generates a highly realistic image that the discriminator cannot distinguish correctly. The two work together in a constantly adversarial training method, thereby improving the visual quality of the generated font image.
[0025] The decoder is used to extract the encoded font image. Extract the carried bit information.
[0026] Step 2: During the training process in Step 1, a noise layer is introduced to work with the encoder and decoder to simulate distortions in everyday document usage scenarios;
[0027] In this step, differentiable noise is introduced to simulate the distortion caused by the physical printing and display of documents between the encoder and decoder. Based on analysis of real-world document usage scenarios, the introduced noise layer includes:
[0028] Translation: Randomly translates the region of the character shape;
[0029] Scaling: Stretches and narrows the length and width of the character area by a random ratio (ranging from 0.5 to 1.5, which can be modified appropriately according to different scenario requirements);
[0030] Rotation: Rotate the character area at a random angle (ranging from -10° to 10°, which can be modified appropriately according to different scenario requirements);
[0031] Perspective transformation: Randomly perturb the positions of the four corners of the image within a fixed range (±4 pixels, which can be modified appropriately according to different scene requirements);
[0032] Blur: Uses the common motion blur function (Blur) to simulate a blurred effect on an image;
[0033] Gaussian noise: We use a Gaussian noise model to simulate image noise (standard deviation σ is randomly sampled from [0, 0.02]);
[0034] Color modification: Randomly transform the colors of the input image, i.e., modify the brightness and contrast;
[0035] Font image after encoder encoding It will pass through the introduced noise layer before being fed into the decoder.
[0036] The aforementioned noise layer ensures robustness against low-resolution screenshots, printing, and camera image distortion.
[0037] Step 3: After training is complete, use a differentiable renderer to establish the relationship between the encoded font image and the original vector font;
[0038] In this step, a differentiable renderer is used to render vector drawing commands (including discrete unstructured data such as coordinate types and coordinate values) into corresponding font images of a specified size;
[0039] A differentiable renderer is a renderer that renders the drawing instructions of the input raw vector font into a 2D image (rasterization) in a differentiable form, using C to represent the original coordinate values of the drawing instructions; the differentiable renderer outputs the font rendering image corresponding to the drawing instructions; then the rendered font image is also distorted by a noise layer, producing a noisy font rendering image. The decoder extracts the corresponding length of bit information from it. .
[0040] Step 4: The information in the encoded font image is transferred to the corresponding vector font through an optimization algorithm to obtain the encoded vector font.
[0041] The specific optimization algorithm for this step is as follows:
[0042] 1) First, set the original coordinate value C of the drawing command as the parameter to be optimized, and use a differentiable renderer to render the vector command corresponding to the original coordinate value C as a font rendering image. ,Will After passing through the noise layer, the distorted font rendering image is obtained. ;
[0043] 2) Render the distorted font image The input is fed into the decoder to extract the message, and the extracted information is obtained. ;
[0044] 3) Calculation With the original embedded message The distance between them, using express;
[0045] 4) Calculate the font rendering image and encoded font images The distance between them, using express;
[0046] 5) Utilize and The generated gradient optimizes and adjusts the coordinate values to obtain the optimized coordinate values. ;
[0047] 6) Iterate the above process until the rendered image carries the encoded font image. The same message;
[0048] Then, using the optimized coordinate values... The encoded drawing instructions directly construct a vector font carrying bit information, making the encoded font image... The invisible, robust information carried on the vector font is passed to the vector font to obtain the encoded vector font.
[0049] Step 5: Replace the original font in the document with an encoded vector font to embed invisible information in the document, which can still be correctly extracted even after the document has undergone various distortions.
[0050] In this step, after obtaining the encoded vector font, a robust watermark is embedded in the document to ensure traceability by replacing the original font. The fonts used for embedding information can be automatically generated, and the watermarks embedded in these fonts resist common document transmission processes. In practice, even if the document content is disseminated through processes such as screenshotting, printing, scanning, or screen capture, the retained watermark information can be used for traceability, thereby protecting the copyright and privacy of the document owner.
[0051] To illustrate the technical effects of the method described in the embodiments of the present invention, experiments are conducted below:
[0052] 1. Evaluation of the visual quality of the generated font.
[0053] Two representative visual quality evaluation metrics, PSNR and SSIM, were used to evaluate the visual quality of the fonts generated in the embodiments of the present invention, as shown in Table 1.
[0054] Table 1. Accuracy of face forgery detection in FOD scenarios
[0055]
[0056] Experimental results show that the fonts generated by the method of this invention have high visual quality, such as... Figure 2 The image shown is a partial display of font results generated by an embodiment of the present invention.
[0057] 2. Robustness assessment of the screenshot process to distortion.
[0058] In the robustness assessment against screenshot distortion, all encoded glyphs were first printed in a PDF file, and screenshots were taken at different resolutions (i.e., font sizes). Then, the average extraction accuracy (ACC) was calculated, as shown in Table 2.
[0059] Table 2. Average extraction accuracy (%) in screenshot scenarios
[0060]
[0061] As can be seen, this application achieves better robustness with English fonts than with Chinese fonts. Moreover, in most cases, it achieves a success rate of over 90%, which is a significant advantage over the baseline method (Qi). Note that this application aligns the amount of font modification required by the baseline method with the method of this invention; even with a font size of 16px, an ACC greater than 80% is still guaranteed. This means that even at very low resolutions, this application can still achieve correct information extraction by using error-correcting codes such as BCH.
[0062] 3. Evaluation of robustness to distortion during the printing and photographing process.
[0063] In the assessment of robustness to print-photograph distortion, the above documents were printed and photographed, and the average extraction accuracy (ACC) of the extracted information was calculated, as shown in Table 3.
[0064] Table 3. Average extraction accuracy (%) in print photography scenarios
[0065]
[0066] Even when the font size is larger than 20px, this application can still achieve an extraction accuracy of over 90%.
[0067] 4. Robustness assessment of distortion during screen capture.
[0068] In the evaluation of robustness to screen capture distortion, the above document was displayed on different monitors and photographed with different mobile phones; then the average extraction accuracy (ACC) of the extracted information was calculated, as shown in Table 4.
[0069] Table 4. Average extraction accuracy (%) in screen capture scenarios
[0070]
[0071] Despite the severe noise, this application still performs well.
[0072] The experimental results above show that the method described in this embodiment of the invention can automatically synthesize high-quality vector fonts and embed information in documents using these fonts to protect the documents, achieving a higher extraction accuracy rate than existing methods.
[0073] It is worth noting that the contents not described in detail in the embodiments of the present invention belong to the prior art known to those skilled in the art.
[0074] Furthermore, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0075] In summary, compared with traditional document leakage tracing methods, the method described in this embodiment of the invention can automatically generate any given vector font and embed secret information in the generated vector font. The entire process does not require the participation of human font designers, and it is robust to distortions caused by common document leakage processes such as printing-photographing and screen-photographing.
[0076] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.
Claims
1. A vector font generation method for document information hiding, characterized in that, The method includes: Step 1: Train an image-based encoder-decoder to perform invisible encoding on the original font image, so that it carries different bit information; Step 2: During the training process in Step 1, a noise layer is introduced to work with the encoder and decoder to simulate distortions in everyday document usage scenarios; Step 3: After training is complete, use a differentiable renderer to establish the relationship between the encoded font image and the original vector font; In step 3, a differentiable renderer is used to render the vector drawing command into a corresponding font image of a specified size; Among them, the differentiable renderer is a renderer that renders the drawing instructions of the input original vector font into a 2D image in a differentiable form, using C to represent the coordinate values of the drawing instructions; The differentiable renderer outputs the font rendering image corresponding to the drawing instructions; then the rendered font image is also distorted by the noise layer, producing a noisy font rendering image. The decoder extracts the corresponding length of bit information from it. ; Step 4: The information in the encoded font image is transferred to the corresponding vector font through an optimization algorithm to obtain the encoded vector font; The process of step 4 is as follows: 1) First, set the original coordinate value C of the drawing command as the parameter to be optimized, and use a differentiable renderer to render the vector command corresponding to the original coordinate value C as a font rendering image. ,Will After passing through the noise layer, the distorted font rendering image is obtained. ; 2) Render the distorted font image The input is fed into the decoder to extract the message and obtain the extracted bit information. ; 3) Calculation With the original embedded message The distance between them, using express; 4) Calculate the font rendering image and encoded font images The distance between them, using express; 5) Utilize and The generated gradient optimizes and adjusts the coordinate values to obtain the optimized coordinate values. ; 6) Iterate the above process until the rendered image carries the encoded font image. The same message; Then, using the optimized coordinate values... The encoded drawing instructions directly construct a vector font carrying bit information, making the encoded font image... The invisible, robust information carried on the vector font is passed to the vector font to obtain the encoded vector font; Step 5: Replace the original font in the document with an encoded vector font to embed invisible information in the document, which can still be correctly extracted even after the document has undergone various distortions.
2. The vector font generation method for document information hiding according to claim 1, characterized in that, In step 1, the encoder input includes a raw font image. And multi-bit information to be encoded; the encoder output is the encoded font image with bit information, specifically: The encoder is trained to encode bit information on each original font image while minimizing the perceptual difference between the original and encoded font images. First, a convolution is applied to the input original font image to form an intermediate representation. Then, the bit message to be encoded is copied to the same shape as the input image and concatenated with the intermediate representation. After several subsequent convolutions, the encoder produces the encoded font image. ; Meanwhile, to ensure visual quality, a basic loss function is introduced. Used to calculate the original font image and encoded font image The mean square error between them is expressed as: ; To better preserve the details of the font image at the feature level, an image perceptual loss is introduced, which is achieved by calculating the feature distance between different layers of the VGG network. express; The decoder is used to extract the encoded font image. Extract the carried bit information.
3. The vector font generation method for document information hiding according to claim 1, characterized in that, In step 2, differentiable noise is introduced to simulate the distortion caused by the physical printing and display of documents between the encoder and decoder. Based on analysis of real-world document usage scenarios, the introduced noise layer includes: Translation: Randomly translates the region of the character shape; Scaling: Randomly stretches and narrows the length and width of the character area; Rotation: Rotate the character area by a random angle; Perspective transformation: Randomly perturbs the positions of the four corners of an image within a fixed range; Blur: Uses the motion blur function to simulate a blurred effect on an image; Gaussian noise: A Gaussian noise model is used to simulate image noise; Color modification: Randomly transform the colors of the input image, i.e., modify the brightness and contrast; Font image after encoder encoding It will pass through the introduced noise layer before being fed into the decoder.
4. The vector font generation method for document information hiding according to claim 1, characterized in that, In step 5, after obtaining the encoded vector font, a robust watermark is embedded in the document to ensure the document's traceability by replacing the original font in the document. The fonts used for embedding information can be automatically generated, and the watermarks embedded in these fonts resist the document transmission process.