# 9th Place Solution

Thank you for host, I learned a lot from this competiton!
also special thanks to
[@hengck23](https://www.kaggle.com/hengck23)
. I refer
[@hengck23](https://www.kaggle.com/hengck23)
discussion topics many times.
TL;DR
MaxVit tiny
xy, xz, yz inference
heavy regularization
probability threshold
Solution
Model
MaxVit tiny
(nn.Module):
     ():
        (SenUNetStem, self).__init__()
        kwargs = (
            in_chans=in_chans,
            features_only=,
            
            pretrained=,
            out_indices=((encoder_depth)),
        )
        self.conv_stem = Conv2dReLU(in_chans, , , use_layernorm=, padding=)
        self.encoder = timm.create_model(encoder_name, **kwargs)
        self._out_channels = [
            ,
        ] + self.encoder.feature_info.channels()

        self.decoder = UnetDecoder(
            encoder_channels=self._out_channels,
            decoder_channels=decoder_channels,
            n_blocks=encoder_depth,
            use_batchnorm=decoder_use_batchnorm,
            center=  encoder_name.startswith()  ,
            attention_type=decoder_attention_type,
        )

        self.segmentation_head = SegmentationHead(
            in_channels=decoder_channels[-] + ,
            out_channels=classes,
            activation=activation,
            kernel_size=,
        )

        self.n_time = n_time
        self.pickup_index = pickup_index

     ():
        B, C, H, W = x.shape
        h = (H//)*
        w = (W//)*
        x = x[:,:,:h,:w]
        stem = self.conv_stem(x)
        features = self.encoder(x)        
        features = [
            stem,
        ] + features

        decoder_output = self.decoder(*features)
        masks = self.segmentation_head(decoder_output)
        masks = F.pad(masks,[,W-w,,H-h,,,,], mode=, value=)

         masks[:,]

SenUNetStem(
            encoder_name=,
            classes=,
            activation=,
        )
Dataset
kidney1 and 3 dataset.
Training Tricks
I focus on regularization trick.
because this competiton have unstable cv, public is not related.
Moreover host shared public/Private LB information images, I hink it indicate unstable.
EMA
50epochs
AdamW(Weight Decay 1e-2)
CutMix(until 25ep)
MixUp(until 25ep)
DiceLoss(smooth_factor=0.1)
Heavy Augmentation
train_aug = A.Compose([
        A.HorizontalFlip(=0.5),
        A.VerticalFlip(=0.5),
        A.RandomBrightness(=0.1, =0.7),
        A.OneOf([
                A.GaussNoise(var_limit=[10, 50]),
                A.GaussianBlur(),
                A.MotionBlur(),
                A.MedianBlur(=3),
                ], =0.4),
        A.OneOf([
            A.GridDistortion(=5, =0.3, =1.0),
            A.OpticalDistortion(=1., =1.0)
        ],=0.2),
        A.ShiftScaleRotate(=0.7, =0.5, =0.2, =30),
        A.CoarseDropout(=1, =0.25, =0.25),
        ToTensorV2(=)
    ])
Crop(512)
Inference
Inference is xy, xz, yz axis, and crop 512, stride 256.
Post-Process
Probability threshold(=sigmoid output). I didn't use percentile which method used many public notebook and past segmentation competiton(e.g. Volcano).
Because I checked percentile threshold in local cv, it's not stable. I didn't use it.
Not worked
Bigger models(maxvit base, small)
large size inference(1024), 512 is enough for this competiton.
Rotate90
Pretrained Other volumes(kidney_2/kidney_1_volumes)
[https://www.kaggle.com/code/tereka/simpleunet-xy-xz-yz-v2-nbp-b749ff/notebook](https://www.kaggle.com/code/tereka/simpleunet-xy-xz-yz-v2-nbp-b749ff/notebook)