meijieru / crnn.pytorch

Convolutional recurrent network in pytorch
MIT License
2.4k stars 657 forks source link

Training with lower and upper case alphabets, numbers #136

Open MounikaMaddula opened 6 years ago

MounikaMaddula commented 6 years ago

Hi

I am trying to train the model with lower & upper case alphabets plus numbers. Model seems to converge well with lower case alphabets and numbers but when I added upper case alphabets, model is not converging.

To give more context, I used opencv to generate dataset. Length of the words varied from 1 character to 15 characters. Learning rate - 0.001. Shuffled the dataset and I observed that without shuffling the dataset based on word length helped in quicker convergence compared to sorted dataset.

meijieru commented 6 years ago

What the difference between no shuffling and sorted dataset?

MounikaMaddula commented 6 years ago

Sry shuffled dataset gave quicker convergence compared to unshuffled dataset.

meijieru commented 6 years ago

First, you may have to acquiring more data as the problem is more difficult.

For the second question, it is natural as the assumption of IID data. Following paradigm may help

  1. train with shuffled dataset, all images are resized into same size
  2. then train without shuffling where images' ratio are kept
MounikaMaddula commented 6 years ago

Before loading to the model, I resize all the images to 100*32. With same parameters, model is working well with only lower case and digits. You think complexity of the model has to improved to make it work for upper case alphabets ?

Will try with 2nd point.

MounikaMaddula commented 6 years ago

I increased the training data significantly but still model is performing poor on separate classes for small and capital letters. I also tried changing the model parameters such as no. of hidden units of RNN, adding a CNN layer. But these didn't help. Can you suggest me what can be done to improve the accuracy?

ooooverflow commented 6 years ago

@MounikaMaddula I am trying to train with alphabets, numbers too,but the loss seems wrong. would you mind posting your code, thank you

haneSier commented 6 years ago

@ooooverflow you can refer to https://github.com/Sierkinhane/crnn_chinese_characters_rec