tobiasvanderwerff / full-page-handwriting-recognition

Unofficial implementation of the paper "Full Page Handwriting Recognition via Image to Sequence Extraction" by Singh et al. (2021).
MIT License
51 stars 5 forks source link

Form training issue. #7

Closed EmreVurgun closed 1 year ago

EmreVurgun commented 1 year ago

Hello it's me again, I am the one that was trying your project on our new turkish dataset. The result on lines was great we achieved similar results as the iam dataset but i am having traouble with form training.

I am training using 100% syntetic data which worked well for lines. I can use maximum 8 batch size for forms and am using accumulate_grad_batches 4 with effective batch size 32.

I did all the necessary things in the code to use our turkish dataset and the images seem good in the tensorboard. The structure of this dataset is very similar to iam too so i don't think the issue is in the dataset/dataloader. I was able to get the loss to decrease to 0.5 but the wer or cer metrics hardly dropped below 1 and the predictions are terrible.

Also when i load model and start training from there, the loss and other metrics start from some arbiterary numbers like im starting from scratch and don't get back down again. I don't know if i'm doing anything wrong. Maybe the loss need to get even lower to start seeing results. Hope you can help. Thank you.

tobiasvanderwerff commented 1 year ago

I have faced the same issue with training on forms. This is also stated at the top of the README.md. So unfortunately, I cannot help you much with this. Perhaps an option would be to stick to line-level training, in combination with some sort of automatic line extraction algorithm (if you want to apply it to forms). For example, you could try the A* algorithm: https://github.com/smeucci/LineSegm, or https://github.com/tobiasvanderwerff/LineSegm

EmreVurgun commented 1 year ago

Ah yes, i forgot that part in the readme. Sorry for the uncessary issue. I'll look at the segmentation methods and try some more hyper parameter tuning as well. If i find a solution, i'll let you know. Have a nice day/evening.