Publishing 2019 R1 content
[platform/upstream/dldt.git] / tools / accuracy_checker / accuracy_checker / metrics / README.md
1 # Metrics
2
3 For correct work metrics require specific representation format. 
4 (e. g. map expects detection annotation and detection prediction for evaluation). 
5
6 In case when you use complicated representation located in representation container, you need to add options `annotation_source` and `prediction_source` in configuration file to
7 select specific representation, another way metric calculation possible only if container has only one suitable representation and will be resolved automatically.
8 `annotation_source` and `prediction_source` should contain only one annotation identifier and output layer name respectively.
9 You may optionally provide `reference` field for metric, if you want calculated metric tested against specific value (i.e. reported in canonical paper) and acceptable `threshold` for metric deviation from reference value.
10
11 Every metric has parameters available for configuration. 
12
13 Accuracy Checker supports following set of metrics:
14
15 * `accuracy` - classification accuracy metric, defined as the number of correct predictions divided by the total number of predictions.
16 Supported representation: `ClassificationAnnotation`, `ClassificationPrediction`
17   * `top_k` - the number of classes with the highest probability, which will be used to decide if prediction is correct.
18 * `accuracy_per_class` - classification accuracy metric which represents results for each class. Supported representation: `ClassificationAnnotation`, `ClassificationPrediction`.
19   * `top_k` - the number of classes with the highest probability, which will be used to decide if prediction is correct.
20   * `label_map` - the field in annotation metadata, which contains dataset label map.
21 * `character_recognition_accuracy` - accuracy metric for character recognition task. Supported representation: `CharacterRecognitionAnnotation`, `CharacterRecognitionPrediction`.
22 * `map` - mean average precision. Supported representations: `DetectionAnnotation`, `DetectionPrediction`.
23   * `overlap_threshold` - minimal value for intersection over union that allows to make decision that prediction bounding box is true positive.
24   * `overlap_method` - method for calculation bbox overlap. You can choose between intersection over union (`iou`), defined as area of intersection divided by union of annotation and prediction boxes areas, and intersection over area (`ioa`), defined as area of intersection divided by ara of prediction box.
25   * `include_boundaries` - allows include boundaries in overlap calculation process. If it is True then width and height of box is calculated by max - min + 1.
26   * `ignore_difficult` - allows to ignore difficult annotation boxes in metric calculation. In this case, difficult boxes are filtered annotations from postprocessing stage.
27   * `distinct_conf` - select only values for distinct confidences.
28   * `allow_multiple_matches_per_ignored` - allows multiple matches per ignored.
29   * `label_map` - the field in annotation metadata, which contains dataset label map.
30   * `integral` - integral type for average precision calculation. Pascal VOC `11point` and `max` approaches are available.
31 * `miss_rate` - miss rate metric of detection models.  Supported representations: `DetectionAnnotation`, `DetectionPrediction`.
32   * `overlap_threshold` - minimal value for intersection over union that allows to make decision that prediction bounding box is true positive.
33   * `overlap_method` - method for calculation bbox overlap. You can choose between intersection over union (`iou`), defined as area of intersection divided by union of annotation and prediction boxes areas, and intersection over area (`ioa`), defined as area of intersection divided by ara of prediction box.
34   * `include_boundaries` - allows include boundaries in overlap calculation process. If it is True then width and height of box is calculated by max - min + 1.
35   * `ignore_difficult` - allows to ignore difficult annotation boxes in metric calculation. In this case, difficult boxes are filtered annotations from postprocessing stage.
36   * `distinct_conf` - select only values for distinct confidences.
37   * `allow_multiple_matches_per_ignored` - allows multiple matches per ignored.
38   * `label_map` - the field in annotation metadata, which contains dataset label map.
39   * `fppi_level` - false positive per image level.
40 * `recall` - recall metric of detection models. Supported representations: `DetectionAnnotation`, `DetectionPrediction`.
41   * `overlap_threshold` - minimal value for intersection over union that allows to make decision that prediction bounding box is true positive.
42   * `overlap_method` - method for calculation bbox overlap. You can choose between intersection over union (`iou`), defined as area of intersection divided by union of annotation and prediction boxes areas, and intersection over area (`ioa`), defined as area of intersection divided by ara of prediction box.
43   * `include_boundaries` - allows include boundaries in overlap calculation process. If it is True then width and height of box is calculated by max - min + 1.
44   * `ignore_difficult` - allows to ignore difficult annotation boxes in metric calculation. In this case, difficult boxes are filtered annotations from postprocessing stage.
45   * `distinct_conf` - select only values for distinct confidences.
46   * `allow_multiple_matches_per_ignored` - allows multiple matches per ignored.
47   * `label_map` - the field in annotation metadata, which contains dataset label map.
48 * `detection_accuracy` - accuracy for detection models. Supported representations: `DetectionAnnotation`, `DetectionPrediction`.
49   * `overlap_threshold` - minimal value for intersection over union that allows to make decision that prediction bounding box is true positive.
50   * `overlap_method` - method for calculation bbox overlap. You can choose between intersection over union (`iou`), defined as area of intersection divided by union of annotation and prediction boxes areas, and intersection over area (`ioa`), defined as area of intersection divided by ara of prediction box.
51   * `include_boundaries` - allows include boundaries in overlap calculation process. If it is True then width and height of box is calculated by max - min + 1.
52   * `label_map` - the field in annotation metadata, which contains dataset label map.
53   * `use_normalization` - allows to normalize confusion_matrix for metric calculation.
54 * `segmentation_accuracy` - pixel accuracy for semantic segmentation models. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`.
55   * `use_argmax` - allows to use argmax for prediction mask.
56 * `mean_iou` - mean intersection over union for semantic segmentation models. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`.
57   * `use_argmax` - allows to use argmax for prediction mask.
58 * `mean_accuracy` - mean accuracy for semantic segmentation models. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`.
59   * `use_argmax` - allows to use argmax for prediction mask.
60 * `frequency_weighted_accuracy` - frequency weighted accuracy for semantic segmentation models. Supported representations: `SegmentationAnnotation`, `SegmentationPrediction`.
61   * `use_argmax` - allows to use argmax for prediction mask.
62 More detailed information about calculation segmentation metrics you can find [here][segmentation_article].
63 * `cmc` - Cumulative Matching Characteristics (CMC) score. Supported representations: `ReIdentificationAnnotation`, `ReIdentificationPrediction`.
64   * `top_k` -  number of k highest ranked samples to consider when matching.
65   * `separate_camera_set` - should identities from the same camera view be filtered out.
66   * `single_gallery_shot` -  each identity has only one instance in the gallery.
67   * `number_single_shot_repeats` - number of repeats for single_gallery_shot setting (required for CUHK).
68   * `first_match_break` - break on first matched gallery sample.
69 * `reid_map` - Mean Average Precision score for object reidentification. Supported representations: `ReIdentificationAnnotation`, `ReIdentificationPrediction`.
70   * `uninterpolated_auc` - should area under precision recall curve be computed using trapezoidal rule or directly.
71 *  `pairwise_accuracy` - pairwise accuracy for object reidentification. Supported representations: `ReIdentificationClassificationAnnotation`, `ReIdentificationPrediction`.
72   * `min_score` - min score for determining that objects are different. You can provide value or use `train_median` value which will be calculated if annotations has training subset.
73 * `pairwise_accuracy_subsets` - object reidentification pairwise accuracy with division dataset on test and train subsets for calculation mean score. Supported representations: `ReIdentificationClassificationAnnotation`, `ReIdentificationPrediction`.
74   * `subset_number` - number of subsets for separating. 
75 * `mae` - [Mean Absolute Error][mae]. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
76 * `mae_on_intervals` - Mean Absolute Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
77   * `intervals` - comma-separated list of interval boundaries.
78   * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal.
79   * `start` , `step`, `end` - way to generate range of intervals from `start` to `end` with length `step`.
80 * `mse` - [Mean Squared Error][mse]. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
81 * `mse_on_intervals` - Mean Squared Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
82   * `intervals` - comma-separated list of interval boundaries.
83   * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal.
84   * `start`, `step`, `end` - generate range of intervals from `start` to `end` with length `step`.
85 * `rmse` - [Root Mean Squared Error][rmse]. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
86 * `rmse_on_intervals` - Root Mean Squared Error estimated magnitude for specific value range. Supported representations: `RegressionAnnotation`, `RegressionPrediction`.
87   * `intervals` - comma-separated list of interval boundaries.
88   * `ignore_values_not_in_interval` - allows create additional intervals for values less than minimal value in interval and greater than maximal.
89   * `start`, `step`, `end` - generate range of intervals from `start` to `end` with length `step`.
90 * `per_point_normed_error` - Normed Error for measurement the quality of landmarks' positions. Estimated results for each point independently. Supported representations: `FacialLandmarksAnnotation`, `FacialLandmarksPrediction`.
91 * `normed_error` - Normed Error for measurement the quality of landmarks' positions. Supported representations: `FacialLandmarksAnnotation`, `FacialLandmarksPrediction`.
92   * `calculate_std` - allows calculation of standard deviation (default value: `False`)
93   * `percentile` - calculate error rate for given percentile.
94 * `per_point_regression` - Root Mean Squared Error for 2D points estimated results for each point independently. Supported representations: `PointRegressionAnnotation`, `PointRegressionPrediction`.
95   * `scaling_distance` - comma-separated list of 2 point indexes, distance between which will be used for scaling regression distances.
96 * `average point error` - Root Mean Squared Error for 2D points estimated average results for all points. Supported representations: `PointRegressionAnnotation`, `PointRegressionPrediction`.
97   * `scaling_distance` - comma-separated list of 2 point indexes, distance between which will be used for scaling regression distances.
98 * `multi_accuracy` - accuracy for multilabel recognition task. Supported representations: `MultiLabelRecognitionAnnotation`, `MultiLabelRecognitionPrediction`.
99   * `label_map` - the field in annotation metadata, which contains dataset label map.
100   * `calculate_average` - allows calculation of average accuracy (default value: `True`).
101 * `multi_precision` - precision metric for multilabel recognition. Supported representations: `MultiLabelRecognitionAnnotation`, `MultiLabelRecognitionPrediction`.
102   * `label_map` - the field in annotation metadata, which contains dataset label map.
103   * `calculate_average` - allows calculation of average precision (default value: `True`).
104 * `multi_recall` - recall metric for multilabel recognition. Supported representations: `MultiLabelRecognitionAnnotation`, `MultiLabelRecognitionPrediction`.
105   * `label_map` - the field in annotation metadata, which contains dataset label map.
106   * `calculate_average` - allows calculation of average recall (default value: `True`).
107 * `f1_score` - [F score][f_score] metric for multilabel recognition. Supported representations: `MultiLabelRecognitionAnnotation`, `MultiLabelRecognitionPrediction`.
108   * `label_map` - the field in annotation metadata, which contains dataset label map.
109   * `calculate_average` - allows calculation of average f-score (default value: `True`).
110 * `text_detection` - Harmonic mean of precision and recall for text detection task. Supported representations: `TextDetectionAnnotation`, `TextDetectionPrediction`.
111   * `iou_constrain` - minimal value for intersection over union that allows to make decision that prediction polygon is true positive.
112   * `ignore_difficult` - allows to ignore difficult ground truth text polygons in metric calculation.
113   * `area_precision_constrain` - minimal value for intersection over union that allows to make decision that prediction polygon matched with ignored annotation.
114 * `coco_precision` - MS COCO Average Precision metric for keypoints recognition and object detection tasks. Supported representations: `PoseEstimationAnnotation`, `PoseEstimationPrediction`, `DetectionAnnotation`, `DetectionPrediction`.
115   * `max_detections` - max number of predicted results per image. If you have more predictions,the results with minimal confidence will be ignored.
116   * `threshold` - intersection over union threshold. You can specify one value or comma separated range of values. This parameter supports precomputed values for standard COCO thresholds (`.5`, `.75`, `.5:.05:.95`).
117 * `coco_recall` - MS COCO Average Recall metric for keypoints recognition and object detection tasks. Supported representations: `PoseEstimationAnnotation`, `PoseEstimationPrediction`, `DetectionAnnotation`, `DetectionPrediction`.
118   * `max_detections` - max number of predicted results per image. If you have more predictions,the results with minimal confidence will be ignored.
119   * `threshold` - intersection over union threshold. You can specify one value or comma separated range of values. This parameter supports precomputed values for standard COCO thresholds (`.5`, `.75`, `.5:.05:.95`).
120 * `angle_error` - Mean angle error and Standard deviation of angle error for gaze estimation. Supported representations: `GazeVectorAnnotation`, `GazeVectorPrediction`.
121   
122 [segmentation_article]: https://arxiv.org/pdf/1411.4038v2.pdf
123 [mae]: https://en.wikipedia.org/wiki/Mean_absolute_error
124 [mse]: https://en.wikipedia.org/wiki/Mean_squared_error
125 [rmse]: https://en.wikipedia.org/wiki/Root-mean-square_deviation
126 [f_score]: https://en.wikipedia.org/wiki/F1_score
127 [psnr]: https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio