# Multi-label instance segmentation

**URL:** <https://discuss.pytorch.org/t/multi-label-instance-segmentation/152233>\
**Category:** vision\
**Created:** [May 20, 2022, 10:35pm UTC](https://discuss.pytorch.org/t/multi-label-instance-segmentation/152233 "2022-05-20T22:35:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AviPeltz](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/avipeltz/32/49822_2.png) [@AviPeltz](https://discuss.pytorch.org/u/AviPeltz)\
**Post date:** [May 20, 2022, 10:35pm UTC](https://discuss.pytorch.org/t/multi-label-instance-segmentation/152233/1 "2022-05-20T22:35:42Z")

</div>

Hi all,  
I’m an undergrad working on my senior project which is building a vision-based strawberry inspection system. I used detectron2 to train a model to detect instances of strawberries of various classes in images, prior to that I also trained a model to just identify strawberries in images(which I used to do model-assisted labeling to build the dataset i’m using). But I was wondering if there was a relatively easy way to modify the Mask R-CNN architecture to attach multiple class labels to an given object.  
This would be useful for this use-case because I want to identify all the instances of strawberries in the image, but I also want to tag each berry with quality criteria i.e. (green, underripe, overripe, damaged, moldy,… ) there are a lot of berries that have overlapping quality criteria and having the model infer the dominant class seems like a much more noisy problem to solve. Any help would be greatly appreciated!

Thanks!

---

<div class="post-metadata">

**Author:** ![Andrei\_Cristea](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/andrei_cristea/32/47843_2.png) [@Andrei\_Cristea](https://discuss.pytorch.org/u/Andrei_Cristea)\
**Post date:** [May 21, 2022, 12:01am UTC](https://discuss.pytorch.org/t/multi-label-instance-segmentation/152233/2 "2022-05-21T00:01:34Z")

</div>

Hi Avi, cool project! The easiest approach might be to train a separate image classification model that can classify strawberries into the categories you’re interested in, and in the inference stage just run this second model on your detectron2 output. Is there a particular reason you’re looking to combine both in the same model instead of taking this easier road?
