laodar / tf_CapsNet

A tensorflow implementation for CapsNet
20 stars 12 forks source link

more details about the segmentation #2

Open Qinying-Liu opened 6 years ago

Qinying-Liu commented 6 years ago

I wonder if you can tell us how to segment overlapping digits as showed in your file "readme.md" . I haven't found the part correspond to segmentation in your code.Can you share the relevant code? Your reply would be highly appreciated.

laodar commented 6 years ago

@canbaoburen I directly segment the input by separately reconstructing the two most likely digits, because if CapsNet works like what Hinton expects, the two longest DigitCaps Vectors will separately describe enough information about the digit, so actually the segmentation is done by the encoder, the encoder will separately describe two digit by its dynamic routing. this is why the paper said CapsNet will fail when there are two handwritten digits with same number, we only have one DigitCaps Vector for each number, the routing will fail, their information will crowd together.

in my code, i directly select the two DigitCaps vectors according to the label, because if the accuray is high enough, the two most likely number predicted by CapsNet will be nearly the same as label.

Qinying-Liu commented 6 years ago

@laodar Thanks a lot.I think I've got your point and I'm going to read your code more carefully.Thanks!