473. PetFinder.my - Pawpularity Contest | petfinder-pawpularity-score
感谢所有参与这次比赛的人,以及主办方举办了如此精彩的比赛。
很高兴能冲到第31名,我也因此成为了竞赛大师。在这次比赛中,我想学习多模态、Noisy Student 和知识蒸馏。
我的解决方案参考了这篇论文:
Self-training with Noisy Student improves ImageNet classification
我使用了 fastai 和 timm 库。模型结构如下:
class cust_fastai_model(nn.Module):
def __init__(self, model_name='swin_large_patch4_window7_224', emb=True):
super().__init__()
self.emb = emb
self.backbone = create_model(model_name,
pretrained=False, num_classes=0)
image_num_features = self.backbone.num_features
self.image_fc = nn.Sequential(
nn.Dropout(0.3), nn.Linear(image_num_features, 128)
)
self.custom_head = nn.Sequential(
nn.Dropout(0.4), nn.Linear(128, 1)
)
def forward(self, image):
emb = self.backbone(image)
emb = self.image_fc(emb)
out = self.custom_head(emb)
if self.emb:
return torch.cat([out, emb], dim=1)
else:
return out
| 模型名称 | 图像尺寸 | CV分数 |
|---|---|---|
| swin_large_patch4_window7_224 | 224 | 17.4291008 |
| swin_base_patch4_window7_224 | 224 | 17.62332115 |
| swin_large_patch4_window12_384 | 384 | 17.51918907 |
| tf_efficientnet_b5_ns | 456 | 17.70378685 |
| vit_large_patch16_224 | 224 | 17.63189049 |
| eca_nfnet_l2 | 384 | 17.58191376 |
| TTA 次数 | CV分数 |
|---|---|
| 1 | 17.22635913 |
| 2 | 17.20699514 |
| 3 | 17.2165909 |
| 4 | 17.20069566 |
| 5 | 17.21008584 |
| 6 | 17.20981791 |
| 7 | 17.1992845 |
| 8 | 17.19996605 |
| 9 | 17.21487459 |
| 10 | 17.2102797 |
然后,我使用 TTA 7 来预测和标记外部数据。
| 模型名称 | 图像尺寸 | CV分数 |
|---|---|---|
| swin_large_patch4_window7_224 | 224 | 17. |