faustomilletari / VNet

GNU General Public License v3.0
286 stars 122 forks source link

Clarification about schematic and Receptive field calculation? #24

Closed sagarhukkire closed 7 years ago

sagarhukkire commented 7 years ago

Hi @faustomilletari

I was going through schematics and pototxt file. Please correct me if I am wrong

Input volume 128 x 128 x 64 with 1 channel

1) VNet uses 16 convolution filter with 5 x 5 x 5 , to get original volume there is padding of zeros with size 2 ,totally fine . Then sub sampling of 2 x 2 x 2 ,then volume size to next stage is 64 x 64 x 32

2) Here VNet uses 32 channels again same size of kernel in figure you showed two convolution layer are they 32 channels with kernel size 5 x 5 x 5, 2 times convolution layer ? screenshot from 2017-03-31 08-56-48

3) if it is then for next stage 64 channels for 3 times right?

now important thing how you calculate receptive size , you can explain one of them so I will clear myself remaining. I am confused do I consider kernel size or theoretical size 3 x 3 x 3 screenshot from 2017-03-31 08-58-42

Thanks for VNet its indeed great working !!

Sagar

wxde commented 7 years ago

hi Sagar how do you make the dataset sed you network?

faustomilletari commented 7 years ago

in the paper i must have forgotten to update the caption of that table…

On Mar 31, 2017, at 3:00 AM, sagarax009 notifications@github.com wrote:

Hi @faustomilletari https://github.com/faustomilletari I was going through schematics and pototxt file. Please correct me if I am wrong

Input volume 12812864 with 1 channel

VNet uses 16 convolution filter with 555 , to get original volume there is padding of zeros with size 2 ,totally fine . Then sub sampling of 222 ,then volume size to next stage is 646432

Here VNet uses 32 channels again same size of kernel in figure you showed two convolution layer are they 32 channels with kernel size 555, 2 times convolution layer ? https://cloud.githubusercontent.com/assets/20017611/24539702/093036ba-15f0-11e7-9a18-b68800b9401a.png if it is then for next stage 64 channels for 3 times right?

now important thing how you calculate receptive size , you can explain one of them so I will clear myself remaining. I am confused do I consider kernel size or theoretical size 333 https://cloud.githubusercontent.com/assets/20017611/24539757/45a82530-15f0-11e7-8879-f0cc1a26bcac.png Thanks for VNet its indeed great working !!

Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvpA5maBiFROuzHJYCXLQ4JwqqstDks5rrKSAgaJpZM4MvSyF.

sagarhukkire commented 7 years ago

Hi Fasto

Can you please send me the link so I can figure out and send me bibtex for Vnet , so I can cite it in my report.

Thanks and Regards Sagar Hukkire On Apr 8, 2017 10:58 PM, "Fausto Milletari" notifications@github.com wrote:

in the paper i must have forgotten to update the caption of that table…

On Mar 31, 2017, at 3:00 AM, sagarax009 notifications@github.com wrote:

Hi @faustomilletari https://github.com/faustomilletari I was going through schematics and pototxt file. Please correct me if I am wrong

Input volume 12812864 with 1 channel

VNet uses 16 convolution filter with 555 , to get original volume there is padding of zeros with size 2 ,totally fine . Then sub sampling of 222 ,then volume size to next stage is 646432

Here VNet uses 32 channels again same size of kernel in figure you showed two convolution layer are they 32 channels with kernel size 555, 2 times convolution layer ? https://cloud.githubusercontent.com/assets/20017611/24539702/093036ba- 15f0-11e7-9a18-b68800b9401a.png if it is then for next stage 64 channels for 3 times right?

now important thing how you calculate receptive size , you can explain one of them so I will clear myself remaining. I am confused do I consider kernel size or theoretical size 333 https://cloud.githubusercontent.com/assets/20017611/24539757/45a82530- 15f0-11e7-8879-f0cc1a26bcac.png Thanks for VNet its indeed great working !!

Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ faustomilletari/VNet/issues/24, or mute the thread https://github.com/ notifications/unsubscribe-auth/AMtsvpA5maBiFROuzHJYCXLQ4Jwqqs tDks5rrKSAgaJpZM4MvSyF.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292745169, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxyzzqeShHjlyxr-UY5cJCaLd8Yh1Kks5rt_TzgaJpZM4MvSyF .

faustomilletari commented 7 years ago

Hello,

the link to what??

the bibtex is here: @inproceedings{milletari2016v, title={V-net: Fully convolutional neural networks for volumetric medical image segmentation}, author={Milletari, Fausto and Navab, Nassir and Ahmadi, Seyed-Ahmad}, booktitle={3D Vision (3DV), 2016 Fourth International Conference on}, pages={565--571}, year={2016}, organization={IEEE} }

Regards, Fausto

On Apr 8, 2017, at 6:36 PM, Sagar Hukkire notifications@github.com wrote:

Hi Fasto

Can you please send me the link so I can figure out and send me bibtex for Vnet , so I can cite it in my report.

Thanks and Regards Sagar Hukkire On Apr 8, 2017 10:58 PM, "Fausto Milletari" notifications@github.com wrote:

in the paper i must have forgotten to update the caption of that table…

On Mar 31, 2017, at 3:00 AM, sagarax009 notifications@github.com wrote:

Hi @faustomilletari https://github.com/faustomilletari I was going through schematics and pototxt file. Please correct me if I am wrong

Input volume 12812864 with 1 channel

VNet uses 16 convolution filter with 555 , to get original volume there is padding of zeros with size 2 ,totally fine . Then sub sampling of 222 ,then volume size to next stage is 646432

Here VNet uses 32 channels again same size of kernel in figure you showed two convolution layer are they 32 channels with kernel size 555, 2 times convolution layer ? https://cloud.githubusercontent.com/assets/20017611/24539702/093036ba- 15f0-11e7-9a18-b68800b9401a.png if it is then for next stage 64 channels for 3 times right?

now important thing how you calculate receptive size , you can explain one of them so I will clear myself remaining. I am confused do I consider kernel size or theoretical size 333 https://cloud.githubusercontent.com/assets/20017611/24539757/45a82530- 15f0-11e7-8879-f0cc1a26bcac.png Thanks for VNet its indeed great working !!

Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ faustomilletari/VNet/issues/24, or mute the thread https://github.com/ notifications/unsubscribe-auth/AMtsvpA5maBiFROuzHJYCXLQ4Jwqqs tDks5rrKSAgaJpZM4MvSyF.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292745169, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxyzzqeShHjlyxr-UY5cJCaLd8Yh1Kks5rt_TzgaJpZM4MvSyF .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292750434, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvuEna4gB15Ibpa5ZGJ6t4fZzeL91ks5ruAvagaJpZM4MvSyF.

sagarhukkire commented 7 years ago

@faustomilletari

link for receptive field calculation ? I followed many articles like dilated convolution and all but no way I can get same numbers as your papers?

So it will be great if you just give me one explanation at any stage then I can figure out remaining calculation for receptive field

Thanks Sagar

sagarhukkire commented 7 years ago

@wxde

  1. Which kind of images you have ,I mean medical or something else?

1) If medical then I recommend you to use MITK or any tool(MITK ) is great, save image and label (its image with area of body organ) 2) Either save it in .mhd format as Fausto said, since VNET uses sitk ,so either .mhd or .nrrd(i work with .nrrd) both are fine

all the best

faustomilletari commented 7 years ago

you have to use a kernel size 5x5x5. then when there is the downsampling the behavior is similar to a pooling 2x2x2.

in the up sampling path, the deconvolutions also contribute to increase the receptive field!

I calculated it once by hand and another time with matlab, through the package matconvnet.

On Apr 8, 2017, at 8:00 PM, Sagar Hukkire notifications@github.com wrote:

@faustomilletari https://github.com/faustomilletari link for receptive field calculation ? I followed many articles like dilated convolution and all but no way I can get same numbers as your papers?

So it will be great at one layer how you are able to get those dimension for receptive field

Thanks Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292753933, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvomaNmVYZey8Cpk5p5ErAl9Y5CS5ks5ruB-bgaJpZM4MvSyF.

wxde commented 7 years ago

@sagarax009 my 3D images is medical dataset , how to sent the .mhd farmat to vnet model? from xu

sagarhukkire commented 7 years ago

@wxde

I guess,I got your problem Follow the steps 1) hope you have installed 3D caffe for Vnet ( do it till make runtest) 2) If you go to main.py you will see path to train,test,result,snapshot words ; just create folders acoording For example :/home / Sagar/ Train 3) then Vnet.py give path to caffe. You can use Import sys Sys.path.insert (0,"your caffe path ") 4) if you have made folder structure above and data properly placed then pass system parameters like train or test as per your need (At end of main.py you can see that) Or simply Google it, its easy you will find it 5) there you are, your network will start running

Hope this helps

Thanks and Regards Sagar Hukkire On Apr 9, 2017 4:14 AM, "wxde" notifications@github.com wrote:

@sagarax009 https://github.com/sagarax009 my 3D images is medical dataset , how to sent the .mhd farmat to vnet model? from xu

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292758896, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxy58IhdM7cw03HggMYFG4NOxl2ikmks5ruD8UgaJpZM4MvSyF .

wxde commented 7 years ago

@sagarax009 I am glad to heard from you ,your reply is so detail , thank you very much from wxde

sagarhukkire commented 7 years ago

@fausto

I tried to calculate by hand correct if I am wrong 1) stage 1 , simply kernel size = filter size i.e. 5x5x5 2) Stage 2, stacking of two convolution layer with one down sampling Receptive field For example X direction (5+5-1) = 9 ( m+m-rank of filter)then there down sampling by 2 with stride 2 , how result is 22 here then.

Thanks and Regards Sagar Hukkire you have to use a kernel size 5x5x5. then when there is the downsampling the behavior is similar to a pooling 2x2x2.

in the up sampling path, the deconvolutions also contribute to increase the receptive field!

I calculated it once by hand and another time with matlab, through the package matconvnet.

On Apr 8, 2017, at 8:00 PM, Sagar Hukkire notifications@github.com wrote:

@faustomilletari https://github.com/faustomilletari link for receptive field calculation ? I followed many articles like dilated convolution and all but no way I can get same numbers as your papers?

So it will be great at one layer how you are able to get those dimension for receptive field

Thanks Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ faustomilletari/VNet/issues/24#issuecomment-292753933, or mute the thread < https://github.com/notifications/unsubscribe-auth/ AMtsvomaNmVYZey8Cpk5p5ErAl9Y5CS5ks5ruB-bgaJpZM4MvSyF>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292754347, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxy0KY3CbiTzHQRonDI9Mb3l6JuDOcks5ruCIqgaJpZM4MvSyF .

faustomilletari commented 7 years ago

I think it’s done “per block”, not per convolutional stage. (per resolution block)

On 09 Apr 2017, at 04:21, Sagar Hukkire notifications@github.com wrote:

@fausto

I tried to calculate by hand correct if I am wrong 1) stage 1 , simply kernel size = filter size i.e. 5x5x5 2) Stage 2, stacking of two convolution layer with one down sampling Receptive field For example X direction (5+5-1) = 9 ( m+m-rank of filter)then there down sampling by 2 with stride 2 , how result is 22 here then.

Thanks and Regards Sagar Hukkire you have to use a kernel size 5x5x5. then when there is the downsampling the behavior is similar to a pooling 2x2x2.

in the up sampling path, the deconvolutions also contribute to increase the receptive field!

I calculated it once by hand and another time with matlab, through the package matconvnet.

On Apr 8, 2017, at 8:00 PM, Sagar Hukkire notifications@github.com wrote:

@faustomilletari https://github.com/faustomilletari link for receptive field calculation ? I followed many articles like dilated convolution and all but no way I can get same numbers as your papers?

So it will be great at one layer how you are able to get those dimension for receptive field

Thanks Sagar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ faustomilletari/VNet/issues/24#issuecomment-292753933, or mute the thread < https://github.com/notifications/unsubscribe-auth/ AMtsvomaNmVYZey8Cpk5p5ErAl9Y5CS5ks5ruB-bgaJpZM4MvSyF>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292754347, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxy0KY3CbiTzHQRonDI9Mb3l6JuDOcks5ruCIqgaJpZM4MvSyF . — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-292771833, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvjtXDgVR3RCCpxTLTnAA1Nb803qKks5ruJT5gaJpZM4MvSyF.

sagarhukkire commented 7 years ago

@faustomilletari

I got it in another paper where Author has cited Vnet ..haha its nice to understand. Yes its block wise

rogertrullo commented 7 years ago

Hi @sagarhukkire , were you able to obtain the same receptive field in the upsampling (deconvolutions) path? So far I have only been able to obtain the receptive field in the downsampling path..., I can't obtain the 476 in the R-stage 4

sagarhukkire commented 7 years ago

Refer Appendix of paper "Medical image segmentation using CNN"

There is formula which is needed for receiptive field calculation

Thanks and Regards Sagar Hukkire On Sep 13, 2017 10:18 AM, "Roger Trullo" notifications@github.com wrote:

Hi @sagarhukkire https://github.com/sagarhukkire , were you able to obtain the same receptive field in the upsampling (deconvolutions) path? So far I have only been able to obtain the receptive field in the downsampling path...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/24#issuecomment-329093967, or mute the thread https://github.com/notifications/unsubscribe-auth/ATFxy6OU1ecklMFa3q9-_cPCxysdgnTMks5sh4_WgaJpZM4MvSyF .

rogertrullo commented 7 years ago

Thanks @sagarhukkire ! EDIT: I was able to reproduce the receptive field in the paper, I made a small script , I will share it later so other people struggling can use it.