Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HuBMAP 17th place model pipeline

Maxwell
May 11, 2021

HuBMAP 17th place model pipeline

Kaggle competition: HuBMAP - Hacking the Kidney
Identify glomeruli in human kidney tissue images

competition overview: https://www.kaggle.com/c/hubmap-kidney-segmentation/overview

solution detail: https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/238027

Maxwell

May 11, 2021
Tweet

More Decks by Maxwell

Other Decks in Science

Transcript

  1. Preprocessing / Augmentation • Naive normalization; divided by 255 •

    5 folds; 3 WSI for each fold • Augmentations (p=0.5) - Horizontal/Vertical Flip (p=0.5) - RandomRotate90 (p=0.5) - Rotate (-40/+40, reflect101, p=0.5) - ShiftScaleRotate (scale: -0.2/0.1, p=0.5) - OneOf (p=0.5) RandomBrightnessContrast (B: 0.5, C: 0.1) HueSaturationValue (H: +-20, S: +-100, V: +-80) - One of (p=0.5) Cutout (holes: 100, size: 1/64, white RGB) GaussianNoise - One of (p=0.5) ElasticTransform GridDistortion (steps: 5, limit: 0.3) OpticalDistortion (distort: 0.5, shift: 0.0) Cutting out patches • Remove black/white pathes for training - White (R:217, G:213, B:217) color information was used to add noise and fill the edges of the images in augmentation. - Not removing black/white pathes for validation images • Different scale patches for ensemble Group A (for final submission): Size = 352, Down scale = 4 Size = 512, Down scale = 2 Group B: Size = 352, Down scale = 4 Size = 640, Down scale = 2 • In addition to cutting out the normal patches, also cutting out patches shifted by a quarter of the patch size. Psuedo - Labeled 5 Mask-WSIs (Useless for private score !!!) Remove black / white patches for training Decoder Block Encoder Block 15 WSIs (Whole Slide Images) Predicted 5/10 Mask-WSIs for Public/Private 1 2 U-Net type model Back bone: EfficientNet B3 (ImageNet pretrained) 3 4 5 Resources: TITAN RTX, 2080Ti x 2, 1080Ti x 2 Copyright 2021 Maxwell_110 Size: 352 x 352 Down scale: 4 + Size: 640 x 640 Down scale: 2 HuBMAP - Hacking the Kidney Model Pipeline 17 th place 6 1 Training • BCE + Adam(1stLR: 7.5e-4, 2ndLR: 2.5e-4) • BS: 8 (size 640), 12 (size 512), 16 (size 352) • Patience: ES = 10, RLRoP = 3 • Training with train images only at first, and then with train + public(psuedo) images • Alternate training with psuedo labels Step 1: Train with Group A, and predict pseudo labels for public images Step 2: Next, Train with Group B and pseudo labels, and predict pseudo labels Step 3: Repeat the aboves sufficiently Step 4: Submit predictions trained with Group A (+ pseudo labeld public images) 3 2 Size: 352 x 352 Down scale: 4 + Size: 512 x 512 Down scale: 2 B A Prediction + Tiling predicted patches • TTA: Raw, HorizontalFlip, VerticalFlip • Overlapping by 1/16 image size for tiling • Naive averaging for ensemble (folds and models) • Threshold optimization with train images (th: 0.40) Submission on kernel environment • Approximately 8 hours running (5 folds, 3 TTA, 2 models) • Good correlation between local CV and public LB (Alghough there are deviations..., maybe due to the d48 image) • Local CV: 0.9429 Public LB: 0.927 Private LB: 0.947 6 5 4