FW-GAN: Frequency-Driven Handwriting Synthesis
- The paper introduces a novel frequency-driven framework that synthesizes handwriting by aligning high-frequency details using a dual-discriminator and a wave-modulated MLP generator.
- FW-GAN leverages a style encoder combined with conditional batch normalization to extract and inject writer-specific latent codes from a single reference image.
- Empirical results on IAM and HANDS-VNOnDB datasets demonstrate that FW-GAN outperforms prior models in FID and recognition metrics, offering superior augmentation for low-resource handwriting tasks.
Searching arXiv for the exact FW-GAN paper and closely related handwriting synthesis baselines. FW-GAN is a one-shot offline handwriting synthesis framework introduced in “FW-GAN: Frequency-Driven Handwriting Synthesis with Wave-Modulated MLP Generator” (Khoa et al., 28 Aug 2025). It is designed to generate realistic, writer-consistent handwritten word images from a single reference example while preserving the requested text content. The method combines a Wave-Modulated MLP generator, a dual-discriminator design with a standard spatial discriminator and a high-frequency discriminator, and a Frequency Distribution Loss that aligns spectral statistics of real and generated handwriting (Khoa et al., 28 Aug 2025). Within the broader GAN literature, the name is specific: FW-GAN denotes a handwriting synthesis method rather than Few-Shot GAN, Fisher GAN, federated GAN learning, or First Order GAN formulations (Robb et al., 2020, Mroueh et al., 2017, Fan et al., 2020, Seward et al., 2018).
1. Definition and problem setting
FW-GAN addresses one-shot offline handwriting synthesis: given a single handwritten example image from a target writer and a new text string, it generates a new handwritten word image that should both spell the requested text correctly and preserve the style of that writer (Khoa et al., 28 Aug 2025). If a writer provides one handwritten word image , a style encoder extracts a style code , and the generator renders arbitrary query text in that style:
The paper notes that can either be sampled from a prior or extracted from the reference image by , but the core use case is single-reference style imitation (Khoa et al., 28 Aug 2025).
The stated motivation is that annotated handwriting data is expensive and scarce, especially for low-resource scripts and writer-diverse datasets. The paper emphasizes this for handwritten text recognition systems and highlights Vietnamese as a challenging case because diacritics and tonal marks add complexity (Khoa et al., 28 Aug 2025). It argues that prior handwriting synthesis methods have two major weaknesses: many use CNN-based generators with restricted receptive fields, and many largely ignore frequency-domain information, even though high-frequency details are important for sharp stroke edges, fine contours, and subtle style cues (Khoa et al., 28 Aug 2025).
This places FW-GAN in the style-conditioned handwriting generation literature alongside HiGAN, HiGAN+, HWT, and VATr, but with an explicit emphasis on frequency-aware modeling and supervision (Khoa et al., 28 Aug 2025).
2. Generator architecture and style conditioning
The generator is described as a hierarchical style- and text-conditioned image generator that takes a writer-specific latent style vector and a symbolic character sequence , and outputs a handwritten word image (Khoa et al., 28 Aug 2025). The conditioning process is specified as follows: the style vector is split into multiple segments; the first style segment is fused with the character input by elementwise multiplication; this fused representation is projected and reshaped to initialize a feature map
and the remaining style segments are injected into later generator stages through conditional batch normalization (Khoa et al., 28 Aug 2025).
The key architectural novelty is the use of WaveGBlocks with phase-aware Wave-MLP modules. The paper defines a token as a wave:
where 0 is the real-valued amplitude and 1 is a learned phase parameter (Khoa et al., 28 Aug 2025). Using Euler's formula, this becomes
2
These wave-like tokens are aggregated with a Token-FC operator,
3
and projected back to the real domain as
4
This mechanism is termed Phase-Aware Token Mixing (PATM) (Khoa et al., 28 Aug 2025).
The paper states that there are two PATM modules operating along the height and width dimensions. This is presented as relevant to handwriting because horizontal structure governs sequencing and spacing, while vertical structure affects ascenders, descenders, diacritics, and stroke trajectories (Khoa et al., 28 Aug 2025). Wave-MLP includes token mixing and channel MLP mixing, and the generator progressively upsamples and refines features through the hierarchy (Khoa et al., 28 Aug 2025).
Style preservation is not delegated to a single module. It arises from the style encoder 5, multi-stage style injection through conditional batch normalization, a writer identifier 6, and a style reconstruction loss (Khoa et al., 28 Aug 2025). A plausible implication is that the framework treats writer consistency as a distributed constraint rather than a single latent-code regularization term.
3. Frequency-aware supervision and discriminator design
FW-GAN uses a dual-discriminator architecture consisting of a standard spatial discriminator 7 and a high-frequency discriminator 8 (Khoa et al., 28 Aug 2025). The standard discriminator processes handwriting images through convolutional blocks with spectral normalization, batch normalization, and ReLU activations, followed by global averaging and a linear realism head (Khoa et al., 28 Aug 2025).
The second discriminator operates on high-frequency representations rather than raw images. The paper uses a 2D Haar wavelet transform, implemented using grouped convolutions with fixed Haar wavelet kernels, to obtain three detail subbands:
9
These correspond to low-high, high-low, and high-high components (Khoa et al., 28 Aug 2025). The Haar basis functions are given in a malformed equation in the manuscript, but the intended filters are described as the standard Haar low-pass and high-pass bases, and the 2D wavelet filters are formed by tensor products:
- 0
- 1
- 2
The three detail maps are aggregated as
3
and this aggregated high-frequency representation is passed through the same convolutional architecture as the standard discriminator to obtain 4 (Khoa et al., 28 Aug 2025).
The paper’s rationale is that many generator artifacts are subtle in pixel space but obvious in high-frequency space, and that handwriting realism depends on sharp stroke boundaries, edge continuity, fine line endings, small local oscillations from pen movement, and correct rendering of diacritics (Khoa et al., 28 Aug 2025). This suggests that the high-frequency branch is intended to bias adversarial learning toward the microstructure that standard spatial critics may underweight.
A second frequency-oriented component is the Frequency Distribution Loss (FDL). Rather than comparing images directly in pixel space, FDL compares distributions of feature frequencies extracted from a fixed feature network 5:
6
After applying the Discrete Fourier Transform along the spatial axes of the feature maps, the paper extracts amplitude sets 7 and phase sets 8, and defines
9
where 0 denotes Sliced Wasserstein Distance (Khoa et al., 28 Aug 2025). The paper does not provide the exact number of random projections or additional implementation details for the sliced Wasserstein computation.
4. Training objectives and optimization
FW-GAN is trained with adversarial, recognition, writer-identification, style, latent regularization, and frequency-domain objectives (Khoa et al., 28 Aug 2025). The standard adversarial loss is a hinge-loss GAN objective:
1
The high-frequency adversarial loss has the same form:
2
Both equations contain bracket issues in the paper text, but the intended hinge-loss structure is explicit (Khoa et al., 28 Aug 2025).
Textual correctness is enforced through a recognizer 3 trained on real handwriting with CTC loss,
4
and then used to supervise generated images with
5
Writer consistency is enforced by a writer classifier 6, trained on real data as
7
and applied to generated outputs as
8
The style reconstruction loss is
9
and the latent regularizer is
0
The full generator-and-encoder objective is
1
For the auxiliary modules, the paper summarizes
2
The reported implementation uses PyTorch, a single NVIDIA Tesla P100 GPU, Adam with learning rate 3, 4, linear learning-rate decay from epoch 35 onward, 5, and 6 (Khoa et al., 28 Aug 2025). The remaining loss weights are adaptively tuned using a gradient balancing strategy, though the explicit balancing formula is not given (Khoa et al., 28 Aug 2025).
5. Data, evaluation protocol, and empirical results
The paper evaluates FW-GAN on IAM and HANDS-VNOnDB (Khoa et al., 28 Aug 2025). IAM contains about 62,857 handwritten English word images from 500 writers, with a revised split of 339 writers for training and 161 for testing (Khoa et al., 28 Aug 2025). Images are standardized to height 32 pixels, width allocation is described as 16 pixels per character, images narrower than 128 are padded, and wider ones are resized to a fixed 7 representation (Khoa et al., 28 Aug 2025). HANDS-VNOnDB contains 7,296 handwritten text lines, over 480,000 strokes and 380,000 characters, with 106 writers for training and 34 unseen writers for testing (Khoa et al., 28 Aug 2025).
The evaluation protocol includes Test Set Replication and four synthesis scenarios: IV-S, IV-U, OOV-S, and OOV-U. For the latter four settings, each evaluation corpus contains about 25,000 generated word images (Khoa et al., 28 Aug 2025). Quality is measured using FID and KID, while downstream handwritten text recognition augmentation is assessed with CER, WER, and NED (Khoa et al., 28 Aug 2025).
The main IAM synthesis results are as follows:
| Method | FID | KID |
|---|---|---|
| HiGAN | 17.086 | 1.18 |
| HiGAN+ | 16.114 | 0.81 |
| HWT | 13.615 | 0.49 |
| VATr | 13.577 | 0.47 |
| FW-GAN | 6.530 | 0.20 |
FW-GAN also remains best across IV-S, IV-U, OOV-S, and OOV-U, with FID values of 24.92, 28.04, 25.46, and 28.80 respectively (Khoa et al., 28 Aug 2025). On HANDS-VNOnDB, the reported results are VATr 23.88/2.72, HiGAN 11.26/0.79, HWT 9.85/0.72, and FW-GAN 5.61/0.30 for FID/KID (Khoa et al., 28 Aug 2025).
For low-resource HTR augmentation on IAM, a baseline recognizer trained with 5000 real images achieves CER 12.25, NED 11.95, and WER 32.81. When 25,000 synthetic images are added, FW-GAN yields CER 10.23, NED 10.09, and WER 28.18, outperforming HiGAN, HiGAN+, HWT, and VATr in the reported comparison (Khoa et al., 28 Aug 2025). The paper therefore presents FW-GAN not only as an overview model with lower distributional distance metrics, but also as a generator of useful training data for downstream recognition.
The ablation study on IAM isolates four configurations:
| Configuration | FID | CER | NED | WER |
|---|---|---|---|---|
| Base BigGAN backbone | 15.94 | 10.57 | 10.40 | 29.34 |
| + FDL | 10.20 | 10.74 | 10.50 | 29.05 |
| + Wave-Modulated Generator | 6.89 | 10.32 | 10.12 | 28.81 |
| + High-Frequency Discriminator | 6.53 | 10.23 | 10.09 | 28.18 |
The paper interprets these results as showing that FDL sharply improves visual realism, the Wave-Modulated Generator provides the largest overall improvement, and the High-Frequency Discriminator yields a final refinement in both realism and recognizability (Khoa et al., 28 Aug 2025). Qualitatively, FW-GAN is reported to produce smoother stroke continuity, more accurate stroke thickness, better color fidelity, fewer blurry or distorted characters, better diacritic rendering in Vietnamese, and improved slant and spacing consistency (Khoa et al., 28 Aug 2025).
6. Position within the GAN literature and nomenclature
The name FW-GAN is specific to “Frequency-Driven Handwriting Synthesis with Wave-Modulated MLP Generator” (Khoa et al., 28 Aug 2025). It should be distinguished from several similarly suggestive acronyms in the GAN literature.
“Few-Shot Adaptation of Generative Adversarial Networks” introduces FSGAN rather than FW-GAN; it is a few-shot GAN adaptation method based on SVD of pretrained weights and adaptation of singular values in StyleGAN2 (Robb et al., 2020). “Fisher GAN” is an IPM-based GAN with a data-dependent second-order moment constraint on the critic; it does not define FW-GAN (Mroueh et al., 2017). “Federated Generative Adversarial Learning” is a foundational study of federated GAN training and likewise does not introduce a method named FW-GAN (Fan et al., 2020). “First Order Generative Adversarial Networks” defines FOGAN, based on a First Order Penalized Wasserstein Divergence, again under a distinct name and with a different theoretical objective (Seward et al., 2018). “An Attention-Guided and Wavelet-Constrained Generative Adversarial Network for Infrared and Visible Image Fusion” defines AWFGAN for image fusion, not FW-GAN (Liu et al., 2022). “Face Super-Resolution Through Wasserstein GANs” is a face super-resolution study using GAN, WGAN, and WGAN-GP objectives rather than a distinct FW-GAN model (Chen et al., 2017).
Within handwriting synthesis specifically, FW-GAN is positioned against HiGAN, HiGAN+, HWT, and VATr (Khoa et al., 28 Aug 2025). The paper presents its novelty as threefold: moving beyond CNN-heavy generators with a Wave-MLP-enhanced hierarchical generator, incorporating explicit frequency awareness through both architecture and loss design, and offering a lighter alternative to CNN-plus-Transformer hybrids while maintaining global and directional modeling capacity (Khoa et al., 28 Aug 2025). A plausible implication is that the framework’s main contribution lies not in any single module, but in making frequency information a first-class design principle across generator, discriminator, and objective.
7. Limitations and scope
The paper does not include a dedicated limitations section, but it does note or imply several constraints (Khoa et al., 28 Aug 2025). The writer identifier 8 is trained only on training-set writers and may not generalize to unseen authors. Performance likely depends on the quality of the single reference image, although the paper does not systematically evaluate this. Some architectural and implementation details are not fully disclosed, including exact generator stage counts, channel dimensions, batch size, total epochs, and certain preprocessing specifics for HANDS-VNOnDB (Khoa et al., 28 Aug 2025). Training complexity also remains substantial because the framework includes a generator, style encoder, writer identifier, recognizer, and two discriminators (Khoa et al., 28 Aug 2025).
These caveats matter when interpreting the reported gains. The empirical evidence strongly supports the value of the full frequency-aware design on English IAM and Vietnamese HANDS-VNOnDB (Khoa et al., 28 Aug 2025), but some details needed for exact reproduction are left unspecified. Even so, the paper’s central claim is clear: realistic writer-consistent handwriting depends not only on coarse character structure but also on frequency-domain properties such as sharp edges, stroke continuity, and subtle writer-specific microstructure, and FW-GAN is built to model those properties explicitly (Khoa et al., 28 Aug 2025).