Adding a new head to the YOLO11n model to detect very small objects

Thank you for your inputs.

I will try YOLO11n customization for GhostConv. However, if you find any Yolo11n based GhostConv YAML file, please share.

Best Regards,
Venkat

Hello Venkat,

Thanks for following up. As mentioned previously, adapting modules like GhostConv and C3Ghost (often used in YOLOv8 contexts) to the YOLO11 architecture requires careful handling due to differences, particularly with blocks like C3k2 and C2PSA used in YOLO11.

We don’t have an official, pre-validated yolo11n-ghost.yaml prototype available. Creating custom architectures by swapping modules often involves meticulous adjustments to ensure layer compatibility, correct channel counts, and proper tensor shapes throughout the network, as indicated by the TypeError you encountered.

Debugging these custom YAML files typically involves verifying the arguments and expected input/output dimensions for each layer, ensuring they align correctly, especially at connection points like Concat. Comparing your modified YAML structure against the standard yolo11n.yaml might help identify where the dimension mismatch is occurring.

Good luck with your experimentation!

Hi @pderrenger,

When doing such modifications to the architecture (i.e. modifying the neck and head, but not the backbone), how necessary would it be to train the whole model from scratch? I mean, would it be possible to freeze the backbone layers and train only the head from scratch without compromising accuracy?

In general, it’s always best to run the experiment to answer these types of questions. It’s very likely that you can freeze the backbone layers during training, even with modifications other layers (outside of the backbone) and retain the original weights. The reason why an experiment would be the best way to answer your question, is because depending on the specific changes you make and the dataset you’re using, there could be performance loss.

My recommendation would be to train against your custom dataset using a standard YOLO model, same version and scale, with a frozen backbone, so you have a basis of comparison. Then make your modifications and train the modified model with a frozen backbone against your custom dataset. If the performance is sufficient compared to the standard model, then it’s up to you if you want to continue testing. If performance is not as good as the standard YOLO model, then you can try training on your custom dataset with the modified YOLO model without freezing any layers. Additionally, you could train a standard YOLO model with no layers frozen on your custom dataset.

The reason to do this, is that the final test (modified model without frozen layers) will demonstrate how the modifications to the model structure changes the model performance. Like I mentioned, if you hit your performance target before then, it’s up to you if you want to continue testing.