Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better ratio offset needed in DenseBlockClassifierFromX0s #139

Open
GilesStrong opened this issue Oct 6, 2022 · 0 comments
Open

Better ratio offset needed in DenseBlockClassifierFromX0s #139

GilesStrong opened this issue Oct 6, 2022 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed high priority Should be fixed asap Inference Issue affects the quality of inference Optimisation Issue affects the optimisation of the detector

Comments

@GilesStrong
Copy link
Owner

State

DenseBlockClassifierFromX0s computes a summary statistic to quantify the presence of a dense block of material from PoCA X0 predictions by comparing the mean X0 of the m lowest X0 predictions (L) against the mean of the n-m highest predictions (H), where m corresponds to the expected number of voxels in the dense material: r = 2*(H-L)/(H+L)
For compatibility with binary cross-entropy (BCE), this r must be between 0 and 1. Currently this is achieved by passing r through a sigmoid function, after an optional rescaling via a user-provided offset (o) and coefficient (c): r <- (r+o)*c.

Problem

The value of the BCE is sensitive to the position and scale of the summary statistic s = sigmoid(r), however the ROC AUC metric is not. Below are values of r simulated by drawing samples from a pair of Guassians, which are well separated. Prior to computing s, the values under go transformations which shift or rescale their values:
image
image

In both cases, the ROC AUC (separation between the two classes) remains the same, however the value of the BCE can change. This means that minimising the BCE doesn't necessarily lead to better classification power, e.g.:
image
Although the "optimised" detector produces a much worse ROC AUC, it has a smaller loss than the initial configuration simply due to its summary statistic being in a more central location.

Potential ideas

Ensuring that (for an equal probability of class 0 or 1) the distribution of s is centred on 0.5 should then allow the optimisation process to purely focus on separating the prediction. However since the loss of a batch of volumes is computed on a volume-wise basis, DenseBlockClassifierFromX0s cannot compute e.g. the mean of the current PDF for r. Additionally, we want to avoid the user needed to tune offsets and coefficients manually.

An idea could be to either learn the offset as a parameter to be optimised, or track a running average of the past values for r (pre-offset), and use this to set offset value used. Either a moving window, or exponential decay could be used to keep the offset up to date with the detector configuration.

@GilesStrong GilesStrong added bug Something isn't working help wanted Extra attention is needed high priority Should be fixed asap Inference Issue affects the quality of inference Optimisation Issue affects the optimisation of the detector labels Oct 6, 2022
@GilesStrong GilesStrong added this to To do (Essential) in Publication 1: Detector Optimisation via automation Oct 6, 2022
@GilesStrong GilesStrong added this to To do (Essential) in ULorry benchmark via automation Oct 6, 2022
@GilesStrong GilesStrong self-assigned this Dec 8, 2022
@GilesStrong GilesStrong moved this from To do (Essential) to In progress in ULorry benchmark Dec 9, 2022
@GilesStrong GilesStrong moved this from To do (Essential) to In progress in Publication 1: Detector Optimisation Dec 9, 2022
@zahraadaher zahraadaher moved this from In progress to To do (Essential) in ULorry benchmark Oct 25, 2023
@zahraadaher zahraadaher moved this from To do (Essential) to In progress in ULorry benchmark Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed high priority Should be fixed asap Inference Issue affects the quality of inference Optimisation Issue affects the optimisation of the detector
Development

No branches or pull requests

1 participant