WindVChen / DRENet

The official implementation of DRENet (Degraded Reconstruction Enhancement Network) for tiny ship detection in remote sensing Images
GNU General Public License v3.0
42 stars 6 forks source link

use other yolov5 models #5

Open ramdhan1989 opened 1 year ago

ramdhan1989 commented 1 year ago

Hi, I wonder if I can use other yolov5 model (n,s,m,l,etc)? I have tried to use DRENet.yaml inside models folder. is it possible to use yaml file from yolov5 repo? do I need to do some modification?

please advise

thanks

WindVChen commented 1 year ago

Hi, actually I have not tried to apply DRENet with larger backbone than YOLOv5s previously. But if you want to, it is very easy. Just change the depth_multiple and width_multiple in the .yaml to apply which size model you want, these two params just corresponds to the number of layers and the channels of each module. You can refer to the yamls in YOLOv5 official repo and the usage of these two params in the code for more details.

Furthermore, for large model, you may need to try different number of C3ResAtnMHSA layers in the yaml for a better result. Current for YOLOv5s is 1 = 3 * 0.33.

ramdhan1989 commented 1 year ago

it is the one on the backbone, isn't it? would you mind elaborating more on how to add the C3ResAtnMHSA layer? do I need to change the value of three (red line) only? is there any rule of thumb to add this layer? due to my computer capacity, I am going to use yolov5l.

image

please advise,

thank you

WindVChen commented 1 year ago

For applying different size of YOLOv5, such as YOLOv5m, YOLOv5l, etc., you only need to change these two params in DRENet.yaml: image

E.g., YOLOv5s is 0.33 and 0.5 respectively, YOLOv5m is 0.67 and 0.75, etc. You can refer to more details in Yolov5 official Repo. Then, you have applied DRENet with different size of YOLOv5.

About the number of C3ResAtnMHSA, for the current configuration, it is 1 = 3 (the value denoted with redline in your figure) * 0.33 (depth_multiple of YOLOv5s). If you change the depth_multiple to 1.0 (Configuration of YOLOv5l), the number of C3ResAtnMHSA layers will go to 3. You can just try whether 3 layers C3ResAtnMHSA can get good results. Or maybe only 1 is enough (then you may need to set the redlined value 3 to 1). You also should note that there are 5 C3ResAtnMHSA in the yaml, you may need to modify then together. image

ramdhan1989 commented 1 year ago

Hi @WindVChen thank you so much for your help. I think your method works better in my dataset as compared to original yolov5 implementation. Can I use this repo for further implementation ? or may be to use it in data science competition?

thank you

WindVChen commented 1 year ago

I'm glad that the method can help. Just feel free to use it as long as the source is indicated.