rezazad68 / BCDU-Net

BCDU-Net : Medical Image Segmentation
712 stars 264 forks source link

patch problem #26

Closed ljc1231 closed 3 years ago

ljc1231 commented 3 years ago

i use CT dataset, i found the label with value of 1 is less than 0.003 in whole CT picture ,the i use patch method. i have 250 CT pictures,and size is 256256 , the i divide into 6464 , 220 CT into 198006464 patch for train, and 30 CT into 27006464 for valadation i tried your D3model and Unet model, and i also tried binary_crossentropy loss, dice loss and GDL, first i use the learning rate 0.0001, but loss first declined but quickly increased in the first epoch the i decrease lr like 0.0005, 0.00001, but it didn't work. and i found your unet model only maxpooling 3 times, i tried the 32 layers Unet with 4 times maxpooling, i found lr 0.0001 for 256256 didn't work , i tried 0.00001 works. so i don't konw how to select the lr for pathes of 6464 CT, i think enitial lr 0.00001 is small ,can you help me ,thx!

ljc1231 commented 3 years ago

i have another question, when i use patch strategy, should i just keep the patch with label has lesion or should i keep the patch without lesion too?like the lesion only have 0.003 ratio in total picture, i have 400 patches in 1 picture, if i just keep patches with lesion, maybe the patches are very similar and the train will overfit. so, i need to keep 200 patches with lesion and 200 without lesion , to make sure the patches represent the whole characters in original picture, is that correct?

rezazad68 commented 3 years ago

Hello, thanks for your interest. Please note that adding patches that do not have the object of interest (lesion) not only helps the model to train well but also will decrease the performance. Only keep patches with a high lesion area. Another good point is that when you train with a patch-wise strategy try to choose a patch size that does not miss the main pattern of the object. Best

ljc1231 commented 3 years ago

thx!i am confused with you mentioned patch-wise, the original picture is256256, if i only keep 6464 patch which contains lesion, maybe the patch will only contaion a small part of the original picture. but you said i should keep the whole object, the whole object is the brain which stans 90% part of the picture. what should i do to keep this brain. my patch strategy is in every 256256, choose 100 patches which lesion is the center,100patches contion lesion, and 100 randomly select. but i am not sure it will contains the whole barain. and i found if i use model to predict the 2d 256256 slice which didn‘t have lesion, but it will predict some area that have false lesions. because i slice the 3d barin into 2d slice,i have to predict every 2d slice,maybe some 2d slice didn’t have lesions,if it predict many false lesions,dice will be very low,can you help me ,thx a lot!

发自我的iPhone

------------------ Original ------------------ From: Reza Azad <notifications@github.com> Date: Wed,Jan 6,2021 2:04 AM To: rezazad68/BCDU-Net <BCDU-Net@noreply.github.com> Cc: ljc1231 <563820431@qq.com>, Author <author@noreply.github.com> Subject: Re: [rezazad68/BCDU-Net] patch problem (#26)

Hello, thanks for your interest. Please note that adding patches that do not have the object of interest (lesion) not only helps the model to train well but also will decrease the performance. Only keep patches with a high lesion area. Another good point is that when you train with a patch-wise strategy try to choose a patch size that does not miss the main pattern of the object. Best

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.