1st place solution to the Satellite Image Change Detection Challenge hosted by SenseTime

Overview

SenseEarth2020 - ChangeDetection

1st place in the Satellite Image Change Detection Challenge hosted by SenseTime.

Our Method

Task Description

Given two images of the same scene acquired at different times, we are required to mark the changed and unchanged areas. Moreover, as for the changed areas, we need to annotate their detailed semantic masks.

The change detection task in this competition can be decomposed into two sub-tasks:

  • binary segmentation of changed and unchanged areas.
  • semantic segmentation of changed areas.

Model

image

Pseudo Labeling

The core practice is using self-distillation strategy to assign pseudo labels to unchanged areas.

Specifically, in our experiments, predictions of five HRNet-based segmentation models are ensembled, serving as pseudo labels of unchanged areas.

The overall training process can be summarized as:

  • Training multiple large segmentation models.
  • Ensembling their predictions on unchanged areas.
  • Training a smaller model with both labeled and pseudo labeled areas.

For more details, please refer to the technical report and presentation.

Getting Started

Dataset

Description | Download [password: f3qq]

Pretrained Model

HRNet-W18 | HRNet-W40 | HRNet-W44 | HRNet-W48 | HRNet-W64

Final Trained Model

PSPNet-HRNet-W18 | PSPNet-HRNet-W40

File Organization

# store the whole dataset and pretrained backbones
mkdir -p data/dataset ; mkdir -p data/pretrained_models ;

# store the trained models
mkdir -p outdir/models ; 

# store the pseudo masks
mkdir -p outdir/masks/train/im1 ; mkdir -p outdir/masks/train/im2 ;

# store predictions of validation set and testing set
mkdir -p outdir/masks/val/im1 ; mkdir -p outdir/masks/val/im2 ;
mkdir -p outdir/masks/test/im1 ; mkdir -p outdir/masks/test/im2 ;

├── data
    ├── dataset                    # download from the link above
    │   ├── train                  # training set
    |   |   ├── im1
    |   |   └── ...
    │   └── val                    # the final testing set (without labels)
    |
    └── pretrained_models
        ├── hrnet_w18.pth
        ├── hrnet_w40.pth
        └── ...

Training

# Please refer to utils/options.py for more arguments
# If hardware supports, more backbones can be trained, such as hrnet_w44, hrnet_w48
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --backbone hrnet_w18 --pretrained --model pspnet --lightweight

Pseudo Labeling & Re-training

# This step is optional but important in performance improvement
# Modify the backbones, models and checkpoint paths in L20-40 in label.py manually according to your saved models
# It is better to ensemble multiple trained models for pseudo labeling

# Pseudo labeling
CUDA_VISIBLE_DEVICES=0,1,2,3 python label.py

# Re-training
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --backbone hrnet_w18 --pretrained --model pspnet --lightweight --use-pseudo-label

Testing

# Modify the backbones, models and checkpoint paths in L39-44 in test.py manually according to your saved models
# Or simply use our final trained models
CUDA_VISIBLE_DEVICES=0,1,2,3 python test.py
You might also like...
Kaggle | 9th place (part of) solution for the Bristol-Myers Squibb – Molecular Translation challenge

Part of the 9th place solution for the Bristol-Myers Squibb – Molecular Translation challenge translating images containing chemical structures into I

Kaggle | 9th place single model solution for TGS Salt Identification Challenge

UNet for segmenting salt deposits from seismic images with PyTorch. General We, tugstugi and xuyuan, have participated in the Kaggle competition TGS S

10th place solution for Google Smartphone Decimeter Challenge at kaggle.
10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Under refactoring 10th place solution for Google Smartphone Decimeter Challenge at kaggle. Google Smartphone Decimeter Challenge Global Navigation Sat

4th place solution for the SIGIR 2021 challenge.

SIGIR-2021 (Tinkoff.AI) How to start Download train and test data: https://sigir-ecom.github.io/data-task.html Place it under sigir-2021/data/. Run py

 Meli Data Challenge 2021 - First Place Solution
Meli Data Challenge 2021 - First Place Solution

My solution for the Meli Data Challenge 2021

The sixth place winning solution (6/220) in 2021 Gaofen Challenge.
The sixth place winning solution (6/220) in 2021 Gaofen Challenge.

SwinTransformer + OBBDet The sixth place winning solution (6/220) in the track of Fine-grained Object Recognition in High-Resolution Optical Images, 2

Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL BASALT Challenge.

KAIROS MineRL BASALT Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL B

Kohei's 5th place solution for xview3 challenge

xview3-kohei-solution Usage This repository assumes that the given data set is stored in the following locations: $ ls data/input/xview3/*.csv data/in

4st place solution for the PBVS 2022 Multi-modal Aerial View Object Classification Challenge - Track 1 (SAR) at PBVS2022
4st place solution for the PBVS 2022 Multi-modal Aerial View Object Classification Challenge - Track 1 (SAR) at PBVS2022

A Two-Stage Shake-Shake Network for Long-tailed Recognition of SAR Aerial View Objects 4st place solution for the PBVS 2022 Multi-modal Aerial View Ob

Comments
  • 关于标签的问题

    关于标签的问题

    楼主你好,在阅读楼主的源代码的时候,有些地方不是很明白,希望能得到楼主的指点: 1、在change_detection.py中 CLASSES = ['未变化区域', '水体', '地面', '低矮植被', '树木', '建筑物', '运动场'] 以及商汤提供的标签都指明 未变化区域标记为0,水体标记为1,地面为2,低矮植被为3,树木为4,建筑物为5,运动场为6。 但是,在随后的一段代码中: if self.mode == 'train': gt_mask1 = np.array(Image.open(os.path.join(self.root, 'label1', id))) mask_bin = np.zeros_like(gt_mask1) mask_bin[gt_mask1 == 0] = 1 mask_bin = Image.fromarray(mask_bin) 为什么把mask_bin 标签为0都改为1?标签为0不是表示改区域未发生变化吗?

    2、在训练代码train.py中: out1, out2, out_bin = self.model(img1, img2)

                loss1 = self.criterion(out1, mask1 - 1)
                loss2 = self.criterion(out2, mask2 - 1)
      计算损失的时候,为什么mask1和mask2需要减1呢?
    
    opened by albert28wen 7
  • BatchSize问题

    BatchSize问题

    非常抱歉,再一次冒昧打扰。有个问题想请教一下,当我以resnet101为backbone,deeplabv3plus为model,batch size设为2进行训练时,会出现batchnormalization只有一个sample的情况。为了找寻原因,打印了网络输入的tensor大小,发现虽然网络输入img1和img2的shape为[2, 3, 512, 512],但在BaseNet的forward中却输出了四张[1, 3, 512, 512]大小的张量,这也是导致batch size设置为2时会报错的原因,我很不理解,想问下其中的原因,谢谢了。

    # deeplabv3plus.py
    for i, (img1, img2, mask1, mask2, mask_bin) in enumerate(tbar):
        img1, img2 = img1.cuda(), img2.cuda()
        mask1, mask2 = mask1.cuda(), mask2.cuda()
        mask_bin = mask_bin.cuda()
        print(img1.shape) # [2, 3, 512, 512]
        print(img2.shape) # [2, 3, 512, 512]
    
    # base.py
    def forward(self, x1, x2, tta=False):
        print(x1.shape)  # 打印出四张shape为[1, 3, 512, 512]的Tensor
        print(x2.shape)
    
    opened by wanghao15536870732 2
  • 有关hrnet的问题

    有关hrnet的问题

    你好,非常感谢开源的代码! 但是在运行代码的时候有些问题,当hrnet作为主干网络提取特征时,backbone的channels列表中只加入了stage4的通道总和。

    self.stage4_cfg = extra['STAGE4']
    num_channels = self.stage4_cfg['NUM_CHANNELS']
    block = blocks_dict[self.stage4_cfg['BLOCK']]
    num_channels = [num_channels[i] * block.expansion for i in range(len(num_channels))]
    self.transition3 = self._make_transition_layer(pre_stage_channels, num_channels)
    self.stage4, pre_stage_channels = self._make_stage(self.stage4_cfg, num_channels, multi_scale_output=True)
    
    last_inp_channels = np.int(np.sum(pre_stage_channels))
    self.channels = [last_inp_channels]
    

    在获取低层和高层特征的通道时,会出现越界的情况。

     low_level_channels = self.backbone.channels[1]
     high_level_channels = self.backbone.channels[-1]
    

    应该将henet每一阶段的pre_stage_channels加入到channels中,但是这种方式感觉不太对,还是说我的运行方式有问题?

    opened by wanghao15536870732 2
  • question

    question

    Whether it will have good effect to input the FCN header to get the two segmentation graph after making the difference of the feature graph extracted by backbone directly? Thank you .

    opened by chenhaiwen 1
The 1st place solution of track2 (Vehicle Re-Identification) in the NVIDIA AI City Challenge at CVPR 2021 Workshop.

AICITY2021_Track2_DMT The 1st place solution of track2 (Vehicle Re-Identification) in the NVIDIA AI City Challenge at CVPR 2021 Workshop. Introduction

Hao Luo 91 Dec 21, 2022
1st place solution in CCF BDCI 2021 ULSEG challenge

1st place solution in CCF BDCI 2021 ULSEG challenge This is the source code of the 1st place solution for ultrasound image angioma segmentation task (

Chenxu Peng 30 Nov 22, 2022
Xview3 solution - XView3 challenge, 2nd place solution

Xview3, 2nd place solution https://iuu.xview.us/ test split aggregate score publ

Selim Seferbekov 24 Nov 23, 2022
1st Place Solution to ECCV-TAO-2020: Detect and Represent Any Object for Tracking

Instead, two models for appearance modeling are included, together with the open-source BAGS model and the full set of code for inference. With this code, you can achieve around mAP@23 with TAO test set (based on our estimation).

null 79 Oct 8, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
🏆 The 1st Place Submission to AICity Challenge 2021 Natural Language-Based Vehicle Retrieval Track (Alibaba-UTS submission)

AI City 2021: Connecting Language and Vision for Natural Language-Based Vehicle Retrieval ?? The 1st Place Submission to AICity Challenge 2021 Natural

null 82 Dec 29, 2022
1st ranked 'driver careless behavior detection' for AI Online Competition 2021, hosted by MSIT Korea.

2021AICompetition-03 본 repo 는 mAy-I Inc. 팀으로 참가한 2021 인공지능 온라인 경진대회 중 [이미지] 운전 사고 예방을 위한 운전자 부주의 행동 검출 모델] 태스크 수행을 위한 레포지토리입니다. mAy-I 는 과학기술정보통신부가 주최하

Junhyuk Park 9 Dec 1, 2022
1st Solution For ICDAR 2021 Competition on Mathematical Formula Detection

This project releases our 1st place solution on ICDAR 2021 Competition on Mathematical Formula Detection. We implement our solution based on MMDetection, which is an open source object detection toolbox based on PyTorch.

yuxzho 94 Dec 25, 2022
Waymo motion prediction challenge 2021: 3rd place solution

Waymo motion prediction challenge 2021: 3rd place solution ?? Technical report ??️ Presentation ?? Announcement ??Motion Prediction Channel Website ??

null 158 Jan 8, 2023
4th place solution to datafactory challenge by Intermarché.

Solution to Datafactory challenge by Intermarché. 4th place solution to datafactory challenge by Intermarché. The objective of the challenge is to pre

Raphael Sourty 11 Mar 19, 2022