Code Monkey home page Code Monkey logo

cfpnet1's Introduction

CFP for Object Detection

This repository contains the official PyTorch implementation of the following paper:

Centralized Feature Pyramid for Object Detection

Yu Quan, Dong Zhang, Liyan Zhang and Jinhui Tang
Computer Science and Engineering, Nanjing University of Science and Technology
https://arxiv.org/abs/2210.02093

Abstract

Visual feature pyramid has shown its superiority in both effectiveness and efficiency in a wide range of applications. However, the existing methods exorbitantly concentrate on the inter-layer feature interactions but ignore the intra-layer feature regulations, which are empirically proved beneficial. Although some methods try to learn a compact intra-layer feature representation with the help of the attention mechanism or the vision transformer, they ignore the neglected corner regions that are important for dense prediction tasks. To address this problem, in this paper, we propose a Centralized Feature Pyramid (CFP) for object detection, which is based on a globally explicit centralized feature regulation. Specifically, we first propose a spatial explicit visual center scheme, where a lightweight MLP is used to capture the globally long-range dependencies and a parallel learnable visual center mechanism is used to capture the local corner regions of the input images. Based on this, we then propose a globally centralized regulation for the commonly-used feature pyramid in a top-down fashion, where the explicit visual center information obtained from the deepest intra-layer feature is used to regulate frontal shallow features. Compared to the existing feature pyramids, CFP not only has the ability to capture the global long-range dependencies, but also efficiently obtain an all-round yet discriminative feature representation. Experimental results on the challenging MS-COCO validate that our proposed CFP can achieve the consistent performance gains on the state-of-the-art YOLOv5 and YOLOX object detection baselines.

The overall architecture

The overall architecture

Qualitative results

Qualitative results

Quantitative results and training weights

We provide training weights of CFP with YOLOX and YOLOv5 as the baseline.

Model size mAP(%) weights
CFP-s (YOLOX) 640 41.10 weight
CFP-m (YOLOX) 640 46.40 weight
CFP-l (YOLOX) 640 49.40 weight
CFP-s (YOLOv5) 640 36.00 weight
CFP-m (YOLOv5) 640 43.20 weight
CFP-l (YOLOv5) 640 46.60 weight

Installation

- Install CFP-main from source

git clone [email protected]:QY1994-0919/CFP-main.git  
cd CFP-main    
pip3 install -v -e .  # or  python3 setup.py develop   

- Prepare COCO dataset

cd CFP-main   
ln -s /path/to/your/COCO ./datasets/COCO   

Usage

- To train the model, please run:

python -m cfp.tools.train -f cfp-s -d 2 -b 16 --fp16 -o [--cache]
python -m cfp.tools.train -f cfp-m -d 2 -b 16 --fp16 -o [--cache]
python -m cfp.tools.train -f cfp-l -d 2 -b 16 --fp16 -o [--cache]

- To test the model, please run:

python -m cfp.tools.eval -n  cfp-s -c cfp_s.pth -b 16 -d 2 --conf 0.001 [--fp16] [--fuse]
python -m cfp.tools.eval -n  cfp-m -c cfp_s.pth -b 16 -d 2 --conf 0.001 [--fp16] [--fuse]
python -m cfp.tools.eval -n  cfp-l -c cfp_s.pth -b 16 -d 2 --conf 0.001 [--fp16] [--fuse]

Acknowledgement

Thanks YOLOv5 and YOLOX teams for the wonderful open source project!

Bibtex

If you find this work is useful for your research, please cite our paper:

@article{quan2022centralized,
title={Centralized Feature Pyramid for Object Detection},
author={Quan, Yu and Zhang, Dong and Zhang, Liyan and Tang, Jinhu},
journal={arXiv},
year={2022}}

cfpnet1's People

Contributors

qy1994-0919 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.