Skip to content

SpiS-GAN: Spiral-Modulated Handwriting Synthesis with Star Operation

Source: arXiv:2607.06949 · Published 2026-07-08 · By Nguyen Duy Hieu, Dang Hoai Nam, Pham Hoang Giap, Quang Huu Hieu, Vo Nguyen Le Duy

TL;DR

This paper addresses the challenge of generating high-quality synthetic handwriting images to support training handwriting recognition (HTR) systems, especially for low-resource languages like Vietnamese. Existing handwriting synthesis models suffer from fixed receptive fields that inadequately capture cursive stroke dynamics, CNN-based discriminators that lose fine structural details due to downsampling, and lack explicit edge constraints leading to blurred strokes. SpiS-GAN introduces a novel GAN framework with a spiral-modulated design to better model complex handwriting trajectories and preserve style from a single reference. The generator combines a Modulated Elliptical Spiral Fully Connected (MESpiralFC) layer with a star operation to capture nonlinear spatial interactions and stroke continuity, while the discriminator uses a spiral-modulated MLP architecture with multi-domain feature fusion to detect subtle defects. An additional Sobel-Regularized Edge Reconstruction Loss explicitly enforces sharp stroke boundaries. Evaluations on English and Vietnamese handwriting datasets demonstrate that SpiS-GAN produces significantly more authentic handwriting images that preserve style and reduce downstream HTR error rates compared to prior state-of-the-art.

Key findings

  • SpiS-GAN achieves higher image fidelity and style preservation on English and Vietnamese handwritten datasets than prior GAN-based synthesis models.
  • The Modulated Elliptical SpiralFC with star operation enables efficient modeling of fluid, cursive stroke trajectories beyond fixed-grid receptive fields.
  • The spiral-modulated discriminator combining spatial, spiral, and spectral pathways detects broken stroke connections and shape anomalies missed by CNN discriminators.
  • Sobel-Regularized Edge Reconstruction Loss leads to clearer, sharper stroke boundaries, reducing blurring common in earlier approaches.
  • Experiments show SpiS-GAN-generated samples improve downstream handwriting recognition accuracy when augmenting limited training data, lowering error rates significantly (exact metrics not specified).
  • Star-Spiral Blocks with cross-depthwise convolutions and spectral gating enable richer feature interactions with manageable computation.
  • The dual discriminator framework combines a conventional CNN spatial discriminator with the proposed spiral-modulated MLP network for complementary flaw detection.

Threat model

The adversary is not a malicious agent but the inherent challenge of accurately modeling complex handwriting style variations from a single reference image, including diverse stroke trajectories and high-frequency edge details. The model assumes the reference image and target text are available, and adversaries cannot manipulate style features or text input.

Methodology — deep read

The authors define the threat model as one-shot handwriting synthesis: given a single reference handwritten word image x from writer w, they want to generate new handwritten text images ˆxk preserving w's unique style z encoded as vector features. During training, style vectors z are sampled from either a Gaussian prior or extracted from x via a style encoder E. The target text consists of sequences of characters represented as one-hot embeddings combined via element-wise multiplication with style vectors.

The core generator is hierarchical and style-conditioned, composed of Star-Spiral Blocks (SSB). Each SSB integrates a novel Modulated Elliptical SpiralFC (MESpiralFC) — a deformable fully connected layer sampling with elliptical spiral offsets whose radius is modulated by a triangular function — combined with the star operation (elementwise multiplication of feature projections) to capture rich nonlinear feature interactions. This design captures the natural left-to-right and curved stroke trajectories better than prior circular spiral or grid-based offset approaches. The generator progressively upsamples latent feature maps conditioned on character content and style embedding segments injected via conditional batch normalization.

The discriminator architecture is dual: a standard CNN-based spatial discriminator processes images at multiple scales but suffers detail loss due to downsampling; a novel spiral-modulated discriminator replaces standard convolutional blocks with SP-MLP blocks that fuse parallel spatial, elliptical spiral, and spectral branches modulated with learned gates to detect subtle geometric and frequency domain anomalies. This discriminator better detects broken stroke connections and shape defects. The spectral gating branch applies FFT-based scaling for high-frequency detail evaluation.

Auxiliary components include a recognizer trained only on authentic samples to enforce character correctness, a style encoder compressing writer features, and a writer identifier network to maintain style consistency during training. The generator and discriminator are optimized via adversarial training combined with auxiliary losses including Frequency Distribution Loss (FDL) to align spectral distributions globally and the novel Sobel-Regularized Edge Reconstruction Loss (SELoss) to explicitly supervise stroke edges with directional gradients.

Training uses standard GAN min-max objectives with progressive upsampling, batch normalization, and spectral normalization for stability. The authors report training details such as batch sizes, epochs, optimizer types, and hyperparameter values elsewhere or are unclear. Evaluation protocols include quantitative comparisons on English and Vietnamese handwritten datasets, ablations on generator and discriminator components, qualitative style preservation visualizations, and measuring downstream HTR error reductions when augmenting training data with generated samples. Cross-lingual transfer and one-shot style conditioning are demonstrated. Code and pretrained weights are released publicly to enable reproducibility.

Technical innovations

  • Modulated Elliptical SpiralFC layer with triangular amplitude modulation replaces circular spiral offsets to better capture natural handwriting stroke directions and curved trajectories.
  • Integration of star operation in Star-Spiral Blocks to implicitly expand feature dimensions via element-wise multiplication, enabling rich higher-order spatial and style feature interactions at modest computational cost.
  • Dual discriminator combining a conventional CNN spatial discriminator with a spiral-modulated MLP-based discriminator employing spatial, spiral, and spectral feature branches gated independently for enhanced flaw detection.
  • Introduction of Sobel-Regularized Edge Reconstruction Loss enforcing directional edge constraints during synthesis to prevent blurred strokes and improve sharpness.

Datasets

  • English handwriting dataset — size unspecified — public
  • Vietnamese handwriting dataset — size unspecified — public or internal (unclear)

Baselines vs proposed

  • HiGAN baseline + BigGAN-style generator: baseline FID and recognition error (values unspecified) vs SpiS-GAN: significantly better FID and lower error rates on English and Vietnamese datasets
  • FW-GAN [35] with WaveMLP modules: outperformed by SpiS-GAN in stroke continuity and style preservation as shown in qualitative and quantitative comparisons
  • CNN-based discriminator alone: detected fewer local defects vs spiral-modulated discriminator that improved flaw detection accuracy

Figures from the paper

Figures are reproduced from the source paper for academic discussion. Original copyright: the paper authors. See arXiv:2607.06949.

Fig 1

Fig 1: Overview of the SpiS-GAN architecture. The input text is converted to one-hot

Fig 2

Fig 2: (a)–(b) Grid-based; (c) Original SpiralFC; (d) Elliptical SpiralFC (ours).

Fig 3

Fig 3: Overview of the SpiS-GAN hierarchical generator featuring Star-Spiral Blocks

Fig 4

Fig 4: Detailed architecture of Star-Spiral Block

Fig 5

Fig 5: Architecture of the original StarBlock from StarNet [45].

Fig 6

Fig 6: Illustration of the Dual Discriminator Architecture.

Fig 7

Fig 7: Detailed architecture of SP-MLP Block.

Fig 8

Fig 8: Visualization of Sobel edge magnitude maps.

Limitations

  • Paper does not specify exact dataset sizes or splits used for English and Vietnamese handwriting, limiting reproducibility.
  • Downstream HTR improvement metrics are qualitative or relative; no absolute error rates or statistical significance reported.
  • Adversarial robustness of the model to targeted attacks or domain shifts is not evaluated.
  • Computational cost and training time details for SpiS-GAN compared to prior models are not fully disclosed.
  • Dependence on style encoder quality and sensitivity to noisy reference samples is not analyzed.

Open questions / follow-ons

  • Can the spiral-modulated synthesis framework generalize effectively to many other handwriting languages with radically different stroke systems beyond English and Vietnamese?
  • How robust is SpiS-GAN to noisy, degraded, or partial reference style samples and can it recover styles from few-shot inputs beyond one-shot?
  • What are the exact tradeoffs between computational efficiency, synthesis quality, and discriminator design complexity in large-scale training?
  • Could the spiral-based operator ideas be combined with diffusion models for higher fidelity handwriting generation?

Why it matters for bot defense

Bot-defense and CAPTCHA systems that rely on handwriting recognition or synthetic handwriting generation could benefit from SpiS-GAN's improved ability to produce authentic, complex handwriting styles from limited references. Enhanced synthetic data generation could augment training sets for handwriting-based CAPTCHA analytics, improving robustness against machine learning-based bots. The spiral-modulated discriminator architecture, which better detects fine-grained flaws in handwriting strokes without aggressive downsampling, may inspire more sensitive bot-detection classifiers that distinguish real human handwriting from forged or synthetic renderings. Additionally, the Sobel-regularized loss enforcing sharp edges could help generate visually convincing handwritten CAPTCHAs resistant to smoothing artifacts exploitable by bots. However, real-time deployment considerations must weigh SpiS-GAN's complexity against latency constraints common in CAPTCHA systems.

Cite

bibtex
@article{arxiv2607_06949,
  title={ SpiS-GAN: Spiral-Modulated Handwriting Synthesis with Star Operation },
  author={ Nguyen Duy Hieu and Dang Hoai Nam and Pham Hoang Giap and Quang Huu Hieu and Vo Nguyen Le Duy },
  journal={arXiv preprint arXiv:2607.06949},
  year={ 2026 },
  url={https://arxiv.org/abs/2607.06949}
}

Read the full paper

Articles are CC BY 4.0 — feel free to quote with attribution