CoNIC - Baseline + Training Split

CoNIC - Baseline + Training Split  

  By: dangvuquoc1993 on Dec. 17, 2021, 11:33 p.m.

Hi all,

We are sorry for our delay in providing the baseline method.

We are happy to announce that the baseline for CoNIC is now available in the notebook here: https://github.com/TissueImageAnalytics/CoNIC/blob/main/notebooks/baseline.ipynb

We use HoVerNet as the baseline. In addition to the baseline, we also provide the code to split the current training data into the training and validation subsets.

Good luck and have a fun competition.

Re: CoNIC - Baseline + Training Split  

  By: tanbobo on Dec. 18, 2021, 6:47 a.m.

HoVerNet is all your need. U only HoVerNet once.

Re: CoNIC - Baseline + Training Split  

  By: joangibert14 on Dec. 22, 2021, 8:41 a.m.

Great!

Are you planning to release the training code?

Thanks

Re: CoNIC - Baseline + Training Split  

  By: simongraham73 on Dec. 22, 2021, 3:21 p.m.

Hi!

We can release the training code. We will do this ASAP. Note, we use the original HoVer-Net repo [link] for this, but use padded convolution in the decoder so that the output is the same size as the input.

 Last edited by: simongraham73 on Aug. 15, 2023, 12:55 p.m., edited 1 time in total.

Re: CoNIC - Baseline + Training Split  

  By: simongraham73 on Dec. 22, 2021, 5:36 p.m.

In line with the previous request, we have now made the HoVer-Net training code available as a separate branch on the HoVer-Net repository. Please refer to this link for further instructions.

Make sure that you are using the conic branch to use the exact same configuration that we used for the baseline.

Simon

Re: CoNIC - Baseline + Training Split  

  By: tanbobo on Dec. 23, 2021, 6:14 a.m.

HoVerNet is all your need. U only HoVerNet once.

Re: CoNIC - Baseline + Training Split  

  By: joangibert14 on Dec. 23, 2021, 9:38 a.m.

Hi

Thanks for the quick reply! Compared with the default repo, I see that you removed the remove_small_objects function from the HoverNetExt class. I was wondering if I just lost in somewhere in the git pulls... but I was quite interested since I guess is one of the main changes in the 40X to 20X transition. Or did you find any other way to solve the problem?

In any case, if you find this question out of the competition scope, please tell me and I will post in in the github repo.

Thanks

Re: CoNIC - Baseline + Training Split  

  By: simongraham73 on Dec. 23, 2021, 5:46 p.m.

You will see that the HoVer-Net post processing happens on this line in the baseline notebook:

inst_map = model._proc_np_hv(np_map[..., None], hv_map)

Here, model is:

model = HoVerNetConic(num_types=NUM_TYPES)

If you go into net_desc.py you will see the HoVerNetConic class. Here, you will see the _proc_np_hv method, which actually grabs the corresponding function from tiatoolbox, defined here. If you look into that function, we do actually still use remove_small_objects. To deal with 20x images, we do nothing different during training, but we rescale the images before post processing. This means that we can use the same post processing functions that were used when working with 40x images. Of course, an alternative would be to slightly adapt the parameters in the post processing function.

 Last edited by: simongraham73 on Aug. 15, 2023, 12:55 p.m., edited 4 times in total.

Re: CoNIC - Baseline + Training Split  

  By: joangibert14 on Dec. 24, 2021, 10:01 a.m.

Thanks for the reply.

I understand the rationale of upscaling the images, thanks for the clarification.

Just for clarification, I was referring to the conic branch of hovernet. Here I do not see any tiatoolbox import. I found the _proc_np_hv function in the post_proc.py file.

 Last edited by: joangibert14 on Aug. 15, 2023, 12:55 p.m., edited 1 time in total.

Re: CoNIC - Baseline + Training Split  

  By: simongraham73 on Dec. 24, 2021, 10:56 p.m.

HoVer-Net was trained from the original repository - i.e tiatoolbox was not used for that. This branch is purely to showcase what we did for training the baseline model. The reason why we made a new branch was to demonstrate exactly how we split our data into training : validation (here) and to show what augmentations we used (here) for the challenge. You will find that we actually use a reduced set of augmentations for the baseline and only choose to use random flips, blur, additive noise and colour augmentation. We also used padded convolution in the decoders for the baseline, which can also be seen here. This ensured the output size was the same as the input size (256x256).

Once we receive the trained model using the conic branch from the original HoVer-Net repo, we use baseline.ipynb to process all images. It is only here that you will find tiatoolbox (at test time) and therefore it won't be seen in the conic branch in the original repo. We do this to simplify the code for the purpose of the baseline notebok. Theoretically, the original repository will be able to process the images, but we felt this notebook would be more interactive.

The confusion is probably due to the existence of two separate repositories for this - we will aim to unify the repositories after Christmas to make it easier to follow!

I hope that clears things up now :)

Simon

 Last edited by: simongraham73 on Aug. 15, 2023, 12:55 p.m., edited 7 times in total.

Re: CoNIC - Baseline + Training Split  

  By: pluto_charon on Dec. 26, 2021, 11:28 a.m.

I have read above questions & answers, but I still have some doubts to confirm with you.

If I can view the branch 'HoverNet-Conic" as an original training model used to train model and save training parameters. And, the file "baseline.ipynb" in "CONIC-main/notebooks " is a test code for convenience using above training parameters.

Thank you, I am looking forward to your reply!

Re: CoNIC - Baseline + Training Split  

  By: simongraham73 on Dec. 26, 2021, 8:27 p.m.

@pluto_charon ,

Yes, that is correct.

Simon

Re: CoNIC - Baseline + Training Split  

  By: ankush.jamthikar1992 on Dec. 31, 2021, 11:27 a.m.

Hi,

In your baseline notebook code, you have mentioned about from net_desc import HoVerNetConic. But, when I checking your net_desc.py file, HoVerNetConic is not metioned. Instead, HoVerNetExt is metioned. Are they same? Please clarify!

Re: CoNIC - Baseline + Training Split  

  By: dangvuquoc1993 on Dec. 31, 2021, 1:56 p.m.

Hi @ankush,

I am not sure where did you look at. The HoVerNetConic mentioned in the notebook are in the URL. Keep in mind that the code for inference is totally independent from the training. Naming etc. is not guaranteed to be the same.

Aside from that, HoVerNetConic shares the same architecture as HoVerNetExt (training code, partially copied over).

 Last edited by: dangvuquoc1993 on Aug. 15, 2023, 12:55 p.m., edited 3 times in total.

Re: CoNIC - Baseline + Training Split  

  By: joangibert14 on July 15, 2022, 6:16 a.m.

First of all I would like to congrats you for the great competition and feedback you guys did.

I am coming back to play a little bit with the baseline and here you mentioned that you rescale the 20X images to use them as a 40X. Could you please point me to the place where this process is done? I have some 20X patches that I would like to process in the same way.