Repository navigation
This release fixes a critical bug in the evaluation routine (namely the get_segmented_probs_and_targets function in utils.py). Certain conditions could lead to inflated average precision scores. The script failure_cases_of_legacy_metric_evaluator.py highlights scenarios in which this happened. The old evaluation function is still part of the repository but is now called legacy_get_segmented_probs_and_targets. The fix is a stand-in replacement that takes in the same input arguments and produces the same output.
The following table shows the expected results from the synthetic regression tests in failure_cases_of_legacy_metric_evaluator.py, comparing the legacy implementation against corrected event-level evaluation using one-to-one matching.
Count tuples denote (TP, FP, FN).
| Scenario | Legacy counts | Corrected counts | Legacy AP | Corrected AP |
|---|---|---|---|---|
| No detections | (0, 0, 2) | (0, 0, 2) | 1.00 | 0.00 |
| Failed IoU, low probability | (0, 0, 0) | (0, 1, 1) | 0.00 | 0.00 |
| Failed IoU, high probability | (0, 1, 0) | (0, 1, 1) | 0.00 | 0.00 |
| One long false detection | (0, 2, 0) | (0, 1, 2) | 0.00 | 0.00 |
| Two predictions, one call | (2, 0, 0) | (1, 1, 0) | 1.00 | 0.50 |
| One prediction, two calls | (2, 0, 0) | (1, 0, 1) | 1.00 | 0.50 |
| Perfect detection (control) | (1, 0, 0) | (1, 0, 0) | 1.00 | 1.00 |
The segmentation and confidence thresholds are set to 0.5. The IoU threshold is 0.5, except for the split and merger examples, where it is set to 0.2.
An erratum has been issued with Method in Ecology and Evolution. Published results with animal2vec are only slightly changed.