Home

Awesome

FcaNet: Frequency Channel Attention Networks

PyTorch implementation of the paper "FcaNet: Frequency Channel Attention Networks".

alt text

Simplest usage

Models pretrained on ImageNet can be simply accessed by (without any configuration or installation):

model = torch.hub.load('cfzd/FcaNet', 'fca34' ,pretrained=True)
model = torch.hub.load('cfzd/FcaNet', 'fca50' ,pretrained=True)
model = torch.hub.load('cfzd/FcaNet', 'fca101' ,pretrained=True)
model = torch.hub.load('cfzd/FcaNet', 'fca152' ,pretrained=True)

Install

Please see INSTALL.md

Models

Classification models on ImageNet

Due to the conversion between FP16 training and the provided FP32 models, the evaluation results are slightly different(max -0.06%/+0.05%) compared with the reported results.

ModelReportedEvaluation ResultsLink
FcaNet3475.0775.02GoogleDrive/BaiduDrive(code:m7v8)
FcaNet5078.5278.57GoogleDrive/BaiduDrive(code:mgkk)
FcaNet10179.6479.63GoogleDrive/BaiduDrive(code:8t0j)
FcaNet15280.0880.02GoogleDrive/BaiduDrive(code:5yeq)

Detection and instance segmentation models on COCO

ModelBackboneAPAP50AP75Link
Faster RCNNFcaNet5039.061.142.3GoogleDrive/BaiduDrive(code:q15c)
Faster RCNNFcaNet10141.263.344.6GoogleDrive/BaiduDrive(code:pgnx)
Mask RCNNFca50 det </br> Fca50 seg40.3</br> 36.262.0 </br> 58.644.1 </br> 38.1GoogleDrive/BaiduDrive(code:d9rn)

Training

Please see launch_training_classification.sh and launch_training_detection.sh for training on ImageNet and COCO, respectively.

Testing

Please see launch_eval_classification.sh and launch_eval_detection.sh for testing on ImageNet and COCO, respectively.

FAQ

Since the paper is uploaded to arxiv, many academic peers ask us: the proposed DCT basis can be viewed as a simple tensor, then how about learning the tensor directly? Why use DCT instead of learnable tensor? Learnable tensor can be better than DCT.

Our concrete answer is: the proposed DCT is better than the learnable way, although it is counter-intuitive.

MethodImageNet Top-1 AccLink
Learnable tensor, random initialization77.914GoogleDrive/BaiduDrive(code:p2hl)
Learnable tensor, DCT initialization78.352GoogleDrive/BaiduDrive(code:txje)
Fixed tensor, random initialization77.742GoogleDrive/BaiduDrive(code:g5t9)
Fixed tensor, DCT initialization (Ours)78.574GoogleDrive/BaiduDrive(code:mgkk)

To verify this results, one can select the cooresponding types of tensor in the L73-L83 in model/layer.py, uncomment it and train the whole network.

TODO