amzn / convolutional-handwriting-gan

ScrabbleGAN: Semi-Supervised Varying Length Handwritten Text Generation (CVPR20)
https://www.amazon.science/publications/scrabblegan-semi-supervised-varying-length-handwritten-text-generation
MIT License
264 stars 55 forks source link

About Fine tuning on numbers dataset #5

Closed JeanWU closed 4 years ago

JeanWU commented 4 years ago

Hi,

Thank you very much for the great work! We are trying to use the pre-trained model you provided (trained on IAM dataset) to fine-tune handwritten digit dataset (CVL Digit Strings). We are able to build the pipeline; however, the training results looks terrible... The loss of discriminator goes to zero in the very beginning and did not change during the training process. We have tried to modify 'num_critic_train', 'learning rate', and 'gb_alpha', yet doesn't see any improvement. Is there anything else you would suggest us to try? Or could you share your tips on tuning hyper parameter?

Thank you very much in advance!

sharonFogel commented 4 years ago

Hi, Did you try to train it directly on the cvl digit dataset instead of finetuning it? There aren't a lot of digits in the IAM dataset so the network doesn't learn to generate them well. Maybe that could be the problem - the network reaches a local minima where it doesn't generate digits well and it stays in the local minima when you finetune the network.

rlit commented 4 years ago

I am closing this issue, feel free to reopen and let us know if you still have questions

vijay1131 commented 3 years ago

@rlit @sharonFogel Could you please tell us steps to train on custom dataset.

sharonFogel commented 3 years ago

Hi vijay, You need to create an lmdb with the images and labels of you dataset. The images need to be with height 32. We recommend resizing the width also so that each character will take up approximately 16 pixels, but you can try to train with or without this resize. You can use the code in data/create_text_data.py and adjust it to the way the images and labels of your dataset are provided. Then, you need to add the alphabet in alphabets.py, and the dataset path, alphabet and lexicon in data/dataset_catalog.py. When training use the parameter --dataname Good luck! Sharon

vijay1131 commented 3 years ago

Thanks Sharon! Just one more thing How to get Lexicon for only numbers when running data/create_text_data.py

sharonFogel commented 3 years ago

This use case is not currently implemented in the code. You can change the code in createDict function to filter only strings which contain numbers.

renziver commented 3 years ago

Hi @sharonFogel would you suggest to combine the IAM and CVL Digit Strings data to create a single dataset for an improved numbers/digits generating model?