Skip to content
YonghaoHe edited this page Feb 6, 2021 · 2 revisions

model

model provides all building blocks for network structures. LFD and FCOS are both implemented here. We only introduce LFD here. (As for FCOS, our version can only reach 35.4 MAP in COCO vs 36.4 MAP in original FCOS paper. So we have to check our code for bugs further) Conventionally, the network structures are composed of backbones, necks and heads. For losses, we adopt most popular classification and regression losses, mainly ported from mmdetection. Utils currently only contains nms, also ported from mmdetection.

backbone

backbone provides resnet and lfd_resnet. Everyone should be familiar with resnet, so we omit the description here.

lfd resnet

lfd resnet is actually similar with resnet. The main differences lie in two aspects: 1) the stems of different down-sample strides; 2) three types of blocks ---- FastBlock, FasterBlock and FastestBlock. Backbone determines the most of time cost in inference, so carefully design your backbone.

Our implemented backbones support acquiring feature maps of any blocks in any stages by setting out_indices.

neck

neck provides three types of structures: fpn, simple fpn and simple neck.

fpn

fpn implements standard FPN structure. Check the code for reference directly.

simple fpn

simple fpn simplifies fpn by reducing output convs and offering neighbouring_mode for feature fusion. Check the code for reference directly.

simple neck

simple neck is not really a 'neck', because it does not perform feature fusion. Only one conv is applied to each incoming feature map to align the number of output feature channels.

head

We implement two types of heads: fcos head and lfd head. fcos head is easy to understand, so we omit the details.

lfd head

lfd head is also easy to understand. It has two extra options: 1) share_head_flag determines whether to share head weights or not across all heads; 2) merge_path_flag determines whether to share weights or not for both classification path and regression path.

losses

We list all losses supported in lfd

classification losses

  • BCE
  • Focal Loss
  • CE

regression losses

  • MSE
  • Smooth L1
  • IOU loss, GIOU loss, CIOU loss, DIOU loss

LFD

To fully understand LFD, please move the LFD introduction [page].