MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / compute_froc_score

Function compute_froc_score

monai/metrics/froc.py:158–175  ·  view source on GitHub ↗

This function is modified from the official evaluation code of `CAMELYON 16 Challenge `_, and used to compute the challenge's second evaluation metric, which is defined as the average sensitivity at the predefined false positive rates per who

(
    fps_per_image: np.ndarray, total_sensitivity: np.ndarray, eval_thresholds: tuple = (0.25, 0.5, 1, 2, 4, 8)
)

Source from the content-addressed store, hash-verified

156
157
158def compute_froc_score(
159 fps_per_image: np.ndarray, total_sensitivity: np.ndarray, eval_thresholds: tuple = (0.25, 0.5, 1, 2, 4, 8)
160) -> Any:
161 """
162 This function is modified from the official evaluation code of
163 `CAMELYON 16 Challenge <https://camelyon16.grand-challenge.org/>`_, and used to compute
164 the challenge&#x27;s second evaluation metric, which is defined as the average sensitivity at
165 the predefined false positive rates per whole slide image.
166
167 Args:
168 fps_per_image: the average number of false positives per image for different thresholds.
169 total_sensitivity: sensitivities (true positive rates) for different thresholds.
170 eval_thresholds: the false positive rates for calculating the average sensitivity. Defaults
171 to (0.25, 0.5, 1, 2, 4, 8) which is the same as the CAMELYON 16 Challenge.
172
173 """
174 interp_sens = np.interp(eval_thresholds, fps_per_image[::-1], total_sensitivity[::-1])
175 return np.mean(interp_sens)

Callers 2

evaluateMethod · 0.90
test_valueMethod · 0.90

Calls 1

interpMethod · 0.80

Tested by 1

test_valueMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…