yolov2ReorgLayer

Description

The yolov2ReorgLayer function creates a
YOLOv2ReorgLayer object, which represents the reorganization layer for
you look only once version 2 (YOLO v2) object detection network. The reorganization layer
reorganizes the high-resolution feature maps from a lower layer by stacking adjacent features
into different channels. The output of reorganization layer is fed to the depth concatenation
layer. The depth concatenation layer concatenates the reorganized high-resolution features
with the low-resolution features from a higher layer.

Creation

Syntax

layer = yolov2ReorgLayer(stride)

layer = yolov2ReorgLayer(stride,Name,Value)

Description

layer = yolov2ReorgLayer(stride)
creates the reorganization layer for YOLO v2 object detection network. The layer
reorganizes the dimension of the input feature maps according to the step size specified
in stride. For details on creating a YOLO v2 network with
reorganization layer, see Design a YOLO v2 Detection Network with a Reorg Layer.

layer = yolov2ReorgLayer(stride,Name,Value)
sets the Name property using a name-value pair. Enclose the property
name in single quotes. For example,
yolov2ReorgLayer('Name','yolo_Reorg') creates reorganization layer
with the name 'yolo_Reorg'.

Properties

Name — Layer name'' (default) | character vector | string scalar

Layer name, specified as a character vector or a string scalar.
To include a layer in a layer graph, you must specify a nonempty unique layer name. If you train
a series network with the layer and Name is set to '',
then the software automatically assigns a name to the layer at training time.

Data Types: char | string

NumInputs — Number of inputs1 (default)

Number of inputs of the layer. This layer accepts a single input only.

Tips

You can find the desired value of stride using:

Algorithms

The reorganization layer improves the performance of the YOLO v2 object detection network
by facilitating feature concatenation from different layers. It reorganizes the dimension of a
lower layer feature map so that it can be concatenated with the higher layer feature map.

Consider an input feature map of size [HWC], where:

H is the height of the feature map.

W is the width of the feature map.

C is the number of channels.

The reorganization layer chooses feature map values from locations based on
the step sizes in stride and adds those feature values to the third
dimension C. The size of the reorganized feature map from the
reorganization layer is [floor(H/stride(1)) floor(W/stride(2))
C×stride(1)×stride(2)].

For feature concatenation, the height and width of the reorganized feature map must match
with the height and width of the higher layer feature map.