| --- |
| license: mit |
| --- |
| |
| # FW-GAN |
|
|
| **FW-GAN** is a frequency-aware, one-shot handwriting synthesis framework designed to produce realistic and writer-consistent handwritten text from a single reference public at [Expert Systems with Applications](https://www.sciencedirect.com/science/article/pii/S095741742503790X) |
| Training code is released on [GitHub](https://github.com/DAIR-Group/FW-GAN). |
|
|
| **[FW-GAN: Frequency-Driven Handwriting Synthesis with Wave-Modulated MLP Generator](https://www.sciencedirect.com/science/article/pii/S095741742503790X)** |
| Huynh Tong Dang Khoa, Dang Hoai Nam, Vo Nguyen Le Duy |
|
|
|  |
|
|
| ## Installation |
|
|
| ```console |
| conda create --name fwgan python=3.10 |
| conda activate fwgan |
| pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126 |
| git clone https://github.com/DAIR-Group/FW-GAN.git && cd FW-GAN |
| pip install -r requirements.txt |
| ``` |
|
|
| We provide our pretrained model weights and datasets here. For training, please download the files the files `train.hdf5` and `test.hdf5` and place them into the `data` folder. For quick evaluation, you can also download the pretrained model `FW-GAN.pth` and place it under `/data/weights/FW-GAN.pth` on the code released on [GitHub](https://github.com/DAIR-Group/FW-GAN). |
|
|
| ## Training |
|
|
| ```console |
| python train.py --config ./configs/fw_gan_iam.yml |
| ``` |
|
|
|
|
| ## Generate Handwtitten Text Images |
|
|
| To generate all samples for FID evaluation you can use the following script: |
|
|
| ```console |
| python generate.py --config ./configs/fw_gan_iam.yml |
| ``` |
|
|
| ## Handwriting synthesis and reconstruction results on IAM dataset |
|
|
|  |
|
|
|  |
|
|
| ## Handwriting synthesis on HANDS-VNOnDB dataset |
|  |
|
|
| ### Implementation details |
| This work is partially based on the code released for [HiGAN](https://github.com/ganji15/HiGAN) |
|
|
| ## Citation |
| If you find this work useful, please cite our paper: |
|
|
| ```bibtex |
| @article{TONGDANGKHOA2026130175, |
| title = {FW-GAN: Frequency-driven handwriting synthesis with wave-modulated MLP generator}, |
| journal = {Expert Systems with Applications}, |
| volume = {299}, |
| pages = {130175}, |
| year = {2026}, |
| issn = {0957-4174}, |
| doi = {https://doi.org/10.1016/j.eswa.2025.130175}, |
| url = {https://www.sciencedirect.com/science/article/pii/S095741742503790X}, |
| author = {Huynh {Tong Dang Khoa} and Dang {Hoai Nam} and Vo {Nguyen Le Duy}}, |
| keywords = {Handwritten text synthesis, Wavelet transform, One-shot learning, Vietnamese handwriting, Synthetic data, Generative adversarial networks}, |
| } |