lfz / DSB2017

The solution of team 'grt123' in DSB2017
MIT License
1.23k stars 420 forks source link

Question about isRand in data_detector.py #121

Open judyamilas opened 4 years ago

judyamilas commented 4 years ago

Hi, sir,

My name is Judy and I am new to deep learning. I want to ask a question about the isRand parameter in your code.

Looks like if isRand = 1, you’ll randomly crop a patch from the image and use the randomly cropped patch as a negative sample. Why? I notice in your code (in Crop function) when isRand is true, target is set to np.nan. And the crop is done randomly in the image. What if the cropped image contains nodules in the center? What’s the point for doing so?

Can I understand it as: given an input patch, the AI is learning that if at every point on the final feature map (32323235), any of the three anchors are overlapping enough with a given ground truth. If that’s the case, why doing random cropping from the image???

Question 2 is that if isRand is not true and there is a target in the patch, you define the start point of the cropped patch with a random shift between (-bound_size/2, bound_size/2). Since you define bound size as 12, the shift is only within -6 to 6mm. So the crop center will only deviate from the nodule center within 6mm in total. What if I’m testing, there is a nodule on the edge of a split block? You have 32*2=64 margin overlap but the side_len is 144. This means there will still be 80mm size unique within each single cropped box during testing.

Can you explain this to me? Highly appreciated sir!

学长您好,小妹是深度学习新手。想问两个问题。

  1. 您的data_detector里有个isRand参数。似乎随机到isRand=True时您就随机取block,并默认该block为负样本(target在crop函数里弱isRand为真会置为nan)。这是为什么?万一你不小心crop到了nodule怎么办?强行当作负样本来训练?这样做的意义是什么?

我是否可以理解为,你的网络是要学习:输入block之后,输出的block特征图(大小为32323235)上323232的每一点,是否存在一个anchor(预设3个里的一个),与ground truth有足够重合。有的话,这些点用于训练5个参数里的delta xyzd回归部分和p分类部分,没有重合的话,这些点用户训练p分类部分(负样本)。但这样理解我就更不明白你crop random Sample作为负样本的意义了。

  1. 若isRand不为随机,您在crop函数里计算取block的起点的时候会加一个(-bound_size/2,bound_size/2)的随机偏移。鉴于bound_size才12,这个偏移最多才6毫米。也就是说您的正样本多数情况下nodule都是在中间的。万一在测试时出现nodule在image block的边缘怎么办?你每个的block虽然与周围的block有2*32=64的重叠,但鉴于side_len为144,每个block依然有80的独特部分,远远大于六毫米。

想了半天百思不得其解,希望学长能教我一下。