-
Notifications
You must be signed in to change notification settings - Fork 216
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
Replace FPN with ASFF #51
Comments
Hi, our experiments on RetinaNet show consistent improvements with ASFF, and the results can also be confirmed by another work EfficientDet. I am not familiar with Retinaface, but I suggest you look at BiFPN for re-implement ASFF with FPN. |
|
This is my code, can you help me? |
@ruinmessi is ASFF and BiFPN same ?? |
BiFPN uses 3 weights of shape (1,) and multiplies it with 3 features while asff uses 3 weights of shape (1,1,n,n) and multiplies with 3 features i.e. with x0.shape = 1,24,52,52, x1=1,24,26,26 x2=1,24,13,13 bifpn_feature_level0 = w0(1,) * x0 + w1(1,) * x1 + w2(1,) * x3 ASFF_level0 = w0((1,1,52,52) * x0 + w1(1,1,52,52) * x1 + w2(1,1,52,52) * x3 ASFF uses softmax, BiFPN uses their own version of faster fusion which is faster than softmax for computing weights from features. |
@djaym7 thanks for the easy explanation with the dimensions. Your comment explained ASFF better for me than reading the entire paper. Have you had success implementing ASFF and/contrasting it with BiFPN? I'm trying to implement it in |
@djaym7 wait I think your explanation may be incorrect. The 52x52 grid shape is a function of the input image shape. This specific 52x52 grid you mention only appears if the input image is 416x416, thus you can not have a 1x1x52x52 weight parameter in the model, it's impossible. I think perhaps ASFF instead has a weight of w0(1,24,1,1) in your example, or w0(1,255,1,1) in a default 80-class coco trained yolov3, vs w0(1,) for BiFPN. Is this correct? |
@glenn-jocher check this out shape of weight- fused_level_1 = level_1 * weight_level_1[:, 0:1, :, :] + |
@djaym7 yes I think I understand now, you are correct in your original explanation. So do you create a new convolutional module to create these weights at each yolo layer during runtime like this? |
I don't what you have plotted there without knowing the full network but in yolo you take 3 branches ( output of 3 branches) and do the following: You pass them through a asff_builder() and this function returns the same shape (or different shape with varying channel if you want to change it, but for this example let it be same). Now, to generate fused output at any level L (3 outputs of darknet or 3 feature maps) , you downscale the 'x' and/or upscale the resolution or other two levels. Then you can concatenate these three feature maps which are now of same resolution (n, c+c1+c2, x,x) and pass it through one conv layer with 3 number of channels with 'same' padding (use channel//2 as padding value). You now have fused features for level L. You then multiply these n,3,x,x with the 2 upscaled/downscaled and 1 of current level feature maps ( no issue for 'x' ) and add them. This is your final output for level 1. Repeat for 2 and 3 Note: after upscaling and downscaling step, the author passes them through one conv layer each to get their weights. |
@glenn-jocher Hi, could you tell me what is your tool to view cfg file in graph ? Tks |
@anhnktp you can use Netron, it works really well with *.cfg files! |
Hello, I replace the FPN with ASFF in RetinaNet, but the performance doesn't improve, is there something that I've missed? Can someone help me out? |
Can we use ASFF in the pytorch version of Yolo? thank you |
When I replace the FPN with ASFF in Retinaface, the model size is double, but the result is inferior to FPN.
The text was updated successfully, but these errors were encountered: