baidu-research / NCRF

Cancer metastasis detection with neural conditional random field (NCRF)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codes for coordinate generation

SamitHuang opened this issue · comments

commented

Could you release the codes for coordinates generation? Now the patch size is fixed to be 768x768. Once it changes, we need to generate new coordinates. Also need to extract and save a new set of extracted images, which is spatially expensive.

commented

@SamitHuang The code for generating the coordinates are not prepared yet. It's a little bit messy. You can refer to this #14 . But I think you don't need to generate new coordinates when you change the patch size. Can you just use the current coordinates to generate a different patch size, e.g. 512x512?

commented

But if the patch size is larger than 768, re-checking tumor region is required. As representative sampling is important for the model performance, so I think this part of codes is critical for re-implementation. Thanks.

Google labeled the patch as a tumor even if one of the pixels is of tumor region. so i think we can also do same.

commented

@SamitHuang @usamabaig1 So there are two concepts here, first is the grid size, e.g. 768, the other is the patch size within the grid, e.g. 256. Each patch within the grid is modeled through CNN and CRF. We obtained the tumor/normal label of each patch within the grid by checking the center coordinate of each patch with respect to the ground truth annotation mask. Therefore, for a grid size of 768 of 3x3 256 patches, the label will also be 3x3 of 1/0. If you just want to randomly sample tumor or normal coordinates, the code is pretty much already there by using the tissue mask code as noted in #14 . But the performance won't be great without hard negative mining. However the code for hard negative mining is quite a bit painful.

commented

Thanks. I understand the concepts. can you describe the hard negative mining procedure? Do you apply a previously trained CNN on each WSI for training exhaustively to find out all false negative tissue patches, then add them to the training set?

commented

@SamitHuang Yes, I first trained a CNN on purely randomly sampled normal/tumor patches. Then applied this CNN on each tumor WSI in training set to find out all false negative tissue patches, then add them to the training set.