Skip to content

Speed up FROC curve computation #9231

Open

Description

@Don-Yin

compute_froc_curve_data compares every detection against every distinct score, so it's O(N²) when scores are mostly unique. Sorting once and counting with searchsorted gives the same arrays and is much faster (17× at 11k detections, 55× at 55k, single-thread CPU).

froc timing

i check and outputs matched exactly in 328 cases on NumPy 1.26 and 2.4. When all scores are equal it's a hair slower (0.03 ms). Happy to send a PR if this is welcome.

also happy to send over the test sscripts in that PR.

Disclosure: I used Pi with Claude Opus and GPT-6 for profiling and benchmarks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions