boosting-r-cnn

[Neurocomputing 2023] The official implementation of Boosting R-CNN: Reweighting R-CNN Samples by RPN's Error for Underwater Object Detection

https://github.com/mousecpn/boosting-r-cnn

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, ieee.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary

Keywords

object-detection underwater
Last synced: 6 months ago · JSON representation ·

Repository

[Neurocomputing 2023] The official implementation of Boosting R-CNN: Reweighting R-CNN Samples by RPN's Error for Underwater Object Detection

Basic Info
  • Host: GitHub
  • Owner: mousecpn
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 19.1 MB
Statistics
  • Stars: 37
  • Watchers: 1
  • Forks: 1
  • Open Issues: 6
  • Releases: 0
Topics
object-detection underwater
Created over 3 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

Boosting R-CNN: Reweighting R-CNN Samples by RPN’s Error for Underwater Object Detection

This repository contains the code (in PyTorch) for the paper: (arxiv: 2206.13728)

Introduction

Complicated underwater environments bring new challenges to object detection, such as unbalanced light conditions, low contrast, occlusion, and mimicry of aquatic organisms. Under these circumstances, the objects captured by the underwater camera will become vague, and the generic detectors often fail on these vague objects. This work aims to solve the problem from two perspectives: uncertainty modeling and hard example mining. We propose a two-stage underwater detector named boosting R-CNN, which comprises three key components. First, a new region proposal network named RetinaRPN is proposed, which provides high-quality proposals and considers objectness and IoU prediction for uncertainty to model the object prior probability. Second, the probabilistic inference pipeline is introduced to combine the first-stage prior uncertainty and the second-stage classification score to model the final detection score. Finally, we propose a new hard example mining method named boosting reweighting. Specifically, when the region proposal network miscalculates the object prior probability for a sample, boosting reweighting will increase the classification loss of the sample in the R-CNN head during training, while reducing the loss of easy samples with accurately estimated priors. Thus, a robust detection head in the second stage can be obtained. During the inference stage, the R-CNN has the capability to rectify the error of the first stage to improve the performance. Comprehensive experiments on two underwater datasets and two generic object detection datasets demonstrate the effectiveness and robustness of our method.

pipeline

Dependencies

  • Python==3.7.6
  • PyTorch==1.7
  • mmdetection==2.17.0
  • mmcv==1.4.0
  • numpy==1.16.3

Installation

The basic installation follows with mmdetection. It is recommended to install locally.

Datasets

UTDAC2020: https://drive.google.com/file/d/1avyB-ht3VxNERHpAwNTuBRFOxiXDMczI/view?usp=sharing

After downloading all datasets, create UTDAC2020 document.

$ cd data $ mkdir UTDAC2020

It is recommended to symlink the dataset root to $data.

Boosting-R-CNN-Reweighting-R-CNN-Samples-by-RPN-s-Error-for-Underwater-Object-Detection ├── data │ ├── UTDAC2020 │ │ ├── train2017 │ │ ├── val2017 │ │ ├── annotations

COCO: https://cocodataset.org/#download

PASCAL VOC: http://host.robots.ox.ac.uk/pascal/VOC/

Other underwater datasets: https://github.com/mousecpn/Collection-of-Underwater-Object-Detection-Dataset

Train

UTDAC2020

$ python tools/train.py configs/boosting_rcnn/boosting_rcnn_r50_pafpn_1x_utdac.py

COCO

$ python tools/train.py configs/boosting_rcnn/boosting_rcnn_r50_pafpn_1x_coco.py

PASCAL VOC

$ python tools/train.py configs/boosting_rcnn/boosting_rcnn_r50_pafpn_1x_voc.py

Test

UTDAC2020

$ python tools/test.py configs/boosting_rcnn/boosting_rcnn_r50_pafpn_1x_utdac.py <path/to/checkpoints>

Checkpoint

UTDAC2020: https://drive.google.com/file/d/1p5SQe0opW1CbCjUsRHlBfANBXdoJ_kOs/view?usp=sharing

COCO: https://drive.google.com/file/d/1uuE7GJvmY1pxW6okFgsX_khkYBy6PfB2/view?usp=sharing

Results

image

image

qualitative results

video 00_00_00-00_00_30

Visualization

If you want to reimplement the visualization as above, you need to change the config file first. Adding "LoadAnnotations", and adding the key "gt_bboxes" in "collect", as:

test_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict( type='MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img', 'gt_bboxes']), ]) ]

And then adding "--show" or "--show-dir" argument when calling test.py, you will get the detection visualization.

Acknowledgement

Thanks MMDetection team for the wonderful open source project!

Citation

@article{song2023boosting, title={Boosting R-CNN: Reweighting R-CNN samples by RPN’s error for underwater object detection}, author={Song, Pinhao and Li, Pengteng and Dai, Linhui and Wang, Tao and Chen, Zhan}, journal={Neurocomputing}, volume={530}, pages={150--164}, year={2023}, publisher={Elsevier} }

Recommendation

Some of our works also use UTDAC2020 dataset. They will be listed as follows for you to compare.

Excavating RoI Attention for Underwater Object Detection: https://github.com/zsyasd/Excavating-RoI-Attention-for-Underwater-Object-Detection#excavating-roi-attention-for-underwater-object-detection

Edge-guided Representation Learning for Underwater Object Detection: https://github.com/Ixiaohuihuihui/ERL-Net-for-Underwater-Object-Detection

Bagging R-CNN extends the idea of this paper to traffic detection: https://ieeexplore.ieee.org/abstract/document/10097085?casa_token=kYgm1LZFtqMAAAAA:KdYiSVVWgKYE5IrAOCdCF5rO6io7IA8fDLyV3vaPT82YL6yVE8OYTnBpT3Vvn8eaJvyKLc4zCw4

My master thesis: (Robust Object Detection of Underwater Robot based on Domain Generalization)

Owner

  • Name: EdSong
  • Login: mousecpn
  • Kind: user
  • Location: Leuven
  • Company: KU Leuven

I am a PhD in KU Leuven Now~

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - name: "MMDetection Contributors"
title: "OpenMMLab Detection Toolbox and Benchmark"
date-released: 2018-08-22
url: "https://github.com/open-mmlab/mmdetection"
license: Apache-2.0

GitHub Events

Total
  • Issues event: 12
  • Watch event: 11
  • Issue comment event: 8
  • Push event: 1
  • Fork event: 1
Last Year
  • Issues event: 12
  • Watch event: 11
  • Issue comment event: 8
  • Push event: 1
  • Fork event: 1

Dependencies

requirements/build.txt pypi
  • cython *
  • numpy *
requirements/docs.txt pypi
  • docutils ==0.16.0
  • recommonmark *
  • sphinx ==4.0.2
  • sphinx-copybutton *
  • sphinx_markdown_tables *
  • sphinx_rtd_theme ==0.5.2
requirements/mminstall.txt pypi
  • mmcv-full >=1.3.8
requirements/optional.txt pypi
  • cityscapesscripts *
  • imagecorruptions *
  • scipy *
  • sklearn *
requirements/readthedocs.txt pypi
  • mmcv *
  • torch *
  • torchvision *
requirements/runtime.txt pypi
  • matplotlib *
  • numpy *
  • pycocotools *
  • pycocotools-windows *
  • six *
  • terminaltables *
requirements/tests.txt pypi
  • asynctest * test
  • codecov * test
  • flake8 * test
  • interrogate * test
  • isort ==4.3.21 test
  • kwarray * test
  • mmtrack * test
  • onnx ==1.7.0 test
  • onnxruntime >=1.8.0 test
  • pytest * test
  • ubelt * test
  • xdoctest >=0.10.0 test
  • yapf * test
docker/Dockerfile docker
  • pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
docker/serve/Dockerfile docker
  • pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
requirements.txt pypi
setup.py pypi