Coder Social home page Coder Social logo

mus-cdb's Introduction

MUS-CDB

Python 3.7 PyTorch 1.8 CUDA 11.1 cuDNN 7.6.5 LICENSE

PyTorch implementation of MUS-CDB: Mixed Uncertainty Sampling with Class Distribution Balancing for Active Annotation in Aerial Object Detection.

Abstract

Task Recent aerial object detection models rely on a large amount of labeled training data, which requires unaffordable manual labeling costs in large aerial scenes with dense objects. Active learning is effective in reducing the data labeling cost by selectively querying the informative and representative unlabelled samples. However, existing active learning methods are mainly with class-balanced setting and image-based querying for generic object detection tasks, which are less applicable to aerial object detection scenario due to the long-tailed class distribution and dense small objects in aerial scenes. In this paper, we propose a novel active learning method for cost-effective aerial object detection. Specifically, both object-level and image-level informativeness are considered in the object selection to refrain from redundant and myopic querying. Besides, an easy-to-use class-balancing criterion is incorporated to favor the minority objects to alleviate the long-tailed class distribution problem in model training. To fully utilize the queried information, we further devise a training loss to mine the latent knowledge in the undiscovered image regions. Extensive experiments are conducted on the DOTA-v1.0 and DOTA-v2.0 benchmarks to validate the effectiveness of the proposed method. The results show that it can save more than 75% of the labeling cost to reach the same performance compared to the baselines and state-of-the-art active object detection methods.

Installation

Prepare environment

  1. Create a conda virtual environment and activate it.

    conda create -n mus-cdb python=3.7 -y
    conda activate mus-cdb
  2. Please install PyTorch 1.8.0 and torchvision 0.9.0 for CUDA 11.1 following the official instructions, e.g.,

    conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
  3. Please install mmcv-full, we recommend you to install the pre-build package as below.

    pip install mmcv-full==1.4.5 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
  4. Please clone the MUS-CDB repository.

    git clone https://github.com/zjw700/MUS-CDB.git
    cd MUS-CDB
  5. Please download the required package.

    pip install -r requirements/build.txt

Data Preparation

Please refer to data_preparation.md for dataset installation and segmentation.

Train and Test

Please modify the corresponding pretrained model path, they are located in:

Line 16 of configs/redet/redet_re50_refpn_1x_dota_le90.py: pretrained='$PRETRAINED_MODEL_PATH/'
Line 16 of configs/redet/redet_re50_refpn_1x_dota2_le90.py: pretrained='$PRETRAINED_MODEL_PATH/'

We recommend you to use a GPU but not a CPU to train and test, because it will greatly shorten the time.

If you use only a single GPU, you can use the script.sh file directly as below:

chmod 700 ./script.sh
./script.sh 

The script uses the train.py and test.py functions to train and test where the value of config_path, sample, c_0_path, s_0_path and work_dir shound be changed according to your actual situation (e.g., config_path should be replaced by the path of the config file in the configs/_base_ folder).

Please note more parameters can be found and mofidy in the file of train.py and test.py .

Model Zoo

The trained model for each cycle in active learning are Baidu Drive (Extraction code:ASLK).

License

This project is released under the Apache 2.0 license.

Citation

If you find this repository useful for your publications, please consider citing our paper.

@misc{2212.02804,
Author = {Dong Liang and Jing-Wei Zhang and Ying-Peng Tang and Sheng-Jun Hang},
Title = {MUS-CDB: Mixed Uncertainty Sampling with Class Distribution Balancing for Active Annotation in Aerial Object Detection},
Year = {2022},
Eprint = {arXiv:2212.02804},
}

mus-cdb's People

Contributors

zjw700 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.