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)
)
| 156 | |
| 157 | |
| 158 | def 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'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) |
searching dependent graphs…