Main Content

reidentificationNetwork

Re-identification deep learning network for re-identifying and tracking objects

Since R2024a

Description

The reidentificationNetwork object configures a re-identification (ReID) deep learning network to extract features and train with a new set of classes. You can use the configured ReID network to re-identify objects in a sequence of image frames.

Note

This functionality requires Deep Learning Toolbox™.

Creation

Description

reID = reidentificationNetwork(backbone,classNames) creates a ReID network and configures it to perform transfer learning using a set of object classes specified by the classNames argument. For optimal performance, train the network on new training data using the trainReidentificationNetwork function.

reID = reidentificationNetwork(___,Name=Value) specifies options using name-value arguments in addition to the input arguments from the previous syntax. You can also use name-value arguments to set the ModelName, InputSize, FeatureLength, and FeatureLayer properties of the network.

For example, InputSize=[460 460 3] sets the size of image used for classification and re-identification.

Input Arguments

expand all

Backbone feature extraction network with an image input layer, specified as a dlnetwork (Deep Learning Toolbox) object. The network must have a layer that produces an array with only one non-singleton dimension. If you do not specify the FeatureLayer property reidentificationNetwork appends the classification head network to the last layer in the network that meets the singleton criteria.

Names of the object classes that the ReID network is trained to re-identify, specified as a vector of strings, cell array of character vectors, or categorical vector. This argument sets the ClassNames property of the reidentificationNetwork object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: reidentificationNetwork(net,classNames,InputSize=[460 460 3]) sets the size of image used for classification and re-identification.

Classification layers in the final layers of the ReID network, specified as a dlnetwork (Deep Learning Toolbox) object. The classification layers contain these components by default: a batch normalization layer, a ReLU layer, a dropout layer, and a custom layer that contains a fully connected layer corresponding to the total number of classes and a softmax layer. The specified network must contain a fully connected layer and be able to process features output by the feature extraction layer FeatureLayer. The ReID network uses the output of the ClassificationNetwork layers for classification training.

Normalization statistics, specified as a structure with mean and standard deviation fields. The structure must contain the fields Mean and StandardDeviation, which specify the means and standard deviations per channel, respectively, as 1-by-C vectors. The input image layer imageInputLayer (Deep Learning Toolbox) of the backbone network network specifies which normalization method to use.

When InputSize is different than the imageInputLayer of the backbone network, NormalizationStatistics is a structure with these fields, which contain values from the COCO data set:

FieldDescriptionValue
Mean1-by-C vector of means per channel.[123.6750 116.2800 103.5300]
StandardDeviation1-by-C vector of standard deviations per channel.[58.3950 57.1200 57.3750]

The number of channels C must match the number of channels in the image specified by InputSize.

Properties

expand all

This property is read-only.

Name of the ReID network, specified as a string scalar or character vector.

To set the value of this property, you must specify it at object creation.

This property is read-only.

Configured ReID network, stored as a dlnetwork (Deep Learning Toolbox) object.

This property is read-only.

Input image size to use for classification and re-identification, specified as a 1-by-3 vector of positive integers [height width channels]. The values of height and width specify the image dimensions, in pixels, and channels specifies the number of color channels. The network resizes input images to this size. The default value is the network input size.

To set the value of this property, you must specify it at object creation.

This property is read-only.

Names of the object classes that the ReID network is trained to re-identify, specified as a cell array, categorical vector, or cell array of character vectors.

This property is read-only.

Feature extraction layer of the backbone ReID network, specified as a character vector or a string scalar. This layer returns the appearance feature vectors when you use the extractReidentificationFeatures function. The default feature extraction layer is a fully connected layer named "fc_num_features" with an output size specified by the FeatureLength property.

The output of the feature extraction layer must be a valid input to the specified classification layers ClassificationNetwork, and consist of an array with only one non-singleton dimension. If you specify a FeatureLayer value, reidentificationNetwork ignores the FeatureLength value.

To set the value of this property, you must specify it at object creation.

This property is read-only.

Feature vector size for ReID inference, specified as a positive integer. When you call the extractReidentificationFeatures object function, the output is an M-by-B matrix, where M is equal to FeatureLength and B is the batch size.

Object Functions

extractReidentificationFeaturesExtract object re-identification (ReID) features from image

Version History

Introduced in R2024a