SkillAgentSearch skills...

CFPNet

Centralized Feature Pyramid for Object Detection

Install / Use

/learn @QY1994-0919/CFPNet
About this skill

Quality Score

0/100

Supported Platforms

Zed

README

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

<p align="justify"> 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<br>

Qualitative results

Qualitative results<br>

Quantitative results and training weights<br>

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

| 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<br>

- Install CFP-main from source<br>

git clone git@github.com:QY1994-0919/CFP-main.git  
cd CFP-main    
pip3 install -v -e .  # or  python3 setup.py develop   

- Prepare COCO dataset<br>

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<br>

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:<br>

@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}}
View on GitHub
GitHub Stars255
CategoryDevelopment
Updated1mo ago
Forks23

Languages

Python

Security Score

95/100

Audited on Feb 5, 2026

No findings