neuronets / kwyk

Knowing what you know - Bayesian brain parcellation
https://doi.org/10.3389/fninf.2019.00067
Apache License 2.0
20 stars 9 forks source link

segmented outside the brain? #25

Open soichih opened 3 years ago

soichih commented 3 years ago

Hello. I am testing kwyk (docker://neuronets/kwyk:version-0.4-gpu) on brainlife.io

I've noticed that the output segmentation/parcellation image contains areas outside the brain segmented.

Like this.. image Is this expected? Should I run bet or any preprocessing on the anatomy before running kwyk?

I've tried various models (bvwn_multi_prior, bwn_multi, bwn) and some models has more/less out-of-brain areas but none of them seem to be free from it.

kaczmarj commented 3 years ago

Interesting, thank you for reporting this. This is undesirable, but not really unexpected at the moment. Any chance you can share the input image? I wonder what features the model might be picking up outside of the brain.

Should I run bet or any preprocessing on the anatomy before running kwyk

At the moment, kwyk is meant to be used directly on the MRI. the only processing (done by kwyk) is to normalize the input image to mean 0 and std deviation 1.

One naive way to prevent this could be to remove segmentations outside of a brainmask (the brainmask could be made by a different algorithm). But a better solution would be to have the model learn more robust features of the brain scans. Adversarial training could help here.

satra commented 3 years ago

@soichih - in some cases i expect that. especially if there is a lot of fat in the scans. we are working on some improvements but those are still a month away.

a few options in the short term.

  1. you could run hd-bet fairly robust in most situations (https://github.com/MIC-DKFZ/HD-BET) and then run kwyk on the output. this is a contrast insensitive brain extractor

  2. you can also run brainy (our brain extractor, only works on T1 - same as kwyk) - https://github.com/neuronets/brainy

soichih commented 3 years ago

@kaczmarj @satra Thanks!

Here is the input image I've used (my brain)

https://dev1.soichi.us/tmp/t1.nii.gz

Please feel free to use this for your testing (it's my brain ACPC aligned)

I've ran the input data through HD-BET. The input now looks clean.

https://dev1.soichi.us/tmp/t1.bet.nii.gz

image

And here is the output from kwyk. I am no longer seeing voxels outside the brain, but the parcellation seems to be cropped on Left/Right edges.

image

I have a very oddly shaped brain, so it throws off different algorithms a lot.. (I think). :) My brain is pretty good at breaking things!

satra commented 3 years ago

@soichih -thanks. i'm going to add this to the support vector set of brains to use :) indeed this shows some weird effects. hopefully this will go away with the new training, but i will keep this in mind. cc: @Aakanksha-Rana and @Hoda1394