Cervical Cytology Project
Use Masked-RCNN to do nuclei instance segmentation. Then, based on the detected nuclei center, crop a patch. This patch is called cell patch, in comparison to the previous methods based on scanning window patch. The classification is based on the cell patches.
Y: drive is mapped to \lhcdevfiler\cervixca
Z: drive is mapped to \ceb-na\jie_project\
Steps:
All G Tom annotation is under blue ink roi, so we should crop the ROI out. Currently, the ROI coordinates in level 3 resolution is at Y:\Cytology\generated_out\rois_matched_level3. However, some G Tom annotations may be outside of the ROI, so we need to modify some ROIs. The finally ROIs are at Y:\Users\Jie\CerCyt\cell_patch_classification\roi_level0.
- We convert level 3 coordinates to level 0 coordinates and crop the corresponding ROI patches
- If we notice misses of G Tom's annotation, we manually increase the ROI.
Find Ink and cLEAN2 registration difference; Read G Tom annotation on Ink slide and convert them to cLEAR2 coordinates, Detect any annotation outside of the current Ink ROI, and then manually increase ROI to include all G Tom Annotation.
Any nuclei inside G Tom annotation is counted as abnormal; otherwise, normal
Partition the 25 slides into training and evaluation set
-
preprocessing/crop_into_patches.py Crop the original NDPI images to 1024x1024 patches with overlapping 128 pixels.
The results are at Y:\Users\Jie\CerCyt\BD_cytology_25\patches -
cell_roi/cellular_roi_v2.py to generate blue ink marked bounding boxes.
The low resolution images after alignment is at Y:\Users\Jie\CerCyt\BD-cytology-25\ink_low_res.
The blue ink bounding boxes are saved at Y:\Users\Jie\CerCyt\BD-cytology-25\blue_rois.
It includes the normalized bounding boxes (_rois.txt files), all bounding boxes drawn on low resolution images (12XS00147_ink_rois.tif); and the ROI patches cropped from level 0, all these are in the coordinates of cLEAN slides. -
nucleus_mrcnn/nucleus_mrcnn.py Train and segment nuclei.
We use Kaggle dataset, at Y:\Cytology\data-science-bowl-2018.
Use all Kaggle stage1 train samples (stage1_train), the trained model is Y:\Users\Jie\CerCyt\nucleus_mrcnn\models\mask_rcnn_nucleus_0040-all_kaggle.h5
Then, we use 16 Cytology image samples (stage1_train-cervical), the trained model is
Y:\Users\Jie\CerCyt\nucleus_mrcnn\models\mask_rcnn_nucleus_0040-16_kaggle.h5.
mask_rcnn_nucleus_0040-all_kaggle.h5 is the starting model for mask_rcnn_nucleus_0040-16_kaggle.h5.The segmentation result of all 1024x1024 patches is at Y:\Users\Jie\CerCyt\BD-cytology-25\patches_MCRNN_segment. The segmentation result of patches under blue ink bounding boxes are at Y:\Users\Jie\CerCyt\BD_cytology_25\blue_rois_mcrnn_segment
-
preprocessing/gen_abnormal_cell_patches_from_ndpa.py Parse NDPA manual annotation to generate abnormal cell patches. Results are saved at Y:\Users\Jie\CerCyt\BD_cytology_25\abnormal_cell_patches
-
preprocessing/gen_normal_cell_patches_from_mrcnn Use mrcnn to detect nuclei in blue rois (generated in step 2), and then extract 256x256 patches as normal cell patch. Results are saved at Y:\Users\Jie\CerCyt\BD_cytology_25\normal_cell_patches