
Define the search before choosing the score
A detector produces a score; an operational search produces a list of locations that someone must inspect. Those are different objects of evaluation. A hyperspectral target might occupy several pixels, one mixed pixel, or an object whose outline is uncertain. Decide whether success means identifying target-bearing pixels, locating physical objects, or retrieving candidate regions for later inspection before choosing a curve.
This guide considers a binary score on a fixed, labelled search mask. Higher scores indicate stronger evidence for a specified target. The target spectrum, background-fitting data, valid-band mask and any spatial post-processing must already be fixed. The examples below are constructed arithmetic, not results from a dataset or a proposed detector. For the distinction between material abundance and a hard class, start with mixed pixels and unmixing.
Write the denominator down. Does the mask include shadows, unlabelled surfaces, image borders and other plausible distractors? Removing difficult regions reduces the search problem. That can be legitimate when the deployment system has the same exclusion rule, but the reported result then applies only to that restricted mask.
A million pixels can turn a small rate into a long queue
Consider a synthetic evaluation containing 100 positive pixels and 999,900 negative pixels. At one threshold the detector recovers 80 positives and flags 100 negatives. Recall is 80/100 = 80%. The false-positive rate is 100/999,900, approximately 0.0100%. Precision is only 80/(80 + 100), approximately 44.4%. A very small background rate can coexist with more false detections than true detections.
If another threshold recovers 70 positives with 10 false positives, recall falls to 70% while precision rises to 87.5%. Neither operating point is universally better. A screening task that can review 180 flagged pixels may prefer the first; a constrained inspection budget may favour the second. These counts concern pixels. Adjacent false-positive pixels may form one candidate object, so inspection workload requires a separate grouping rule.
The relationship follows directly from the confusion matrix. If prevalence is π, true-positive rate is t and false-positive rate is f, precision equals πt divided by πt + (1 − π)f. Holding t and f fixed while changing prevalence changes precision. Therefore a target-enriched test subset cannot be presented as the expected precision across a much larger natural scene.
| Operating point | True positives | False positives | Recall | Precision |
|---|---|---|---|---|
| A | 80 | 100 | 80% | 44.4% |
| B | 70 | 10 | 70% | 87.5% |
Use ROC and precision–recall for different questions
A receiver operating characteristic curve relates target recall to the fraction of negatives flagged as the threshold changes. A precision–recall curve relates recovery to the composition of the returned candidates. Davis and Goadrich analyse their relationship and explain why interpolation in precision–recall space needs care. Neither curve substitutes for a declared operating threshold and actual counts. [1]
Saito and Rehmsmeier illustrate how precision–recall plots expose retrieval quality under class imbalance. Their examples reinforce the need to inspect the composition of returned candidates when negatives greatly outnumber positives. This does not make ROC mathematically invalid; the operational question determines which parts of the evaluation deserve emphasis. [4]
For rare targets, inspect the low-false-alarm region directly. A full ROC area averages behaviour over thresholds that may produce unusably many alerts. Report the requested range and the convention used for any partial area. Pair the curve with recall at several prespecified false-alarm budgets, retaining the achieved counts rather than only rounded rates.
Average precision also needs an exact definition. The scikit-learn implementation weights precision by increments in recall and does not use trapezoidal interpolation between precision–recall points. Report the implementation and version so that an apparent improvement is not a change of integration rule. Do not compare two values called PR-AUC until their definitions agree. [2]
Choose the threshold using development data
A test curve describes how the test scores rank labelled examples. Selecting the best threshold on that same curve uses test labels and produces an optimistic deployment claim. Choose an operational threshold on development data, record it, and apply it unchanged to the held-out search. You can still show the full test curve as a descriptive ranking analysis while keeping the fixed-threshold result distinct.
A background quantile can define a threshold when positive development examples are scarce. Its interpretation depends on the background sample representing future negative conditions. A threshold fitted to clean vegetation may behave differently on roofs, shadows or another sensor. Specify whether background estimation uses the current unlabelled scene. That is a transductive setting and should be disclosed.
Keep tied scores together. For a rule score ≥ threshold, every observation with that score enters at once; there may be no attainable operating point with exactly the requested number of false alarms. The ROC implementation returns thresholds with corresponding rates, but it cannot create a physically real intermediate ranking among tied pixels. Report the nearest admissible threshold under the stated budget. [3]
Sources: [3]
Translate the denominator into search area and effort
False-positive rate is useful for a statistical comparison, but analysts often need false alerts per image or per square kilometre. Save the valid search area and the physical pixel footprint. For a projected equal-area grid, area can be computed from valid pixels and pixel area; for other georeferencing, use an appropriate area calculation rather than assuming every pixel covers the same ground.
If connected detections are reported as candidates, freeze connectivity, score aggregation, minimum size and suppression rules before evaluation. Calculate both pixel-level and candidate-level results. A method that produces one large false-positive region and another that produces 100 isolated points can have the same false-positive pixel count but very different workloads.
Include negative-only scenes where possible. They reveal how the system behaves when there is nothing to find. Recall is undefined for such a scene, but false-alert count and search area remain meaningful. Do not assign perfect recall or silently remove the scene from the false-alarm analysis.
Audit what the positive label actually means
A cloth panel visible in high-resolution reference imagery may overlap several coarse hyperspectral footprints. A polygon rasterisation rule, centre-point rule and abundance threshold can yield different positive masks. Document the rule and keep it identical across methods. If reference alignment is uncertain, report a prespecified sensitivity analysis rather than shifting the labels until detections look correct.
The background definition matters just as much. Unlabelled pixels are not necessarily confirmed negatives. A false alarm may be an unannotated instance of the material, or a genuinely confusing different material. Keep uncertain regions separate where the benchmark allows it, and disclose the resulting coverage. Do not use a model score alone to relabel its own apparent errors.
For object-level matching and localisation tolerance, use the object-evaluation guide. For spectral transfer problems, the domain-shift guide explains why a strong same-scene ranking does not establish robustness across acquisition conditions.
Release an operating-point record that can be checked
A compact report includes the target definition, scene and search mask, positive and negative counts, target prevalence, target-reference source, preprocessing fit scope, score direction, threshold-selection rule, fixed threshold and resulting confusion counts. Add curves with clearly labelled axes and a table translating false alarms into physical search area or reviewable candidates.
Preserve predictions before and after any spatial filtering. Report the threshold and post-processing configuration together because they jointly determine the result. Save the exact score array or a documented reproducible equivalent, reference-mask version, valid-mask hash and evaluation-script revision. This makes it possible to inspect a claimed gain without reconstructing hidden decisions.
Finally, separate observed counts from guarantees. Seeing no false alarms on a finite test region does not prove that the deployment false-alarm rate is zero. Spatially clustered backgrounds, limited scenes and domain shift restrict what the evaluation supports. A useful detector report shows what was searched, what was recovered and what an operator would actually have to examine.
Frequently asked questions
Is ROC-AUC useless for rare targets?
No. It describes ranking across false-positive rates, but a whole-curve summary may hide the low-false-alarm region relevant to the task. Include that region, precision–recall and fixed-threshold counts.
Can I select a threshold with the test labels?
You may describe the test curve, but a threshold chosen from its labels is not an independently validated operating point. Select deployment thresholds using development data.
Are false-positive pixels the same as false alerts?
Only if every pixel is an independent candidate. Any grouping, suppression or localisation rule must be specified and evaluated separately.
References and further reading
Reader feedback
Reads since 1 October 2026: at least 15 seconds with the article visible, counted once per browser per day. Reactions are anonymous and can be changed.
Loading reader feedback…
Discuss this article
Ask a technical question, challenge an assumption or share evidence from your own work.