ScenarioTest evaluates the attached metrics on all predictions and annotations of the selected dataset items in a slice. We introduced data filters in order to let the users specify the test data for evaluations in a more granular way. Using these filters, users can specify exactly which annotations and predictions to take into account for the tests.
Data filter types
The test data can be either filtered using aFieldFilter or a MetadataFilter. As the name suggests, a FieldFilter is applied on the attributes of annotations or predictions, e.g. the label class. A MetadataFilter is applied on the metadata stored in the key-value store within the annotations and predictions.
Applying filters to tests
The filters are attached to the tests by passing them as arguments of the evaluation functions. A test is defined on a selection of dataset items (through aSlice), while each evaluation can further filter down the specific data taken into account to compute the evaluation metrics. Therefore, a user could apply different filters to different evaluation functions.
Filters are defined in a disjunctive normal form where the inner filter lists are combined via AND and the outer one (if defined) combines the inner lists with an OR. Written out in a SQL fashion it combines to a (cond AND cond AND cond ...) or (cond AND cond AND cond ...) or ... manner, as shown in the example for a 3D / cuboid dataset below:
Segmentation specific filters
We have two specific filter typesSegmentFieldFilter and SegmentMetadataFilter for Segmentation masks. These filter the underlying data based on information on the Segment annotations for the SegmentationAnnotation and SegmentationPrediction.
If an annotation_filter is applied to a segmentation function you are instructing it to ignore the areas in the image that don’t pass the filter conditions. No false positives or false negatives will be counted in the areas filtered out.
The filter annotation_filters=[SegmentFieldFilter('label', 'not in', ['sky', 'tree'])] will ignore the areas annotated with the labels sky and tree.
Filter ground truth annotations
prediction_filter is applied to a segmentation filter we’re ignoring certain predictions for the aggregate. If we want to specifically monitor performance on animals we can set up the filter prediction_filters=[SegmentFieldFilter('label', 'in', ['cat', 'dog', 'animal'])].
annotation_filters and prediction_filters can be combined to create very specific performance metrics.