MPSCNNYOLOLossDescriptor(3)

NAME
MPSCNNYOLOLossDescriptor

SYNOPSIS

#import <MPSCNNLoss.h>

Inherits NSObject, and <NSCopying>.

  Instance Methods
(nonnull instancetype) - init

  Class Methods
(nullable MPSCNNYOLOLossDescriptor *) + cnnLossDescriptorWithXYLossType:WHLossType:confidenceLossType:classesLossType:reductionType:anchorBoxes:numberOfAnchorBoxes:

  Properties
MPSCNNLossDescriptor * XYLossDescriptor
MPSCNNLossDescriptor * WHLossDescriptor
MPSCNNLossDescriptor * confidenceLossDescriptor
MPSCNNLossDescriptor * classesLossDescriptor
MPSCNNReductionType reductionType
BOOL rescore
float scaleXY
float scaleWH
float scaleNoObject
float scaleObject
float scaleClass
float minIOUForObjectPresence
float maxIOUForObjectAbsence
NSUInteger numberOfAnchorBoxes
NSData * anchorBoxes

Detailed Description

This depends on Metal.framework. The MPSCNNYOLOLossDescriptor specifies a loss filter descriptor that is used to create a MPSCNNLoss filter. The MPSCNNYOLOLoss is a filter that has been specialized for object detection tasks and follows a specific layout for the feature-channels of the input, output, weight and label data.

The layout of the data within the feature-channels is as follows:

Each anchorbox uses ( 2+2+1 + numberOfClasses = 5 + numberOfClasses ) feature channels.

Therefore the total number of feature channels used is: (5 + numberOfClasses) * numberOfAnchorBoxes. The first feature channel for anchorbox index 'anchorIdx' is at fcIndex = (5 + numberOfClasses) * anchorIdx, and the feature channels within each anchorbox are stored in the layout: 'XYWHCFFFFFF...', where (XY) are the so-called raw x and y coordinates of the bounding box within each gridcell and (WH) are the corresponding width and height. 'C' signifies a confidence for having an object in the cell and FFFFF... are the feature channel values for each class of object to be classified in the object detector.

The YOLO-loss filter works by operating mostly independently on each anchorbox:

•   The XY-channels of the inputs are first transformed to relative XY-values by applying the sigmoid-neuron on them, after which they are passed through the loss function defined by XYLossDescriptor, which is typically chosen to be the MPSCNNLossTypeMeanSquaredError type loss function.

•   The WH-channels contain the raw width and height of the bounding box and they are operated with the loss function defined by WHLossDescriptor, which is typically of type MPSCNNLossTypeHuber.

•   The C-channel contains the confidence value of having an object in the bounding box and it is operated by the loss function defined by confidenceLossDescriptor, which is typically chosen to be MPSCNNLossTypeSigmoidCrossEntropy.

•   The FFFFF... (number of channels is number of classes) channels contains the raw feature channels for object classes, used to identify which objects are the most probable ones in the bounding box and these channels are passed through the loss function defined by classesLossDescriptor, which in typical cases is of the type MPSCNNLossTypeSoftMaxCrossEntropy.

For details on how to set up the label values and anchorboxes see https://arxiv.org/abs/1612.08242

Method Documentation

  + (nullable MPSCNNYOLOLossDescriptor*) cnnLossDescriptorWithXYLossType: (MPSCNNLossType) XYLossType(MPSCNNLossType) WHLossType(MPSCNNLossType) confidenceLossType(MPSCNNLossType) classesLossType(MPSCNNReductionType) reductionType(NSData *__nonnull) anchorBoxes(NSUInteger) numberOfAnchorBoxes
Make a descriptor for a MPSCNNYOLOLoss object.

Parameters:
    XYLossType The type of spatial position loss filter.
    WHLossType The type of spatial size loss filter.
    confidenceLossType The type of confidence filter.
    classesLossType The type of classes filter.
    reductionType The type of a reduction operation to apply.

Returns:
    A valid MPSCNNYOLOLossDescriptor object or nil, if failure.

  - (nonnull instancetype) init

Property Documentation

  - anchorBoxes [read], [write], [nonatomic], [retain]
NSData containing the width and height for numberOfAnchorBoxes anchor boxes

  - classesLossDescriptor [read], [write], [nonatomic], [retain]
The type of a loss filter. This parameter specifies the type of a loss filter.

  - confidenceLossDescriptor [read], [write], [nonatomic], [retain]
The type of a loss filter. This parameter specifies the type of a loss filter.

  - (float) maxIOUForObjectAbsence [read], [write], [nonatomic], [assign]

  - (float) minIOUForObjectPresence [read], [write], [nonatomic], [assign]

  - numberOfAnchorBoxes [read], [write], [nonatomic], [assign]
number of anchor boxes used to detect object per grid cell

  - reductionType [read], [write], [nonatomic], [assign]
ReductionType shared accross all losses (so they may generate same sized output)

  - rescore [read], [write], [nonatomic], [assign]
Rescore pertains to multiplying the confidence groundTruth with IOU (intersection over union) of predicted bounding box and the groundTruth boundingBox. Default is YES

  - scaleClass [read], [write], [nonatomic], [assign]
scale factor for no object classes loss and loss gradient default is 2.0

  - scaleNoObject [read], [write], [nonatomic], [assign]
scale factor for no object confidence loss and loss gradient default is 5.0

  - scaleObject [read], [write], [nonatomic], [assign]
scale factor for no object confidence loss and loss gradient default is 100.0

  - scaleWH [read], [write], [nonatomic], [assign]
scale factor for WH loss and loss gradient default is 10.0

  - scaleXY [read], [write], [nonatomic], [assign]
scale factor for XY loss and loss gradient default is 10.0

  - WHLossDescriptor [read], [write], [nonatomic], [retain]
The type of a loss filter. This parameter specifies the type of a loss filter.

  - XYLossDescriptor [read], [write], [nonatomic], [retain]
The type of a loss filter. This parameter specifies the type of a loss filter.

Author

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.