EAST icon indicating copy to clipboard operation
EAST copied to clipboard

Train East.pytorch

Open liuxng opened this issue 6 years ago • 15 comments

Hello, I tried to train on ICDAR with your East's pytorch version, iterating nearly 8,000 epoch, but found that the effect is particularly bad. Is there any skill in training? I have tried other pytorch versions of East and found that the effect is not good. I can't find the reason until now. Can you give me some advice?

liuxng avatar Nov 21 '18 07:11 liuxng

I have the same issue. I trained it for about 1000 epochs and I get about 3% precision and 25% recall... It detects some text boxes correctly, but there is also a lot of boxes at random positions with no text.

janzd avatar Jan 14 '19 14:01 janzd

@kurapan I trained it for about 500 epochs , and got about 0.65 hmean,not reached 0.8 as paper show。I think you can raise the score map threshold , then the boxes at random positions with no text will disappear.

czj1989 avatar Mar 12 '19 07:03 czj1989

@kurapan I trained it for about 500 epochs , and got about 0.65 hmean,not reached 0.8 as paper show。I think you can raise the score map threshold , then the boxes at random positions with no text will disappear. HI , i trained it for 1000 epochs and just got 0.59hnean, can you tell me how do you set all thresholds. Thanks you so much!

huziling avatar Mar 15 '19 16:03 huziling

@kurapan @czj1989 @liuxng @huziling What about your loss? My loss keeps about 0.01 from the beginning and seems not to change. Is that normal?

Ocelot7777 avatar Mar 20 '19 02:03 Ocelot7777

@Ocelot7777 when I use one image as training set, I come across the same problem, but I will not come across the same problem when I change to use about 8k images, and have you add the pretrained resnet50.

jiangmiaotong avatar Mar 20 '19 13:03 jiangmiaotong

@Ocelot7777 when I use one image as training set, I come across the same problem, but I will not come across the same problem when I change to use about 8k images, and have you add the pretrained resnet50.

@jiangmiaotong I have added pretrained resnet50 and use ICDAR2015 (1000 imgs) for training. Then I changed the Loss Function and it seems to work as expect. Loss started at about 5.7 and 0.3 after 700 epochs.

Ocelot7777 avatar Mar 22 '19 01:03 Ocelot7777

@Ocelot7777 when I use one image as training set, I come across the same problem, but I will not come across the same problem when I change to use about 8k images, and have you add the pretrained resnet50.

@jiangmiaotong I have added pretrained resnet50 and use ICDAR2015 (1000 imgs) for training. Then I changed the Loss Function and it seems to work as expect. Loss started at about 5.7 and 0.3 after 700 epochs.

i did not change anything and loss started at about 0.2 and end at 0.001 after 600 epoch. it seems some things wrong. May you tell us what do you change about the loss function

huziling avatar Mar 22 '19 03:03 huziling

@Ocelot7777 when I use one image as training set, I come across the same problem, but I will not come across the same problem when I change to use about 8k images, and have you add the pretrained resnet50.

@jiangmiaotong I have added pretrained resnet50 and use ICDAR2015 (1000 imgs) for training. Then I changed the Loss Function and it seems to work as expect. Loss started at about 5.7 and 0.3 after 700 epochs.

i did not change anything and loss started at about 0.2 and end at 0.001 after 600 epoch. it seems some things wrong. May you tell us what do you change about the loss function

In loss.py: eps = 1e-5 # return torch.mean(L_g * y_true_cls * training_mask) + classification_loss return torch.sum(L_g * y_true_cls * training_mask)/(torch.nonzero(y_true_cls * training_mask).shape[0] + eps) + classification_loss

ICDAR2015 for 700 epochs, but seems not to get a good result till now. Maybe I should continue training.

Ocelot7777 avatar Mar 22 '19 04:03 Ocelot7777

@Ocelot7777 when I use one image as training set, I come across the same problem, but I will not come across the same problem when I change to use about 8k images, and have you add the pretrained resnet50.

@jiangmiaotong I have added pretrained resnet50 and use ICDAR2015 (1000 imgs) for training. Then I changed the Loss Function and it seems to work as expect. Loss started at about 5.7 and 0.3 after 700 epochs.

i did not change anything and loss started at about 0.2 and end at 0.001 after 600 epoch. it seems some things wrong. May you tell us what do you change about the loss function

In loss.py: eps = 1e-5

return torch.mean(L_g * y_true_cls * training_mask) + classification_loss

return torch.sum(L_g * y_true_cls * training_mask)/(torch.nonzero(y_true_cls * training_mask).shape[0] + eps) + classification_loss

ICDAR2015 for 700 epochs, but seems not to get a good result till now. Maybe I should continue training.

i got 0.70 heams ,better than the author @songdejia . but i can`t got 0.8 as the paper.may their are some different between the pytorch coede and tensorflow code.

huziling avatar Mar 22 '19 04:03 huziling

@huziling 0.7hmean also, and have you found the reason?

jiangmiaotong avatar Apr 08 '19 06:04 jiangmiaotong

@huziling 0.7hmean also, and have you found the reason?

我并没找到问题所在,但我怀疑可能是数据读取,模型初始化,以及pytorch和tensor flow的损失计算区别之类的原因。由于时间问题我并没有进一步寻找原因

huziling avatar Apr 09 '19 11:04 huziling

Here is the loss function I used:

In loss.py: eps = 1e-5

return torch.mean(L_g * y_true_cls * training_mask) + classification_loss

return torch.sum(L_g * y_true_cls * training_mask)/(torch.nonzero(y_true_cls * training_mask).shape[0] + eps) + classification_loss

After 1000 epochs. My loss decreased from 13 to 0.0009. However, there is no bounding box from the prediction results of the model of 1000 epochs. Has anyone met the same problem? By the way, I used Win10 to run the code.

wqtwjt1996 avatar Jun 27 '19 16:06 wqtwjt1996

@kurapan I trained it for about 500 epochs , and got about 0.65 hmean,not reached 0.8 as paper show。I think you can raise the score map threshold , then the boxes at random positions with no text will disappear.

what is python version ? I use python3.7 but the loss in not normal

hustzxl avatar Oct 30 '19 03:10 hustzxl

@huziling @jiangmiaotong did you change anything in code to get to 0.7 hmean?

niloofarAzari avatar Jan 02 '20 14:01 niloofarAzari

@huziling @jiangmiaotong did you change anything in code to get to 0.7 hmean?

i can't remember all details cause it's long time ago. i may change some thresholds in eval function beacause those are some differents with tensorflow version

huziling avatar Jan 06 '20 12:01 huziling