Octave Convolution
Implementation of Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution
Paper Abstract
In natural images, information is conveyed at different frequencies where higher frequencies are usually encoded with fine details and lower frequencies are usually encoded with global structures. Similarly, the output feature maps of a convolution layer can also be seen as a mixture of information at different frequencies. In this work, we propose to factorize the mixed feature maps by their frequencies, and design a novel Octave Convolution (OctConv) operation to store and process feature maps that vary spatially “slower” at a lower spatial resolution reducing both memory and computation cost. Unlike existing multi-scale methods, OctConv is formulated as a single, generic, plug-and-play convolutional unit that can be used as a direct replacement of (vanilla) convolutions without any adjustments in the network architecture. It is also orthogonal and complementary to methods that suggest better topologies or reduce channel-wise redundancy like group or depth-wise convolutions. We experimentally show that by simply replacing convolutions with OctConv, we can consistently boost accuracy for both image and video recognition tasks, while reducing memory and computational cost. An OctConv-equipped ResNet-152 can achieve 82.9% top-1 classification accuracy on ImageNet with merely 22.2 GFLOPs.
Installation
From PyPI:
pip install octconv
Bleeding edge version from github:
pip install git+https://github.com/braincreators/octconv.git#egg=octconv
Usage
import torch
from octconv import OctConv2d
# (batch, channels, height, width)
x = torch.rand(5, 3, 200, 200)
conv1 = OctConv2d(in_channels=3, out_channels=10, kernel_size=3, alpha=(0., 0.5), padding=1)
conv2 = OctConv2d(in_channels=10, out_channels=20, kernel_size=7, alpha=(0.5, 0.8), padding=3)
conv3 = OctConv2d(in_channels=20, out_channels=1, kernel_size=3, alpha=(0.8, 0.), padding=1)
out = conv3(conv2(conv1(x))) # shape: (5, 1, 200, 200)
Original implementation
Citation
@article{chen2019drop,
title={Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution},
author={Chen, Yunpeng and Fan, Haoqi and Xu, Bing and Yan, Zhicheng and Kalantidis, Yannis and Rohrbach, Marcus and Yan, Shuicheng and Feng, Jiashi},
journal={arXiv preprint arXiv:1904.05049},
year={2019}
}
Metadata
Release files for octconv 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| octconv-0.2.0.tar.gz | 4.3 kB | Without provenance | Details for octconv-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| octconv-0.2.0-py3.6.egg | Legacy Egg format | - | - | Details for octconv-0.2.0-py3.6.egg |
Total release size: 11.6 kB
Release files / octconv-0.2.0.tar.gz
| Download URL | octconv-0.2.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e63c86f2d3f819191ce3aa84eddc9c46016965686fdc4d190fb96df6fbd0d5c5
|
|
BLAKE2b-256 checksum How to use checksums |
33c7b5ea3d12ba1954e48d9bc5beaf998bcc11478483a76452c5fbdbfe588a6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7
|
Release files / octconv-0.2.0-py3.6.egg
| Download URL | octconv-0.2.0-py3.6.egg |
|---|---|
| Size | 7.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
4d2378f67b4cd7670dce09e91dd5892073cb60f34d9f7fd44d32b3afa90be4cd
|
|
BLAKE2b-256 checksum How to use checksums |
7d6d81838e17f9a05d00c08c46249a127f22965e4d76b8ab0bb1b410c9e49c46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7
|
Security for octconv 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.