# Swin without Classification Head

**URL:** <https://discuss.huggingface.co/t/swin-without-classification-head/18866>\
**Category:** Beginners\
**Created:** [June 8, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/swin-without-classification-head/18866 "2022-06-08T16:35:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulYoung](https://avatars.discourse-cdn.com/v4/letter/p/6bbea6/32.png) [@PaulYoung](https://discuss.huggingface.co/u/PaulYoung)\
**Post date:** [June 8, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/swin-without-classification-head/18866/1 "2022-06-08T16:35:28Z")

</div>

Are each of these models atomic building blocks or can I dissect them at all? For example, I would like to use the Swin image transformer [microsoft/swin-base-patch4-window7-224 · Hugging Face](https://huggingface.co/microsoft/swin-base-patch4-window7-224) but leave out the classification head to only output the embedding. However, it appears the model goes straight from inputs to logits. Is breaking up a model to get the embedding possible?

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [June 8, 2022, 5:05pm UTC](https://discuss.huggingface.co/t/swin-without-classification-head/18866/2 "2022-06-08T17:05:32Z")

</div>

Hi! You can load this model as follows:

```python
from transformers import SwinModel
SwinModel.from_pretrained("microsoft/swin-base-patch4-window7-224")

```

if you are are only interested in the “raw” model and not the classification head.
