We propose TRACE, a structure-aware framework leveraging diffusion models for localized character encoding to embed data. Unlike existing methods that rely on edge features or pre-defined codebooks, TRACE exploits character structures that provide inherent resistance to noise interference due to their stability and unified representation across diverse characters. Our framework comprises three key components: (1) adaptive diffusion initialization that automatically identifies handle points, target points, and editing regions through specialized algorithms including movement probability estimator (MPE), target point estimation (TPE) and mask drawing model (MDM), (2) guided diffusion encoding for precise movement of selected point, and (3) masked region replacement with a specialized loss function to minimize feature alterations after the diffusion process. Comprehensive experiments demonstrate \name{}'s superior performance over state-of-the-art methods, achieving more than 5 dB improvement in PSNR and 5% higher extraction accuracy following cross-media transmission. \name{} achieves broad generalizability across multiple languages and fonts, making it particularly suitable for practical document security applications.
Figures & tables
Figure 1: Illustration of different document hiding methods. Image-based methods embed information by adjusting the proportion of black pixels but are vulnerable to noise from cross-media transmission, leading to extraction errors. Font-based methods rely on predefined character codebooks, which limits their generalizability when encountering unseen characters. In contrast, our method leverages character structures to guide diffusion-based encoding, ensuring broad applicability. Moreover, character structures are more stable to noise, providing strong robustness.
Figure 2: TRACE Embedding Pipeline. Step 1. Adaptive Diffusion Initialization: Handle points, target points, and masks are identified to guide the subsequent diffusion process. Step 2. Guided Diffusion Encoding: The diffusion model’s UNet is fine-tuned via LoRA to better capture original image features. The marked image is then generated by controlled movement of handle points to target points within the predefined mask region. Step 3. Masked Region Replacement: The content within the mask of the original image is replaced with the corresponding encoded segments.
Figure 3: Illustration the direction of Ph movements corresponding to its stroke in various orientations.
Table 4
Figure 4: Robustness against Print-camera with varying viewpoint and distance.
Figure 5: Visual comparisons of encoded images of our TRACE and the comparison method [ 29 ] .
Method
Arial
TNR
Calibri
Simsun
Simhei
PSNR ↑
ASF
26.56
27.29
27.46
30.34
26.23
TRACE
36.76
36.51
32.38
40.98
40.05
SSIM ↑
ASF
0.984
0.986
0.985
0.989
0.986
TRACE
0.996
0.995
0.995
0.998
0.998
Table 5: PSNR and SSIM of TRACE and ASF, with best ACC marked in boldface .
Method
Screenshots
Print-scan
Print-camera
PSNR
SSIM
Handwritten
94.43
93.17
91.67
38.20
0.996
Artistic
97.27
94.77
92.93
41.37
0.995
Table 6: Invisibility and Robustness of TRACE on handwritten to artistic fonts, evaluating robustness to screenshots, print-scan, and print-camera.
Figure 6: Generalizability of our TRACE from handwritten to artistic fonts.
Figure 7: Hyper-parameter Sensitivity Analysis: Impact of D and τ on Watermarking Robustness (ACC) and Imperceptibility (PSNR, SSIM).
Design
Setting 1
Setting 2
Setting 3
Setting 4 (Ours)
MPE
✗
✓
✗
✓
TPE
✗
✗
✓
✓
ACC
49.95
68.75
53.50
100
Table 7: Ablation study on MPE and TPE. (✗: random point selection operation, ✓: MPE or TPE operation).
Figure 8: Ablation study on Llc loss, taking lowercase letters ‘g’ and ‘u’ in Calibri as examples.
Figure 9: Ablation study on MRR across various fonts in 12pt.
Strength
12pt
16pt
20pt
24pt
28pt
36pt
Light
97.83
98.56
98.91
99.12
99.54
99.96
Strong
96.54
97.21
97.89
98.35
98.92
99.74
Table 8: The robustness of our TRACE against structure morphing attack of varying strengths and font sizes.
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
Figure A : Three heatmaps output by the keypoint extraction network, including an endpoint heatmap, a junction point heatmap, and a background heatmap.
Figure B : Examples of handle points and target points selected by MPE and TPE, respectively, and masks drawn by MDM.
Method
PSNR (dB) ↑
SSIM ↑
ACC (%) ↑
w/o Rule 1:
25.24
0.911
63.33
w/o Rule 2:
39.48
0.997
80.67
w/o Rule 3:
32.82
0.965
68.51
MPE (Ours)
32.10
0.962
100.00
Appendix
Table A : Ablation study on MPE scoring rules, failed cases ( i.e . , PSNR < 30dB, SSIM < 0.95, and ACC < 85%) are marked in red.
Figure C : Examples of Japanese, Korean, Russian, and Arabic characters embedding ’0’ and ’1’ using the TRACE method.
Figure D : Generalizability in mathematical formulas, each character in every formula embeds 0 and 1 bits, respectively.
Number of words
5
10
15
20
8bit
97.78
100.00
100.00
100.00
16bit
59.76
99.62
100.00
100.00
32bit
0.37
61.16
99.03
100.00
Appendix
Table B : Impact of embedded bits and consecutive word count on average extraction accuracy.
Figure E : The visual effects of our method and the comparison methods.
Category
Method
Robustness
Generalizability
Integrity
Print-scan
Print-camera
Screenshot
Handwritten
artistic
formula
Language-universality
Font-based
[ 18 , 27 ]
✓
✓
✓
✗
✗
✗
✗
✓
Image-based
[ 13 , 11 ]
✓
✓
✓
✓
✗
✓
✓
✓
Format-based
[ 4 ]
✓
✗
✓
✓
✓
✓
✓
✓
Linguistic-based
[ 12 , 6 , 28 , 7 ]
✓
✓
✓
✗
✓
✗
✗
✗
TRACE (Ours)
✓
✓
✓
✓
✓
✓
✓
✓
Appendix
Table C : Qualitative comparison with related work from different perspectives.
Figure F : Visual comparisons of our TRACE and the comparison method AutoStegaFont [ 29 ] on encoded images of the Arial font, (a) original images, (b) encoded images embedding “0” by TRACE, (c) encoded images embedding “1” by AutoStegaFont, (d) encoded images embedding “1” by TRACE, (e)encoded images embedding “0” by AutoStegaFont.
Figure G : Visual comparisons of our TRACE and the comparison method AutoStegaFont [ 29 ] on encoded images of the Calibri font, (a) original images, (b) encoded images embedding “0” by TRACE, (c) encoded images embedding “1” by AutoStegaFont, (d) encoded images embedding “1” by TRACE, (e)encoded images embedding “0” by AutoStegaFont.
Figure H : Visual comparisons of our TRACE and the comparison method AutoStegaFont [ 29 ] on encoded images of the Times New Roman font, (a) original images, (b) encoded images embedding “0” by TRACE, (c) encoded images embedding “1” by AutoStegaFont, (d) encoded images embedding “1” by TRACE, (e)encoded images embedding “0” by AutoStegaFont.
Figure I : Visual comparisons of our TRACE and the comparison method AutoStegaFont [ 29 ] on encoded images of the Simhei font, (a) original images, (b) encoded images embedding “0” by TRACE, (c) encoded images embedding “1” by AutoStegaFont, (d) encoded images embedding “1” by TRACE, (e)encoded images embedding “0” by AutoStegaFont.
Figure J : Visual comparisons of our TRACE and the comparison method AutoStegaFont [ 29 ] on encoded images of the Simsun font, (a) original images, (b) encoded images embedding “0” by TRACE, (c) encoded images embedding “1” by AutoStegaFont, (d) encoded images embedding “1” by TRACE, (e)encoded images embedding “0” by AutoStegaFont.