Compute detection thresholds