# 102nd place solution

First of all, I want to thank the organizers who hosted such a great competition and kagglers who generously shared their knowledge.
I was not intended to write my solution because my rank is not fascinating and I'm busy with the entrance exam for graduate college, but I couldn't resist the temptation of a duck T-shirt…
Model
I created two models: TwoStageModel and TwoStageModelMultiChannel.
config.seg_model = 

 (nn.Module):
     ():
        ().__init__()
        self.config = config
        self.model = seg_models[config.seg_model](
            encoder_name=config.encoder_name,
            encoder_weights=,
            in_channels=,
            classes=,
            activation=,
        )
        self.model2= seg_models[config.seg_model](
            encoder_name=,
            encoder_weights=,
            in_channels=,
            classes=,
            activation=,
        )
        
        self.conv2d = nn.Conv2d(, , config.kernel_size, padding=config.padding)

     ():
        out = self.model(x)
        out2 = torch.cat([out, x], dim=)
        out2 = self.conv2d(out2)
        out2 = self.model2(out2)
         out2, out

 (nn.Module):
     ():
        ().__init__()
        self.config = config
        self.model = seg_models[config.seg_model](
            encoder_name=config.encoder_name,
            encoder_weights=,
            in_channels=,
            classes=,
            activation=,
        )
        self.model2= seg_models[config.seg_model](
            encoder_name=,
            encoder_weights=,
            in_channels=,
            classes=,
            activation=,
        )
        self.conv2d1 = nn.Conv2d(, , config.kernel_size, padding=config.padding)
        self.conv2d2 = nn.Conv2d(, , config.kernel_size, padding=config.padding)
        self.conv2d3 = nn.Conv2d(+, , config.kernel_size, padding=config.padding)

     ():

        out = self.conv2d1(x)
        out2 = self.conv2d2(out)
        out3 = self.model(out2)
        out2 = torch.cat([out3, out, x], dim=)
        out2 = self.conv2d3(out2)
        out2 = self.model2(out2)
         out2, out3
Encoder
I used 'timm-resnest26d', 'efficientnet-b6', 'vgg19_bn', and so on. Large models game me better performance.
Data
I used false-color images for ContrailsModel2Stage and all 9 bands for TwoStageModelMultiChannel.
Augmentation
HorizontalFlip(p=0.1),
VerticalFlip(p=0.1),
RandomRotate90(p=0.1),
ShiftScaleRotate(shift_limit=0.0625/2, scale_limit=0.2/2, rotate_limit=15, p=0.1, border_mode=cv2.BORDER_REFLECT)
TTA
As mentioned in others' write-ups, data flip/rotation TTA severely hurt cv scores. I felt something wrong but thought this is because of
[data leakage](https://www.kaggle.com/competitions/google-research-identify-contrails-reduce-global-warming/discussion/419994)
and ignored.
Instead of flip/rotation TTA, I applied a 1-pixel slide TTA and calculated the max value of original predictions and TTA predictions. 1-pixel right-down slide and left-up slide were effective and gave me about a 0.01 score boost, but 1-pixel right-up slide and left-down slide didn't work. I should have given more thought to why this happens…
![](assets/fe6191581b40a79f0d3a7f82.png)