# Deep learning model for segmenting many of same things

**URL:** <https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280>\
**Category:** Support\
**Created:** [May 20, 2024, 3:57pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280 "2024-05-20T15:57:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 20, 2024, 3:57pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280/1 "2024-05-20T15:57:56Z")

</div>

This is not really Slicer related, but maybe relevant in context of upcoming PW.

Is anyone aware of a DL architecture that can be used to train and segment things that look similar, but doesn’t necessarily have a fixed count. Biological examples would be vertebra in fishes or snakes, tooth in alligators, crocodyles, salamanders, scales in lizards and many other animals, cell nuclei etc…

The idea would be the user would only label a few of those those in a given dataset, and the model would extract all of them, regardless of how many there are.

I don’t think current implementations of UNet would work, since you have to designate all the classes beforehand.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 20, 2024, 4:40pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280/2 "2024-05-20T16:40:41Z")

</div>

Have you tried the [Segment Anything Models? They take](https://github.com/mazurowski-lab/SlicerSegmentWithSAM). Seems like they would be well suited to this if you are able to provide some input about which structure you want.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [May 20, 2024, 5:18pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280/3 "2024-05-20T17:18:42Z")

</div>

It would be nice to have an AI that can segment all bones in a CT as separated structures on a single segment (this would need to ignore cartilage I guess). Then using islands effect you could separate them easily 🙂

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 20, 2024, 7:03pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280/4 "2024-05-20T19:03:30Z")

</div>

I tried sometime ago, but didn’t manage to get it working (neither as extension nor as GH).

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 20, 2024, 7:13pm UTC](https://discourse.slicer.org/t/deep-learning-model-for-segmenting-many-of-same-things/36280/5 "2024-05-20T19:13:47Z")

</div>

Agreed, there’s more work to be done but SAM seems like a good approach for what you asked.
