# 41st place solution

Firstly, we would like to express our gratitude to Kaggle and the organizers for hosting this exceptional competition. Through participating in this contest, we have gained a deeper understanding of the challenges and methodologies involved in medical image recognition.
Introduction
We submitted separate solutions within our team.
I submitted an ensemble model of se_resnext101_32x4d and Vision Transformer (mit_b2), which achieved a score of
0.834
on the public leaderboard. The private leaderboard score was
0.586
.
[@ryosukesaito](https://www.kaggle.com/ryosukesaito)
submitted an ensemble model of EfficientNet and SE-ResNeXt which achieved a score of
0.857
on the public leaderboard. The private leaderboard score was
0.519
.
The high public leaderboard score achieved by
[@ryosukesaito](https://www.kaggle.com/ryosukesaito)
’s submission might have been a contributing factor to our ability to submit my somewhat ambitious notebook, possibly leading to our winning a silver medal.
My (@jooott) Solution
Overview
![](assets/bb21edef1c5397c3c5838269.png)
Key points
I struggled significantly with stabilizing the training process.
To address this, I used Accumulate Grad Batches to effectively increase the batch size to 128, which stabilized the training.
A major factor in the significant improvement in score was the application of stronger data augmentation. The data augmentation strategy was inspired by
[the 1st place solution of the Vesuvius Challenge - Ink Detection](https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417496)
.
I also think that scaling up the training images from 512px to 1024px contributed to the increase in score.
![](assets/9a3d9d352655f00217695800.png)
![](assets/96ff5d89f567ca11eac72598.png)
train_transform = A.Compose(
            [
                A.RandomScale(
                    scale_limit=(1.0, 1.20),
                    =cv2.INTER_CUBIC,
                    =0.1,
                ),
                A.RandomResizedCrop(
                    image_size,
                    image_size,
                    scale=(0.8, 1.0),
                    =1
                ),
                A.RandomBrightnessContrast(=0.75),
                A.ShiftScaleRotate(=0.75),
                A.OneOf([
                        A.GaussNoise(var_limit=[10, 50]),
                        A.GaussianBlur(),
                        A.MotionBlur(),
                        ], =0.4),
                A.CoarseDropout(
                    =1, =int(image_size * 0.1),
                    =int(image_size * 0.1),
                    =0, =0.5),
                A.CLAHE(=0.2),
                A.GridDistortion(=5, =0.3, =0.05),
                ToTensorV2(=),
            ]
        )
Muku's (@ryosukesaito) solution
![](assets/3a5fecd26e904863d4786661.png)
key points
In my architecture, Detection/Segmentation of kidney region is performed before predicting blood vessel area.
Detection contributed to inference speedup (especially in the yz/zx direction), since it is possible to skip vessel segmentation in frames where kidney is not detected, and to reduce image size by cropping.
Segmentation masks were used to reduce FP outside the kidney.
For both annotations, I used LangSAM
[(luca-medeiros/lang-segment-anything: SAM with text prompt](https://github.com/luca-medeiros/lang-segment-anything)
). This allowed me to prepare annotation data with a few manual adjustments.
![](assets/f754127a5494d0196a55f8c9.png)
I use YOLOv8n for Detection and EfficientNet-B0 for Segmentation.
Various pre/post processing improved LB/PB scores slightly, but steadily.
In the yz/zx axis image, blood vessels at the edge may be cut off. Since the inference accuracy was poor in this area, I improved the inference accuracy by pseudo-closing the vessels with mirror-padding before inference.
![](assets/66812ed3208e99ececb9d15e.png)
After binarization of the results, defects may occur in the vascular prediction region as shown below. For this reason, morphological closing and fillPoly processing were added as post-processing steps.
These contributed to a slight score improvement in CV/LB/PB.
![](assets/6512438c34f3c4afc6f9039b.png)
In my experiments, ideas that contribute to generalization ability (strong augmentation, pseudo labeling, etc…) could not adopted as final submits, because they resulted in a decrease in CV/LB…
However, I regret that I should not have been too aware of the unstable CV/LB, as the sample was not large enough for this competition.