# Modifying yolo11 architecture to have one backbone and 2 necks and heads

**URL:** <https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846>\
**Category:** Discussion\
**Tags:** discussion, question, yolo, code, support\
**Created:** [March 13, 2025, 8:29am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846 "2025-03-13T08:29:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![big\_tree](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/big_tree/32/630_2.png) [@big\_tree](https://community.ultralytics.com/u/big_tree)\
**Post date:** [March 13, 2025, 8:29am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/1 "2025-03-13T08:29:59Z")

</div>

Hi,  
I am interested in modifying the architecture of yolo11. I want to keep the backbone as it is, and attach it to 2 necks and heads. My goal is to freeze the pretrained backbone and train the two necks to detect different objects. Can anyone explain in detail how this can be done. So far I haven’t managed to find too many discussions on modifying yolo11.

Thanks

---

<div class="post-metadata">

**Author:** ![BurhanQ](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/burhanq/32/7_2.png) [@BurhanQ](https://community.ultralytics.com/u/BurhanQ)\
**Post date:** [March 13, 2025, 9:26am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/2 "2025-03-13T09:26:22Z")

</div>

Yeah, you won’t because the number of ways people want to modify a model are so varied that there could never be a way to write a “guide” how to do it. Most models are developed by testing various configurations, so your best best is to test things out yourself.

The big question to consider is why have two heads? You can train a single head model that can detect multiple classes.

---

<div class="post-metadata">

**Author:** ![big\_tree](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/big_tree/32/630_2.png) [@big\_tree](https://community.ultralytics.com/u/big_tree)\
**Post date:** [March 14, 2025, 4:21am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/3 "2025-03-14T04:21:01Z")

</div>

Thanks for your response. I am not looking for a “guide” for this. However, it would be great if you could share something general about how modifications can be mode to the architecture. For instance, do I need to play around with certain files for this?

---

<div class="post-metadata">

**Author:** ![pderrenger](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/pderrenger/32/73_2.png) [@pderrenger](https://community.ultralytics.com/u/pderrenger)\
**Post date:** [March 15, 2025, 1:57am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/4 "2025-03-15T01:57:53Z")

</div>

Hello big\_tree,

To modify the YOLO11 architecture, you’ll primarily be working with the model configuration YAML file. This file defines the structure of the model, including the backbone, neck, and head. You can create a custom YAML file that specifies one backbone and two necks and heads.

The `parse_model` function, found in `ultralytics/nn/tasks.py`, processes this YAML file to construct the PyTorch model. You can examine the logic in `parse_model` to understand how the different modules defined in your configuration file are created and connected. The function iterates through the layers defined in the `"backbone"` and `"head"` sections of your YAML, instantiating the corresponding PyTorch modules.

You can define two separate heads and necks in your configuration file by adding entries in the `head` portion of the YAML, each with its own structure. Refer to the `tasks - Ultralytics YOLO Docs` for how to do this.

Remember to adjust input and output channels appropriately to ensure compatibility between the layers.

---

<div class="post-metadata">

**Author:** ![BurhanQ](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/burhanq/32/7_2.png) [@BurhanQ](https://community.ultralytics.com/u/BurhanQ)\
**Post date:** [March 16, 2025, 1:13pm UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/5 "2025-03-16T13:13:04Z")

</div>

Might be good to reference some of the examples modifications in this repo.

> **[GitHub - Y-T-G/community: Repository containing community-contributed...](https://github.com/Y-T-G/community)**
>
> Repository containing community-contributed Ultralytics model configs.

There’s a lot to consider when it comes to modifying the model layers. The simplest way would be to modify the YAML config for each model without changing a layer type (unless it exists in the `nn/modules` already). You can try changing the parameters or remove layers, but it’s likely to break things more often than not.

---

<div class="post-metadata">

**Author:** ![Sahil\_Sandal](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/sahil_sandal/32/638_2.png) [@Sahil\_Sandal](https://community.ultralytics.com/u/Sahil_Sandal)\
**Post date:** [August 11, 2025, 11:15pm UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/6 "2025-08-11T23:15:55Z")

</div>

Hi Burhan,

I’m currently working with the YOLOv11m architecture and exploring some architectural modifications for my project. Specifically, I wanted to ask:

Is it possible to replace the **C3k2** block in YOLOv11 (YOLOv11m version) with a different block, such as `C2f` or a custom-designed module?

If so, could you please guide me on:

1. Which parts of the model YAML or source code would need modification?

2. Any considerations or constraints when replacing this block (e.g., channel compatibility, depth, computational impact)?

---

<div class="post-metadata">

**Author:** ![BurhanQ](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/burhanq/32/7_2.png) [@BurhanQ](https://community.ultralytics.com/u/BurhanQ)\
**Post date:** [August 12, 2025, 12:28pm UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/7 "2025-08-12T12:28:35Z")

</div>

@Sahil_Sandal yes it’s _likely_ possible, however I can’t give specific guidance as I’m not well versed in making modifications to the model structure/layers. Generally, modifications are done with a specific intent and planned outcome, but should be done either for academic reasons or if there is no other viable means to accomplish the goal. It’s because making modifications to the model structure can be very time consuming to produce a valid result, and even more so to achieve a specific outcome.

You will not find many “guides” that will help you here, because it will always vary on a case by case basis. That means what works for me or someone else, may not necessarily work for you. Most people arriving at the conclusion that they _need_ to modify the model, already know how to do so. Anyone who doesn’t, usually will have to spend a fair amount of time researching, learning, and gaining an understanding of how to design and connect model layers.

I can point you to one resource however that may be helpful. You mentioned YOLO11m and the `C3k2` block and having an interest in replacing it with a `C2f` module. The [YOLOv8 model](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v8/yolov8.yaml) uses the `C2f` module instead of the `C3k2` module, so that would be a good place to start as a point of reference. That should give you a good starting point, along with the [module definitions](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/nn/modules) in the source code.

---

<div class="post-metadata">

**Author:** ![alin1120](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/alin1120/32/1478_2.png) [@alin1120](https://community.ultralytics.com/u/alin1120)\
**Post date:** [May 15, 2026, 11:11am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846/8 "2026-05-15T11:11:04Z")

</div>

@big_tree Did you implement one backbone and 2 heads architecture? If you completed, I want to share the methods you did. thanks
