Skip to content
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

small objects yolov4-csp #8081

Open
tcdnm opened this issue Sep 13, 2021 · 4 comments
Open

small objects yolov4-csp #8081

tcdnm opened this issue Sep 13, 2021 · 4 comments

Comments

@tcdnm
Copy link

tcdnm commented Sep 13, 2021

Hi @AlexeyAB,

Do you have any suggestions on how to modify yolov4-csp .cfg to train for small objects? I've been trying to use the modifications suggested for yolov4 but they don't seem to work for yolov4-csp (it fails when setting the stride values to 4).

Here are the modifications I made to the original yolov4-csp.cfg file:
set layers = 23 instead of https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4-csp.cfg#L938
set stride=4 instead of https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4-csp.cfg#L935
set stride=4 instead of https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4-csp.cfg#L1059

Issue:
image

Run parameters:
image

@vtyw
Copy link

vtyw commented Sep 29, 2021

I have the same question, but I'm also wondering why increasing the stride is recommended for detecting small objects. Doesn't that result in downsampling of an activation map?

@vtyw
Copy link

vtyw commented Sep 30, 2021

@tcdnm I've figured it out, the way to do this for yolo4-csp.cfg is to set:
Line 935: stride=4
Line 938: layers = 17
Line 1059: stride = 4
I've tested this and it does increase accuracy. However, it also makes the network slower so you may want to weigh this up compared to setting a larger input size without this modification, which may also increase accuracy while being slower.

@Avv22
Copy link

Avv22 commented Feb 9, 2023

@vtyw. How about your question please, "I have the same question, but I'm also wondering why increasing the stride is recommended for detecting small objects. Doesn't that result in downsampling of an activation map?" Where did you bring this from that "I'm also wondering why increasing the stride is recommended for detecting small objects"? Can you please add reference?

@Avv22
Copy link

Avv22 commented Feb 9, 2023

Can you please add more details what do you mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants