PyTorch implementation of Octave Convolution with pre-trained Oct-ResNet and Oct-MobileNet models

Overview

octconv.pytorch

PyTorch implementation of Octave Convolution in Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution

ResNet-50/101 on ImageNet

Architecture LR decay strategy Parameters GFLOPs Top-1 / Top-5 Accuracy (%)
ResNet-50 step (90 epochs) 25.557M 4.089 76.010 / 92.834
ResNet-50 cosine (120 epochs) 25.557M 4.089 77.150 / 93.468
Oct-ResNet-50 (alpha=0.5) cosine (120 epochs) 25.557M 2.367 77.640 / 93.662
ResNet-101 cosine (120 epochs) 44.549M 7.801 78.898 / 94.304
Oct-ResNet-101 (alpha=0.5) cosine (120 epochs) 44.549M 3.991 78.794 / 94.330
ResNet-152 cosine (120 epochs) 60.193M 11.514 79.234 / 94.556
Oct-ResNet-152 (alpha=0.5) cosine (120 epochs) 60.193M 5.615 79.258 / 94.480

MobileNet V1 on ImageNet

Architecture LR decay strategy Parameters FLOPs Top-1 / Top-5 Accuracy (%)
MobileNetV1 cosine (150 epochs) 4.232M 568.7M 72.238 / 90.536
Oct-MobileNetV1 cosine (150 epochs) 4.232M 318.2M 71.254 / 89.728

Acknowledgement

Official MXNet implmentation by @cypw

Citation

@InProceedings{Chen_2019_ICCV,
author = {Chen, Yunpeng and Fan, Haoqi and Xu, Bing and Yan, Zhicheng and Kalantidis, Yannis and Rohrbach, Marcus and Yan, Shuicheng and Feng, Jiashi},
title = {Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks With Octave Convolution},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
month = {October},
year = {2019}
}
Comments
  • About loading pre-training errors

    About loading pre-training errors

    First of all, thank you for your code, which has benefited me a lot, but the same error always occurs when loading the pre-training model. The error code is as follows Error(s) in loading state_dict for OctResNet:Missing key(s) in state_dict: Can you help me with it, or can you provide me with a full version of the code? I am grateful! My email is [email protected]

    opened by linyi785 7
  • Why is original resnet50  faster than octave-resnet50?

    Why is original resnet50 faster than octave-resnet50?

    Why is original resnet50 faster than octave-resnet50? In inference on gtx-1080, original resnet50 is about 70 fps and octave-resnet50 is around 42 fps.

    opened by BlueAnthony 4
  • Difference between your implementation and paper.

    Difference between your implementation and paper.

    Hi, when apply depthwise seperate conv, you directly abandon low-to-high and high-to-low branches. But in the paper, author compress high-to-high branch and preserve communication between high and low branch.

    image

    opened by shoutOutYangJie 3
  • Computation time around 3 times longer with OctConv

    Computation time around 3 times longer with OctConv

    Thanks for your implementation of OctConv!

    I see that the OctConv paper reports reduced GFLOPs usage as well as reduced computation time per image. However, running your implementation on ImageNet dataset, it seems the computation time per image actually increases by a multiple of 3! This happens both during training and during validation. I am comparing PyTorch's ResNet50 vs your OctResNet-50 with default alpha parameters.

    opened by niam06 3
  • hi,Why the accuracy of original resnet26 is higher than octave-resnet26 used in cifar10 and cifar100?

    hi,Why the accuracy of original resnet26 is higher than octave-resnet26 used in cifar10 and cifar100?

    cifar100 original_resnet26 77% oct_resnet26 65% my training script is like this: https://github.com/uoguelph-mlrg/Cutout/blob/master/train.py could you shared your training script with us?? thank you.

    opened by gogo03 2
  • Training code

    Training code

    Are you planning on releasing the training code?

    Also, did you try to implement the ResNet BasicBlock with OctConv?

    I'm trying to do it in my own implementation, but it is tricky due to the lack of down sampling on the first layer.

    opened by miguelvr 2
  • Why only return high frequency features (x_h)

    Why only return high frequency features (x_h)

    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = self.relu(x)
        x = self.maxpool(x)
    
        x_h, x_l = self.layer1(x)
        x_h, x_l = self.layer2((x_h,x_l))
        x_h, x_l = self.layer3((x_h,x_l))
        x_h, x_l = self.layer4((x_h,x_l))
        x = self.avgpool(x_h)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
    
        return x
    
    opened by zhaoyanjoin 1
  • Change the alpha_in value for the output layer

    Change the alpha_in value for the output layer

    The alpha_in value should not be set as zero for the output layer. If alpha_in=0 for the output layer, the low frequency feature (X_L) will be abandoned and cannot be merged into the final output (Y_H). The alpha_in can only be set as zero for the input layer. The paper author has claimed the aforementioned opinion in Figure 2.

    opened by wuhuikx 1
  • Initialisation of layers and weights not available

    Initialisation of layers and weights not available

    I ran through the code and i couldnt find any snippet for initialisation of layers. do the layers need initialisation ?

    and when "pretrain" parameter is set to TRUE, then nothing happens. Do we need to download the weights from somewhere ?

    opened by aakash-saboo 1
  • There is no main script to run the network ?

    There is no main script to run the network ?

    I don't see a main run script to run the training and evaluation for benchamarking. Seems you have create a module for octave convolution to plug into a custom written main script for benchmarking.

    opened by polyrhythML 0
  • Could you please provide the training recipe file?

    Could you please provide the training recipe file?

    Thanks for your implementation of this work. I‘m using your code to reproduce the result you reported and I'm wondering if I could refer to your training settings. Could you please kindly provide your training config files if possible?

    opened by wenyuqing 0
  • BatchNorm before activation vs BatchNorm after activation

    BatchNorm before activation vs BatchNorm after activation

    Thanks for your implementation of the Octave Conv paper.

    I have a remark/question about the Conv_BN_ACT module. As BN after ACT sometimes makes more sense, following the PyTorch example I made a small OctaveCNN (each using 6 convs total) for the CIFAR10 dataset. Using PReLU activations, CrossEntropy loss, AmsGrad optimizer and alpha=0.25. After some experimentation with using BatchNorm before or after the activation I found the following results:

    | Network description | # epochs | accuracy (%) | training loss | test loss | | --- | --- | --- | --- | --- | | Conv_BN_ACT | 15 | 78.46 | 0.7093 | 0.6362 | | | 30 | 82.20 | 0.4613 | 0.5456 | | Conv_ACT_BN | 15 | 82.84 | 0.3917 | 0.5260 | | | 30 | 84.18 | 0.1614 | 0.6036 |

    I observe that Conv_ACT_BN has a tendency to overfit more as its training loss is noticeably lower than testing loss when compared to those of Conv_BN_ACT. However, Conv_ACT_BN does have a much higher accuracy.

    Have you looked at this before? Is this the reason why you choose to include Conv_BN_ACT and not Conv_ACT_BN?

    opened by AlexanderHustinx 0
PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal Convolutions for Action Recognition"

R2Plus1D-PyTorch PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal

Irhum Shafkat 342 Dec 16, 2022
Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition"

Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition" Pre-trained Deep Convo

Ankush Malaker 5 Nov 11, 2022
A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution.

Awesome Pretrained StyleGAN2 A collection of pre-trained StyleGAN2 models trained on different datasets at different resolution. Note the readme is a

Justin 1.1k Dec 24, 2022
PyTorch implementation for OCT-GAN Neural ODE-based Conditional Tabular GANs (WWW 2021)

OCT-GAN: Neural ODE-based Conditional Tabular GANs (OCT-GAN) Code for reproducing the experiments in the paper: Jayoung Kim*, Jinsung Jeon*, Jaehoon L

BigDyL 7 Dec 27, 2022
Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts

t5-japanese Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts. The following is a list of models that

Kimio Kuramitsu 1 Dec 13, 2021
Machine learning evaluation metrics, implemented in Python, R, Haskell, and MATLAB / Octave

Note: the current releases of this toolbox are a beta release, to test working with Haskell's, Python's, and R's code repositories. Metrics provides i

Ben Hamner 1.6k Dec 26, 2022
Quickly comparing your image classification models with the state-of-the-art models (such as DenseNet, ResNet, ...)

Image Classification Project Killer in PyTorch This repo is designed for those who want to start their experiments two days before the deadline and ki

null 349 Dec 8, 2022
Pytorch implementation of our paper under review — Lottery Jackpots Exist in Pre-trained Models

Lottery Jackpots Exist in Pre-trained Models (Paper Link) Requirements Python >= 3.7.4 Pytorch >= 1.6.1 Torchvision >= 0.4.1 Reproduce the Experiment

Yuxin Zhang 27 Jun 28, 2022
Implementation of PyTorch-based multi-task pre-trained models

mtdp Library containing implementation related to the research paper "Multi-task pre-training of deep neural networks for digital pathology" (Mormont

Romain Mormont 27 Oct 14, 2022
Pytorch implementation of MLP-Mixer with loading pre-trained models.

MLP-Mixer-Pytorch PyTorch implementation of MLP-Mixer: An all-MLP Architecture for Vision with the function of loading official ImageNet pre-trained p

Qiushi Yang 2 Sep 29, 2022
Base pretrained models and datasets in pytorch (MNIST, SVHN, CIFAR10, CIFAR100, STL10, AlexNet, VGG16, VGG19, ResNet, Inception, SqueezeNet)

This is a playground for pytorch beginners, which contains predefined models on popular dataset. Currently we support mnist, svhn cifar10, cifar100 st

Aaron Chen 2.4k Dec 28, 2022
TorchGeo is a PyTorch domain library, similar to torchvision, that provides datasets, transforms, samplers, and pre-trained models specific to geospatial data.

TorchGeo is a PyTorch domain library, similar to torchvision, that provides datasets, transforms, samplers, and pre-trained models specific to geospatial data.

Microsoft 1.3k Dec 30, 2022
KoRean based ELECTRA pre-trained models (KR-ELECTRA) for Tensorflow and PyTorch

KoRean based ELECTRA (KR-ELECTRA) This is a release of a Korean-specific ELECTRA model with comparable or better performances developed by the Computa

null 12 Jun 3, 2022
Pre-trained BERT Models for Ancient and Medieval Greek, and associated code for LaTeCH 2021 paper titled - "A Pilot Study for BERT Language Modelling and Morphological Analysis for Ancient and Medieval Greek"

Ancient Greek BERT The first and only available Ancient Greek sub-word BERT model! State-of-the-art post fine-tuning on Part-of-Speech Tagging and Mor

Pranaydeep Singh 22 Dec 8, 2022
PyTorch implementation of MoCo v3 for self-supervised ResNet and ViT.

MoCo v3 for Self-supervised ResNet and ViT Introduction This is a PyTorch implementation of MoCo v3 for self-supervised ResNet and ViT. The original M

Facebook Research 887 Jan 8, 2023
PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization using Augmented-Self Reference and Dense Semantic Correspondence) and pre-trained model on ImageNet dataset

Reference-Based-Sketch-Image-Colorization-ImageNet This is a PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization usin

Yuzhi ZHAO 11 Jul 28, 2022
Source code and dataset for ACL2021 paper: "ERICA: Improving Entity and Relation Understanding for Pre-trained Language Models via Contrastive Learning".

ERICA Source code and dataset for ACL2021 paper: "ERICA: Improving Entity and Relation Understanding for Pre-trained Language Models via Contrastive L

THUNLP 75 Nov 2, 2022
The Hailo Model Zoo includes pre-trained models and a full building and evaluation environment

Hailo Model Zoo The Hailo Model Zoo provides pre-trained models for high-performance deep learning applications. Using the Hailo Model Zoo you can mea

Hailo 50 Dec 7, 2022