ClassesClasses | | Operators

classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlp (Operator)

Name

classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlp — Classify an image with a multilayer perceptron.

Signature

classify_image_class_mlp(Image : ClassRegions : MLPHandle, RejectionThreshold : )

Herror classify_image_class_mlp(const Hobject Image, Hobject* ClassRegions, const Hlong MLPHandle, double RejectionThreshold)

Herror T_classify_image_class_mlp(const Hobject Image, Hobject* ClassRegions, const Htuple MLPHandle, const Htuple RejectionThreshold)

void ClassifyImageClassMlp(const HObject& Image, HObject* ClassRegions, const HTuple& MLPHandle, const HTuple& RejectionThreshold)

HRegion HImage::ClassifyImageClassMlp(const HClassMlp& MLPHandle, double RejectionThreshold) const

HRegion HClassMlp::ClassifyImageClassMlp(const HImage& Image, double RejectionThreshold) const

static void HOperatorSet.ClassifyImageClassMlp(HObject image, out HObject classRegions, HTuple MLPHandle, HTuple rejectionThreshold)

HRegion HImage.ClassifyImageClassMlp(HClassMlp MLPHandle, double rejectionThreshold)

HRegion HClassMlp.ClassifyImageClassMlp(HImage image, double rejectionThreshold)

Description

classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlp performs a pixel classification with the multilayer perceptron (MLP) MLPHandleMLPHandleMLPHandleMLPHandleMLPHandle on the multichannel image ImageImageImageImageimage. Before calling classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlp the MLP must be trained with train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlp. ImageImageImageImageimage must have NumInput channels, as specified with create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlp. On output, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions contains NumOutput regions as the result of the classification. Note that the order of the regions that are returned in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions corresponds to the order of the classes as defined by the training regions in add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlp. The parameter RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThreshold can be used to reject pixels that have an uncertain classification. RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThreshold represents a threshold on the probability measure returned by the classification (see classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlp and evaluate_class_mlpevaluate_class_mlpEvaluateClassMlpEvaluateClassMlpEvaluateClassMlp). All pixels having a probability below RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThreshold are not assigned to any class. Because an MLP typically assigns pixels that lie outside the convex hull of the training data in the feature space to one of the classes with high probability (confidence), it is useful in many cases to explicitly train a rejection class, even if RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThreshold is used, by adding samples for the rejection class with add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlp and by re-training the MLP with train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlp.

Execution Information

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image objectHImageHImageHobject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)

Input image.

ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions (output_object)  region-array objectHRegionHRegionHobject *

Segmented classes.

MLPHandleMLPHandleMLPHandleMLPHandleMLPHandle (input_control)  class_mlp HClassMlp, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

MLP handle.

RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThreshold (input_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Threshold for the rejection of the classification.

Default value: 0.5

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Restriction: RejectionThreshold >= 0.0 && RejectionThreshold <= 1.0

Example (HDevelop)

read_image (Image, 'ic')
gen_rectangle1 (Board, 80, 320, 110, 350)
gen_rectangle1 (Capacitor, 359, 263, 371, 302)
gen_rectangle1 (Resistor, 200, 252, 290, 256)
gen_rectangle1 (IC, 180, 135, 216, 165)
concat_obj (Board, Capacitor, Classes)
concat_obj (Classes, Resistor, Classes)
concat_obj (Classes, IC, Classes)
create_class_mlp (3, 3, 4, 'softmax', 'principal_components', 3, 42, \
                  MLPHandle)
add_samples_image_class_mlp (Image, Classes, MLPHandle)
get_sample_num_class_mlp (MLPHandle, NumSamples)
train_class_mlp (MLPHandle, 200, 1, 0.01, Error, ErrorLog)
classify_image_class_mlp (Image, ClassRegions, MLPHandle, 0.5)
dev_display (ClassRegions)
clear_class_mlp (MLPHandle)

Result

If the parameters are valid, the operator classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlp returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlp, read_class_mlpread_class_mlpReadClassMlpReadClassMlpReadClassMlp

Alternatives

classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmm, classify_image_class_knnclassify_image_class_knnClassifyImageClassKnnClassifyImageClassKnnClassifyImageClassKnn, classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvm, classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLut, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm, class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSup

See also

add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlp, create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlp

Module

Foundation


ClassesClasses | | Operators