<p>Changing <strong>num_layers</strong> won't help you in this case.<br />
SSD has several detection branches - each branch derived from different feature map resolution
For example - for mobilenet_v1_ssd found in TF OD API there are 6 branches.<br />
branch 0 - 19x19<br />
branch 1 - 10x10<br />
branch 2 - 5x5<br />
branch 3 - 3x3<br />
branch 4 - 2x2<br />
branch 5 - 1x1</p>
<p>So the argument - num_layers will actually change the number of branches but not the number of anchors per pixel.</p>
<p>In case you want to have only one anchor box per pixel you will have to change the several things (read until the end :) ):</p>
<ol>
<li><strong>Aspect ratios</strong> - By changing the number of aspect ratios you change the number of anchors per layer. so:</li>
</ol>
<pre class="lang-py prettyprint-override"><code>    anchor_generator {
      ssd_anchor_generator {
        num_layers: 6
        min_scale: 0.2
        max_scale: 0.95
        aspect_ratios: 1.0
        aspect_ratios: 2.0
        aspect_ratios: 0.5
        aspect_ratios: 3.0
        aspect_ratios: 0.3333
      }
    }
</code></pre>
<p>So by removing but 1.0, for example, will leave you <strong>almost</strong> with one anchor.
2. Why almost? SSD (<a href="https://arxiv.org/abs/1512.02325" rel="nofollow noreferrer">https://arxiv.org/abs/1512.02325</a>), see the paper, add another anchor box with a scale of a geometric mean between current branch scale to next branch scale. So you will actually have 2 anchors per pixel for branches 1-5.  In order to disable it you should change a parameter named - <strong>interpolated_scale_aspect_ratio</strong> to 0.<br />
<a href="https://i.stack.imgur.com/q2HjJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q2HjJ.png" alt="enter image description here" /></a><br />
You can do it by adding this argument to the config file (see the protobuf of ssd anchors - <a href="https://github.com/tensorflow/models/blob/2ad3e213838f71e92af198d917ac5574c9d60294/research/object_detection/protos/ssd_anchor_generator.proto" rel="nofollow noreferrer">https://github.com/tensorflow/models/blob/2ad3e213838f71e92af198d917ac5574c9d60294/research/object_detection/protos/ssd_anchor_generator.proto</a>)
so under anchor_generator add:</p>
<pre><code>interpolated_scale_aspect_ratio: 0
</code></pre>
<ol start="3">
<li>If you followed 1 and 2, you will see that you have 1 anchor per pixel per branch but for branches 1-5. But for some reason you will have 3 anchors for the first branch... This is because the first branch is getting three anchors by default. You can disable it by using the following argument:<br />
<a href="https://i.stack.imgur.com/qvanz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qvanz.png" alt="enter image description here" /></a></li>
</ol>
<pre><code>reduce_boxes_in_lowest_layer: false
</code></pre>
How to chose the number of anchors
<p>How I can implement a single shot detector with only one anchor box per feature map cell?
I have used ssd mobilenet coco 2018 v1 and I have changed the anchor generator part in config file I.e num layers = 1 in ssd anchor generator. Will that be okay??</p>

<p><a href="https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/ssd_mobilenet_v1_coco.config" rel="nofollow noreferrer">https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/ssd_mobilenet_v1_coco.config</a></p>

<p>anchor_generator {
      ssd_anchor_generator {
        num_layers: 6
        min_scale: 0.2
        max_scale: 0.95
        aspect_ratios: 1.0
        aspect_ratios: 2.0
        aspect_ratios: 0.5
        aspect_ratios: 3.0
        aspect_ratios: 0.3333</p>