MIC-DKFZ / nnDetection

nnDetection is a self-configuring framework for 3D (volumetric) medical object detection which can be applied to new data sets without manual intervention. It includes guides for 12 data sets that were used to develop and evaluate the performance of the proposed method.
Apache License 2.0
553 stars 97 forks source link

[Bug] Lower boundary of clipping needs to be -1 #23

Open JiaminRen opened 3 years ago

JiaminRen commented 3 years ago

:skull: Bug

Environment

Please provide some information about the used environment.

How was nnDetection installed [docker | source]:

Environment Information:

[paste here]

If necessary, please provide the used run command with all overwrites:

[paste here]
JiaminRen commented 3 years ago

https://github.com/MIC-DKFZ/nnDetection/blob/3416b80cc90346349951dcc805b260f72b80fc16/nndet/io/transforms/instances.py#L126 Plus one and minus one may exceed the image boundary.

mibaumgartner commented 3 years ago

Hi @JiaminRen ,

the transformation intends to provide a generic bounding box representation and no special handling of image borders is done here on purpose, i.e. if the object starts at index 0 of the image, the network is expected to output a bounding box starting at -1 (the same principle applies to the other image borders as well).

Clipping to 0 would introduce an ambiguity because objects starting at index 1 and at index 0 would be mapped to a bounding box starting at 0. Removing +-1 is also difficult since this could lead to objects with 0 sizes. As a result, we used the above rule without clipping or any other modification.

There is an inconsistency in the detection postprocessing which I'll fix after the first release was tagged. The detection network outputs are currently clipped at 0 during inference, which needs to be corrected to -1. The performance difference should be rather small though.

(the corresponding line of code for the 3D case) https://github.com/MIC-DKFZ/nnDetection/blob/3416b80cc90346349951dcc805b260f72b80fc16/nndet/core/boxes/clip.py#L95-L100

Best, Michael

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 30 days with no activity.