SBU-BMI / quip_cnn_segmentation

CNN based segmentation codes
BSD 3-Clause "New" or "Revised" License
47 stars 17 forks source link

How to generate final synthetic images? Clueless after getting initial synthetic images #5

Closed pranav-deo closed 4 years ago

pranav-deo commented 4 years ago

Hello!

I want to generate synthetic images with nuclear masks. For that, I extracted 4000 x 4000 px from a whole slide and ran draw_fake.sh from training-data-synthesis directory and I got the initial synthetic images with masks. I'm frankly lost what to do after getting these images. Where do I get the pre-trained CNN weights and how do I run the further scripts?

Any help will be highly appreciated. TIA!

lehougoogle commented 4 years ago

Hi!

You can run the nucleus segmentation training script: https://github.com/SBU-BMI/quip_cnn_segmentation/blob/master/segmentation-of-nuclei/READMD.md#training

However, we do not save refined images during training by default. To turn it on, set patch_dump to True: https://github.com/SBU-BMI/quip_cnn_segmentation/blob/master/segmentation-of-nuclei/buffer.py#L22

Then, the image saving logics will be turn on here: https://github.com/SBU-BMI/quip_cnn_segmentation/blob/master/segmentation-of-nuclei/buffer.py#L36

Thx

pranav-deo commented 4 years ago

Thank you for the prompt reply!

I still have some doubts.

  1. During the training phase, what data should go in the folder ./data/nuclei/real ? Data extracted by training-data-synthesis includes directories - contour, cyto, detect, image, intp_mask, mask, nucl, refer, source and no directory named real.

  2. Are we supposed to do some processing on masks of training-data-synthesis before feeding them to segmentation-of-nuclei? Because according to README, former gives masks with 3 three bits and later requires masks with 2 bits only.

  3. What is a good size of data samples in the required data folder for segmentation-of-nuclei in each of the folders?

lehougoogle commented 4 years ago
  1. Extract real image patches with no masks using: https://github.com/SBU-BMI/quip_cnn_segmentation/tree/master/training-data-synthesis#extract-real-images-with-no-mask
  2. You can those masks without further processing. One of the bits is not used currently in segmentation-of-nuclei.
  3. We usually train with at least 50k initial synthetic patches.
pranav-deo commented 4 years ago

Thanks a lot for your support! :smiley: