
TIDE-Style Prediction Error Decomposition for YOLO Models
Source:R/utils_yolo_diagnostics.R
yolo_error_analysis.Rdyolo_error_analysis() decomposes object detection errors into six mutually exclusive
canonical categories following the TIDE framework (Bolya et al., ECCV 2020). Comparing
predictions against ground-truth annotations across validation or test splits, it pinpoints
the exact bottlenecks of a model:
Classification Error (
Cls): The object was localized accurately (\(\text{IoU} \ge 0.50\)), but classified into the wrong category.Localization Error (
Loc): The object class was predicted correctly, but bounding box alignment was inaccurate (\(0.10 \le \text{IoU} < 0.50\)).Both Classification & Localization Error (
Both): Both class was wrong and localization was inaccurate (\(0.10 \le \text{IoU} < 0.50\)).Duplicate Detection Error (
Dup): Non-Maximum Suppression (NMS) failed to suppress a redundant candidate detection on an already matched ground-truth object (\(\text{IoU} \ge 0.50\)).Background Error (
Bkg): The model hallucinated an object on pure background with no nearby ground-truth entity (\(\text{IoU} < 0.10\)).Missed Ground Truth (
Miss): A true object in the field was completely overlooked by the detector (pure false negative, \(\text{IoU} < 0.10\) against all predictions of the same class).
Usage
yolo_error_analysis(
test_res = NULL,
model = NULL,
data = NULL,
split = "test",
iou_thresh = 0.5,
bg_thresh = 0.1,
plot = TRUE,
verbose = TRUE,
...
)
yolo_tide_analysis(
test_res = NULL,
model = NULL,
data = NULL,
split = "test",
iou_thresh = 0.5,
bg_thresh = 0.1,
plot = TRUE,
verbose = TRUE,
...
)Arguments
- test_res
An object of class
yolo_test(returned byyolo_test()), orNULLif evaluating directly withmodelanddata.- model
A trained model identifier or path (
.onnxor.pt). Used iftest_resisNULL.- data
Path to the YOLO dataset root directory. Used if
test_resisNULL.- split
Character string. Dataset split to evaluate:
"test"(default),"val", or"train".- iou_thresh
Numeric. IoU threshold for correct object localization. Defaults to
0.50.- bg_thresh
Numeric. Background IoU threshold. Detections with \(\text{IoU} < \text{bg\_thresh}\) against all ground-truth objects are considered pure background hallucinations. Defaults to
0.10.- plot
Logical. Whether to automatically render the error decomposition bar chart. Defaults to
TRUE.- verbose
Logical. Whether to display formatted progress and summary tables. Defaults to
TRUE.- ...
Additional arguments forwarded to
yolo_test()iftest_resisNULL.
Value
An S3 object of class c("yolo_error_analysis", "list") containing:
summary: Adata.framewith the 6 error categories, count of occurrences, percentage of all errors, and descriptions.by_class: Adata.frameof error counts and percentages broken down by object class.errors: A detaileddata.framelisting every individual error with image name, bounding box coordinates, error type, and score.metrics: A list of summary benchmark numbers (Total GT, Total Pred, TP, FP, FN, Precision, Recall).
References
Bolya, D., Foley, S., Hays, J., & Hoffman, J. (2020). TIDE: A general toolbox for identifying object detection errors. European Conference on Computer Vision (ECCV), pp. 558-573.