mAP decreasing with training tensorflow object detection SSD

前端 未结 1 729
故里飘歌
故里飘歌 2021-02-01 11:12

I\'m trying to train a SSD mobilenet detector for detecting cell nuclei in microscopic images. I\'m using the tensorflow object detection API on Ubuntu 16.04 with the GPU implem

相关标签:
1条回答
  • 2021-02-01 11:18

    ok, so after some experimentation (=blind guessing) with the config file I think I found the answer to my question - I'm putting it here hoping that someone else can benefit.

    First, the reason for mAP decreasing was probably the setting:

    matched_threshold: 0.3
    unmatched_threshold: 0.3
    

    From my experimentation, lowering this setting (like I did) below 0.5 seems to destabilise the model and make it break during training (with decreasing mAP over time).

    Second, when trying to detect cell nuclei in a microscopic image (this probably applies to other small objects with a known size as well), the SSD seems to be VERY sensitive to the min/max-setting in the anchor generator.

    anchor_generator {
      ssd_anchor_generator {
        num_layers: 6
        min_scale: 0.2
        max_scale: 0.95
    

    When I started out (and constantly failed) I used a ball park estimate for this setting, and when playing around with different image sizes and such, suddenly at 128x128 pixels the model got really good with mAP 0.9 detecting more or less every cell. When trying to figure out why it suddenly worked I printed histograms over the relative sizes of the annotated objects in the images I realised that I got lucky with the 128x128 models config file and hit the range precisely.

    I then went back to all the other models and sizes, and when using the exact range of sizes of the cell nuclei in a certain image size, the model performs perfect, even at larger images sizes (e.g. 512px) where the nuclei only take up 3-15% of the image width. Even at 1024px with downsampling to 512 and the nuclei only covering 1-7% of image width, the model performs ok as long as the size range is precisely specified.

    For my application this is actually not a problem since I know beforehand what sizes of features to expect, but with a more general problem I'm guessing it's a weakness..

    0 讨论(0)
提交回复
热议问题