-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ASFF(Adaptively Spatial Feature Fusion) layers in Head for YoloV5 and some attention modules #2349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hello @positive666, thank you for submitting a 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with origin/master. If your PR is behind origin/master an automatic GitHub actions rebase may be attempted by including the /rebase command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature # <----- replace 'feature' with local branch name
git rebase upstream/master
git push -u origin -f
- ✅ Verify all Continuous Integration (CI) checks are passing.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee
@positive666 very interesting, thanks for the PR! Were you able to test the changes against the baseline models? |
@glenn-jocher Okay, I will continue to verify the change, the current change idea: provide some plug-and-play lightweight modules. And I'm still learning about transform to replace convolutional blocks in the paper. `` [-1, 1, Conv, [256, 1, 1]], [-1, 1, Conv, [256, 3, 2]], [-1, 1, Conv, [512, 3, 2]], #[256, 256, 3, 2] [[19, 23, 27], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) |
@positive666 sounds good. My main recommendation would be to package ASFF into the Detect() layer, since you have all of the inputs you need already inside Detect(), and rename it DetectASFF(). Then you don't need to publish new model yamls, anyone could just replace a Detect() layer with a DetectASFF() layer in any yaml. I think that would be ideal in terms of architecture, and then in terms of testing YOLOv5m on VOC is probably a good place to start (fast but generalizes well across datasets and model sizes). The VOC training commands are here, they are only 50 epochs since they start from the COCO-trained models: |
3b92f43
to
70586bc
Compare
@glenn-jocher Haha, yes, after all, this is only a feature fusion layer, then I am going to modify it now, thank you for your suggestions. In addition, I will test the attention mechanism module on VOC. |
a3a46a2
to
1ab9a56
Compare
@glenn-jocher Hello,I replied to the previous results on issue #2348 , which are roughly similar to the conclusions of some friends. The current experiment did not improve the test map trained on V5s, but this aroused my interest, why can I learn the weight layer Unable to achieve results, I think of two difficulties in the detection problem:
|
@positive666 yes these are good questions. In object detection it is true that detection (obj and cls) and regression (box) are often competing interests, and steps to improve one may hurt the other. It's a tricky balancing act that I suppose any multi-component loss model has to deal with that simpler tasks (classification) don't have to worry about. |
6979f53
to
5637868
Compare
Yes, I can determine that the effect of directly adding ASFF and CBAM is not good after many ablation experiments. I recently added EIOU, Focal-EIOU loss and CVPR2021 new attention modules coordinate attention, haha, wait for me to finish Experiment to see the results。 |
0ef2dbe
to
301efc2
Compare
@positive666 hello,l saw you replace the Ciou with Eiou in loss.py and l try this change with my own train data but find that the result is worse than the one using Ciou,l want to know whether you have gain some improvement with your own dataset |
2ece9f2
to
1beb5bb
Compare
Hello. Yes,training wasn't very good! So, I've cancelled this EIOU LOSS calculation ,n this case, it's hard to improve performance simply by changing the IOU
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年5月21日(星期五) 晚上8:54
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ultralytics/yolov5] Add ASFF(Adaptively Spatial Feature Fusion) layers in Head for YoloV5 and some attention modules (#2349)
@positive666 hello,l saw you replace the Ciou with Eiou in loss.py and l try this change with my own train data but find that the result is worse than the one using Ciou,l want to know whether you have gain some improvement with your own dataset
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
ues eiou loss without Focal
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年5月21日(星期五) 晚上8:54
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ultralytics/yolov5] Add ASFF(Adaptively Spatial Feature Fusion) layers in Head for YoloV5 and some attention modules (#2349)
@positive666 hello,l saw you replace the Ciou with Eiou in loss.py and l try this change with my own train data but find that the result is worse than the one using Ciou,l want to know whether you have gain some improvement with your own dataset
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
First of all thanks for the help the project brought me !Given the successful case of the paper yolov3_ASFF, paper provides interpretability and is very suitable for the YOLO series, so I added this ASFF network layer to improve the recognition performance,.
Due to limited hardware resources , I cannot perform all training evaluations under the COCO data set, but relying on the principle of the paper, adaptive weight scale learning is an alternative structure. The slightest changes have been integrated into the code. The 4 structures (including s, m, l, x) are placed in 4 yaml files, which can be freely chosen.
So ,Now the added yaml file is PanNet+ASFF, or FPN+ASFF, which can be combined freely after modularization .I applied it to cigarette detection and advertising logo detection for some small targets. Due to the lack of data sets, I can only continue to collect, further sort and analyze the solutions.
Maybe transformer's free -(anchor and nms) will be a direction of follow-up development , I will conduct more experiments and changes in the future.
For details, see in #2348
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Integration of new architectural components and loss functions into YOLOv5 models.
📊 Key Changes
.yaml
files for YOLOv5 models with specific architectural changes like CBAM (Convolutional Block Attention Module) and CoordAtt (Coordinate Attention).🎯 Purpose & Impact
These changes allow researchers and developers to experiment with cutting-edge components in object detection models and may lead to improved detection accuracy and efficiency.