FontCode Steganography
- FontCode steganography is a document watermarking method that encodes data by applying nearly imperceptible perturbations to font glyphs, preserving both visual quality and text content.
- It employs a multi-stage codebook construction using perceptual sampling, CNN-based discrimination, and iterative pruning to generate machine-decodable yet human-indistinguishable glyph variants.
- The approach features robust error correction using Chinese Remainder Theorem encoding and maximum-likelihood decoding, enabling reliable metadata embedding and applications like digital signatures and optical barcodes.
FontCode steganography is a document watermarking and information embedding methodology that encodes user-specified data into text documents by making visually subtle, machine-recognizable perturbations to font glyphs. Information is robustly recoverable from digital vector and raster documents, as well as from photographs of printed hardcopies, while the original text content and aesthetics are preserved (Xiao et al., 2017).
1. Font Manifold and Glyph Generative Model
The FontCode method is grounded in the concept of a continuous "font manifold" for each character, as introduced by Campbell & Kautz (2014). For each character (such as ‘a’), a low-dimensional manifold (with in practice) is learned such that every point corresponds to a valid glyph outline . The generative mapping constructs vector graphic glyphs (via polyline or spline control points):
where are learned basis shapes, and are smooth weight functions over the 2D manifold. The original font's glyph is located at a reference coordinate ; encoding proceeds by replacing with a nearby manifold sample selected for information embedding. Such perturbations result in barely perceptible yet systematically altered stroke widths, serifs, or other glyph features.
2. Codebook Construction: Unobtrusive and Machine-Recognizable Perturbations
For each character-font pair, codebooks of machine-recognizable yet perceptually ambiguous glyphs are constructed through a multi-stage process:
- Perceptual Sampling (MTurk Study): Approximately 400 points are sampled in a neighborhood of . Human raters perform a two-glyph forced-choice task ("Which is closer to standard font?") and a Bradley-Terry model yields a scalar similarity . Glyphs with () form the initial candidate set , with this threshold empirically ensuring that perturbed glyphs are indistinguishable from the originals by humans (confirmed in perceptual studies with significance).
- Iterative Confusion-Test Pruning: In each round, 100 random candidate glyph pairs are subject to CNN-based discrimination. Edges between glyphs that the CNN cannot distinguish with accuracy are flagged as "confusing," and removed. The maximal clique in the remaining graph forms the updated candidate set . The process repeats until stabilization.
- Final Machine Verification: For each glyph, a CNN classifier is trained on synthetic and real-photo instances. Glyph samples whose per-glyph classification accuracy falls below are culled.
The resulting codebook for each glyph is a list
of glyph perturbations which are visually indistinguishable but reliably machine-decodable.
3. Embedding User Messages via Glyph Modulation
Given a text document and a bit-string message , FontCode proceeds as follows:
- The document is parsed, yielding a letter sequence , each annotated with its font manifold coordinate and bounding box.
- The text is partitioned into blocks of letters (). For block , the codebook sizes for each letter are obtained.
- Select mutually prime numbers with , maximizing the product of the smallest ().
- The next bits from are interpreted as integer .
- For each letter , the codeword component determines which codebook glyph replaces the standard glyph, scaled to the original bounding box.
The message is thus embedded in unobtrusive perturbations of the text's glyphs, blockwise, until an end-of-message marker is inserted.
4. Glyph Recognition and Integer Retrieval
Recovery operates in two modes:
- Pixel-Image Mode: OCR is used to locate each letter and its bounding box; glyphs are cropped, binarized, resized to pixels, and input to a per-character CNN. The CNN architecture consists of three convolutional layers (kernels: , , ), ReLU activation, pooling, followed by two fully connected layers and softmax. The output probabilities yield the predicted codebook index .
- Vector-Graphic Mode: The polyline of each extracted letter is compared against all codebook glyph polylines (rescaled as needed), with L distance computed; the nearest codebook glyph is taken as the embedded symbol.
These procedures decode the embedded message via robust glyph recognition in both raster and vector formats, and for scanned or photographed printouts.
5. Error Correction: CRT Coding and Maximum-Likelihood Decoding
Let each -letter block encode a codeword . Upon recognition, an observed (possibly corrupted) vector is obtained.
- Chinese Remainder Encoding: Encode as
The minimum Hamming distance among any two codewords is (e.g. $3$ for , ).
- Decoding: Compute the candidate integer using the Chinese Remainder Theorem (CRT):
If , accept . Otherwise, Hamming-decode to the nearest valid codeword, correctable up to errors (i.e. up to 1 misrecognized letter per block by default).
- Maximum-Likelihood Refinement: For ambiguous cases (up to 2 errors per 5-letter block), likelihoods are assigned using the softmax probability (pixel case, ) or inverse L distance (vector case, $1/d(u, f)$). The codeword maximizing likelihood is selected and decoded via CRT. This extends correctability to 2/5 letters per block in practice (40%).
6. Quantitative Evaluation and Performance
- Recognition: Per-glyph CNN accuracy exceeds 90% on real-photo tests.
- Capacity: The average achievable embedding rate is bits per letter in English text. Encoding a 128-bit MD5 hash requires on average 73 letters.
- Robustness: For input images with character height pixels, end-to-end decoding approaches zero error; accuracy drops for lower resolutions.
- Error Correction: Maximum likelihood decoding yields correction capability for up to 2 out of 5 glyph errors per block (40%), versus 1/5 (20%) for pure CRT/Hamming decoding.
- Runtime: Decoding of 176 letters (35 blocks) executes in 0.89 seconds on a Titan X GPU; encoding requires 7.3 seconds on a single CPU thread.
- Perceptual Studies: MTurk experiments () confirm that ensures glyphs are indistinguishable from originals ( for pairwise discrimination, for aesthetic preference). Lower (e.g., 0.7) produces noticeable degradation.
7. Demonstrated Applications
FontCode supports multiple applications:
- Format-Independent Metadata Holder: Embeds metadata (author, date, URL, etc.) within document text, surviving PDF-Word-PNG conversions, printing, and photography—unlike EXIF or XMP metadata.
- Unobtrusive Optical Barcode: Replaces visual QR barcodes with “invisible” text perturbations. A smartphone app can OCR the text region and decode the embedded information without visible artifacts.
- Symmetric-Key Encryption: Each codebook is permuted per character using a secret key. Alice and Bob, sharing the permutation, can embed and recover secret information. The keyspace is for lowercase, with uppercase.
- Document Signature: Supports both symmetric (MD5 hash of the text, embedded using secret permutation) and asymmetric (RSA-signed hash embedded, verifiable via public key) signatures. The signature remains valid through format conversions and reprinting. An extension enables per-segment hashing (∼80-letter blocks) for tamper localization.
These applications illustrate the flexibility of FontCode as an information-carrying layer resilient to perceptual, digital, and physical document transformations (Xiao et al., 2017).