Skip to content

class_label_filter

nickgillian edited this page Aug 21, 2016 · 2 revisions

#Class Label Filter

##Description The Class Label Filter is a useful post-processing module which can remove erroneous or sporadic prediction spikes that may be made by a classifier on a continuous input stream of data.

For instance, imagine a classifier that correctly outputs the predicted class label of 1 for a large majority of the time that a user is performing gesture 1, but every so often (perhaps due to sensor noise), the classifier outputs the class label of 2. In this instance the class label filter can be used to remove these sporadic prediction values, with the output of the class label filter in this instance being 1 (see the image below which illustrates this example).

ClassLabelFilter The results of running the test dataset through the Class Label Filter (with a minimum count of 5 and a buffer size of 10). The processed class label (i.e. the output of the Class Label Filter) can be seen in red with the unprocessed predicted class label (i.e. the output of the ANBC algorithm) shown in green. Note that although the Class Label Filter correctly removes all the sporadic prediction values, there is a small lag in the actual class label being correctly predicted at the start of the test. This is due to the minimum count value, which was set to 5.

The Class Label Filter module is controlled through two parameters: the minimum count value and buffer size value. The minimum count sets the minimum number of class label values that must be present in the class labels buffer for that class label value to be output by the Class Label Filter. The size of the class labels buffer is set by the buffer size parameter. If there is more than one type of class label in the buffer then the class label with the maximum number of instances will be output. If the maximum number of instances for any class label in the buffer is less than the minimum count parameter then the Class Label Filter will output the default null rejection class label of 0. The minimum count and buffer size parameters can be set using the setMinimumCount(UINT minimumCount) and setBufferSize(UINT bufferSize) methods.

The Class Label Filter module is part of the GRT post-processing modules.

##Advantages The Class Label Filter is a useful post-processing module for removing sporadic prediction spikes on a continuous stream of data.

##Disadvantages The main limitation of the Class Label Filter is that is causes a small delay in the classification of a new gesture, as the gesture must be seen N times before it will be recognized, where N is set by the Class Label Filter's minimum count parameter. This disadvantage is not a major limitation if your sensor runs at a high sample rate (i.e. 100Hz) or if the minimum count parameter is small, but this can be an issue if you require a very responsive (i.e. low latency) recognition system.

#Example Code Class Label Filter Example