lufficc / SSD

High quality, fast, modular reference implementation of SSD in PyTorch
MIT License
1.51k stars 385 forks source link

Reproducing SSDLite_MobileNetV2 results on COCO #166

Open AzinPoshtyar opened 4 years ago

AzinPoshtyar commented 4 years ago

Hello,

I'm trying to reproduce SSDLite results from following paper on COCO (mAP=22.1) paper: https://arxiv.org/pdf/1801.04381.pdf

below is the config file:

MODEL:
  NUM_CLASSES: 81
  BOX_HEAD:
    PREDICTOR: 'SSDLiteBoxPredictor'
  BACKBONE:
    NAME: 'mobilenet_v2'
    OUT_CHANNELS: (96, 1280, 512, 256, 256, 64)
  PRIORS:
    # features of CNN layer after each feature extraction layer
    FEATURE_MAPS: [20, 10, 5, 3, 2, 1]
    STRIDES: [16, 32, 64, 107, 160, 320]
    MIN_SIZES: [60, 105, 150, 195, 240, 285]
    MAX_SIZES: [105, 150, 195, 240, 285, 330]
    ASPECT_RATIOS: [[2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]]
    BOXES_PER_LOCATION: [6, 6, 6, 6, 6, 6]
INPUT:
  IMAGE_SIZE: 320
DATASETS:
  TRAIN: ("coco_2014_train", "coco_2014_valminusminival")
  TEST: ("coco_2014_minival", )

SOLVER:
  MAX_ITER: 400000
  LR_STEPS: [280000, 360000]
  GAMMA: 0.1
  BATCH_SIZE: 24
  LR: 1e-3

However, the eval results on minival 2014

AP        : 0.16
AP50      : 0.277
AP75      : 0.163
APs       : 0.005
APm       : 0.14
APl       : 0.323

@lufficc I appreciate it if you provide hyper-parameters for this model?

lufficc commented 4 years ago

COCO has many small objects, you should use small anchors like https://github.com/lufficc/SSD/blob/master/configs/vgg_ssd512_coco_trainval35k.yaml#L8-L9

AzinPoshtyar commented 3 years ago

Hi there, Thanks for the reply. I tried this confige with smaller anchor:

PRIORS:
    FEATURE_MAPS: [20, 10, 5, 3, 2, 1]
    STRIDES: [16, 32, 64, 107, 160, 320]
    MIN_SIZES: [21, 45, 99, 153, 207, 261]
    MAX_SIZES: [45, 99, 153, 207, 261, 315]
    ASPECT_RATIOS: [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
    BOXES_PER_LOCATION: [4, 6, 6, 6, 4, 4]

But I got

AP:       0.1848
AP75:     0.1777
AP50:     0.346
APl:      0.3148
APm:      0.1798
APs:      0.033

As result shown, APs is increased but APl is decreased. @lufficc Any suggestion on the anchor size that we have used?

AzinPoshtyar commented 3 years ago

@ehosseiniasl

kaijieshi7 commented 3 years ago

@AzinPoshtyar Do you reproduce the map?

marina-neseem commented 3 years ago

did you manage to find the right hyper-parameters?