LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.66k stars 594 forks source link

Low performance when i train #49

Closed tranquangchung closed 1 year ago

tranquangchung commented 4 years ago

Thanks for sharing useful project I have a question about the score in this repo I had prepared the data ISIC same yours.

1815 images were used for training, 259 for validation and 520 for testing models

When I train your model with the data ISIC, the result is very bad.

  1. U_Net Epoch [148/150], Loss: 2.7109, [Training] Acc: 0.0993, SE: 0.0212, SP: 0.0800, PC: 0.0212, F1: 0.0212, JS: 0.1003, DC: 0.1026 Decay learning rate to lr: 9.719919173243618e-06. [Validation] Acc: 0.0961, SE: 0.0219, SP: 0.0828, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1113 Epoch [149/150], Loss: 2.8651, [Training] Acc: 0.0994, SE: 0.0212, SP: 0.0800, PC: 0.0212, F1: 0.0212, JS: 0.1003, DC: 0.1026 Decay learning rate to lr: 4.8599595866217745e-06. [Validation] Acc: 0.0961, SE: 0.0219, SP: 0.0827, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1114
  2. AttU_Net Epoch [99/100], Loss: 9.7082, [Training] Acc: 0.1229, SE: 0.0270, SP: 0.1002, PC: 0.0270, F1: 0.0270, JS: 0.1251, DC: 0.1307 Decay learning rate to lr: 6.125101680409697e-06. [Validation] Acc: 0.1219, SE: 0.0288, SP: 0.1041, PC: 0.0288, F1: 0.0288, JS: 0.1274, DC: 0.1410 Epoch [100/100], Loss: 10.5515, [Training] Acc: 0.1227, SE: 0.0271, SP: 0.1003, PC: 0.0271, F1: 0.0271, JS: 0.1251, DC: 0.1309 Decay learning rate to lr: 9.147955830346444e-20. [Validation] Acc: 0.1221, SE: 0.0286, SP: 0.1042, PC: 0.0286, F1: 0.0286, JS: 0.1274, DC: 0.1406
  3. R2AttU_Net Epoch [99/100], Loss: 89.6683, [Training] Acc: 0.4795, SE: 0.1198, SP: 0.4012, PC: 0.1198, F1: 0.1198, JS: 0.5003, DC: 0.5545 [Validation] Acc: 0.4692, SE: 0.1067, SP: 0.4279, PC: 0.1067, F1: 0.1067, JS: 0.5019, DC: 0.5861 Epoch [100/100], Loss: 87.9917, [Training] Acc: 0.4799, SE: 0.1187, SP: 0.4019, PC: 0.1187, F1: 0.1187, JS: 0.5003, DC: 0.5547 [Validation] Acc: 0.4704, SE: 0.1167, SP: 0.4168, PC: 0.1167, F1: 0.1167, JS: 0.5019, DC: 0.5846

@LeeJunHyun can you solve this for me. Thanks.

wlj567 commented 2 years ago

Thanks for sharing useful project I have a question about the score in this repo I had prepared the data ISIC same yours.

1815 images were used for training, 259 for validation and 520 for testing models

When I train your model with the data ISIC, the result is very bad.

  1. U_Net Epoch [148/150], Loss: 2.7109, [Training] Acc: 0.0993, SE: 0.0212, SP: 0.0800, PC: 0.0212, F1: 0.0212, JS: 0.1003, DC: 0.1026 Decay learning rate to lr: 9.719919173243618e-06. [Validation] Acc: 0.0961, SE: 0.0219, SP: 0.0828, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1113 Epoch [149/150], Loss: 2.8651, [Training] Acc: 0.0994, SE: 0.0212, SP: 0.0800, PC: 0.0212, F1: 0.0212, JS: 0.1003, DC: 0.1026 Decay learning rate to lr: 4.8599595866217745e-06. [Validation] Acc: 0.0961, SE: 0.0219, SP: 0.0827, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1114
  2. AttU_Net Epoch [99/100], Loss: 9.7082, [Training] Acc: 0.1229, SE: 0.0270, SP: 0.1002, PC: 0.0270, F1: 0.0270, JS: 0.1251, DC: 0.1307 Decay learning rate to lr: 6.125101680409697e-06. [Validation] Acc: 0.1219, SE: 0.0288, SP: 0.1041, PC: 0.0288, F1: 0.0288, JS: 0.1274, DC: 0.1410 Epoch [100/100], Loss: 10.5515, [Training] Acc: 0.1227, SE: 0.0271, SP: 0.1003, PC: 0.0271, F1: 0.0271, JS: 0.1251, DC: 0.1309 Decay learning rate to lr: 9.147955830346444e-20. [Validation] Acc: 0.1221, SE: 0.0286, SP: 0.1042, PC: 0.0286, F1: 0.0286, JS: 0.1274, DC: 0.1406
  3. R2AttU_Net Epoch [99/100], Loss: 89.6683, [Training] Acc: 0.4795, SE: 0.1198, SP: 0.4012, PC: 0.1198, F1: 0.1198, JS: 0.5003, DC: 0.5545 [Validation] Acc: 0.4692, SE: 0.1067, SP: 0.4279, PC: 0.1067, F1: 0.1067, JS: 0.5019, DC: 0.5861 Epoch [100/100], Loss: 87.9917, [Training] Acc: 0.4799, SE: 0.1187, SP: 0.4019, PC: 0.1187, F1: 0.1187, JS: 0.5003, DC: 0.5547 [Validation] Acc: 0.4704, SE: 0.1167, SP: 0.4168, PC: 0.1167, F1: 0.1167, JS: 0.5019, DC: 0.5846

@LeeJunHyun can you solve this for me. Thanks.

Hello, I have the same problem. Have you solved it before?

gakkiP commented 2 years ago

感谢分享有用的项目我有一个关于这个 repo 中的分数的问题,我准备了与你相同的数据 ISIC。

1815 张图像用于训练,259 张用于验证,520 张用于测试模型

当我使用数据 ISIC 训练您的模型时,结果非常糟糕。

  1. U_Net Epoch [148/150], Loss: 2.7109, [Training] Acc: 0.0993, SE: 0.0212, SP: 0.0800, PC: 0.0212, F1: 0.0212, JS: 0.1003, DC: 0.1026 Decay learning rate to lr: 9.16991917324 -06。 [验证] Acc: 0.0961, SE: 0.0219, SP: 0.0828, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1113 Epoch [149/150], Loss: 2.8651, [Training] Acc: 0.0994, SE: 0.0212,SP:0.0800,PC:0.0212,F1:0.0212,JS:0.1003,DC:0.1026 衰减学习率到 lr:4.8599595866217745e-06。 [验证] Acc: 0.0961, SE: 0.0219, SP: 0.0827, PC: 0.0219, F1: 0.0219, JS: 0.1004, DC: 0.1114
  2. AttU_Net Epoch [99/100], Loss: 9.7082, [Training] Acc: 0.1229, SE: 0.0270, SP: 0.1002, PC: 0.0270, F1: 0.0270, JS: 0.1251, DC: 0.1307 Decay learning rate to lr: 6.16971016804 -06。 [验证] Acc: 0.1219, SE: 0.0288, SP: 0.1041, PC: 0.0288, F1: 0.0288, JS: 0.1274, DC: 0.1410 Epoch [100/100], Loss: 10.5515, [Training] Acc: 0.1227, SE: 0.0271,SP:0.1003,PC:0.0271,F1:0.0271,JS:0.1251,DC:0.1309 衰减学习率到 lr:9.147955830346444e-20。 [验证] Acc: 0.1221, SE: 0.0286, SP: 0.1042, PC: 0.0286, F1: 0.0286, JS: 0.1274, DC: 0.1406
  3. R2AttU_Net Epoch [99/100], Loss: 89.6683, [Training] Acc: 0.4795, SE: 0.1198, SP: 0.4012, PC: 0.1198, F1: 0.1198, JS: 0.5003, DC: 0.5545 [Validation] Acc: 0.4692, SE : 0.1067, SP: 0.4279, PC: 0.1067, F1: 0.1067, JS: 0.5019, DC: 0.5861 Epoch [100/100], Loss: 87.9917, [Training] Acc: 0.4799, SE: 0.1187, SP: 0.4019, PC: 0.1187, F1: 0.1187, JS: 0.5003, DC: 0.5547 [验证] Acc: 0.4704, SE: 0.1167, SP: 0.4168, PC: 0.1167, F1: 0.1167, JS: 0.5019, DC: 0.5846

@LeeJunHyun你能帮我解决这个问题吗?谢谢。

你好,我也有同样的问题。你以前解决过吗?

Please have you solved this problem?

summerflowernb commented 2 years ago

It should be possible to modify the 'length' variable in the solver.py file, and its accumulation should be length=length+1

YonghuiTAN22 commented 1 year ago

It should be possible to modify the 'length' variable in the solver.py file, and its accumulation should be length=length+1

Is it because it is stacked once each time, so each time +1 and then averaged?