nbn03
October 8, 2024, 1:26pm
1
Hello community!
I am working on yolov8 object detection model. I have a data of around 1800 images (and their corresponding labels). I trained the data on pretrained yolov8-m weights for 70 epochs. After the training I got my best.pt weight file. I got decent detections with weight file.
For transfer learning, I used this best.pt file and trained around 2000 images (and their corresponding labels) on that weight file for 50 epochs. Now, when I am doing the detection, there is a significant accuracy drop. When I read a few forums and articles, the concept of freezing the layers is iterated. But there is no information on how many layers needs to be freezed and why do we need to freeze the layers.
If anyone knows about this concept, It would be great if you share your insights
1 Like
I have no idea, so I went searching.
opened 02:41PM - 15 Aug 24 UTC
closed 07:24AM - 17 Aug 24 UTC
question
segment
### Search before asking
- [X] I have searched the Ultralytics YOLO [issues](ht… tps://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) and found no similar questions.
### Question
I'm currently working with the [YOLOv8x-seg] (yolov8x-seg.pt) model trained for building footprints segmentation and am setting up transfer learning for a different region. I need some clarification on freezing layers during training and how it affects the model.
Backbone Layers Count:
How many layers are there in the backbone of the YOLOv8x-seg model?
Correct Freeze Value for Backbone:
I have set freeze=12 in my training configuration to freeze the first 12 layers. Does this include all layers in the backbone? If not, what is the correct freeze value to freeze the entire backbone?
Layer Sections for freeze=12:
When using freeze=12, which sections (backbone, neck, head) do the frozen layers belong to?
Freezing Backbone + Neck Layers:
Should I freeze only the backbone layers, or should I also consider freezing the neck layers for transfer learning? What is the correct freeze value to freeze both the backbone and neck layers during training?
Impact on Model Accuracy:
How does freezing just the backbone versus freezing both the backbone and neck layers impact model accuracy, particularly Recall?
Your guidance on these points would be highly appreciated as I aim to enhance Recall for my new region.
### Additional
_No response_
opened 02:58AM - 28 Mar 24 UTC
closed 05:51AM - 28 Mar 24 UTC
question
### Search before asking
- [X] I have searched the YOLOv8 [issues](https://gith… ub.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) and found no similar questions.
### Question
I noticed that when we load pre-trained models for further training, we always freeze the dfl conv layers. Why is it necessary for us to do this? Are there any theoretical grounds or research papers that can substantiate this practice?
here is the implementation in code:
https://github.com/ultralytics/ultralytics/blob/3aeb058e824655650a21e1f447d8711990accdc7/ultralytics/engine/trainer.py#L253
### Additional
_No response_