Giter Site home page Giter Site logo

bentengma / active-convolution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jyh2986/active-convolution

0.0 1.0 0.0 53.22 MB

Active Convolution

Home Page: https://arxiv.org/abs/1703.09076

License: Other

CMake 2.73% Makefile 0.68% Shell 0.43% C++ 79.32% Cuda 6.14% MATLAB 0.88% Jupyter Notebook 1.17% Python 8.64%

active-convolution's Introduction

Active Convolution

This repository contains the implementation for the paper Active Convolution: Learning the Shape of Convolution for Image Classification.

The code is based on Caffe and cuDNN(v5)

Abstract

In recent years, deep learning has achieved great success in many computer vision applications. Convolutional neural networks (CNNs) have lately emerged as a major approach to image classification. Most research on CNNs thus far has focused on developing architectures such as the Inception and residual networks. The convolution layer is the core of the CNN, but few studies have addressed the convolution unit itself. In this paper, we introduce a convolution unit called the active convolution unit (ACU). A new convolution has no fixed shape, because of which we can define any form of convolution. Its shape can be learned through backpropagation during training. Our proposed unit has a few advantages. First, the ACU is a generalization of convolution; it can define not only all conventional convolutions, but also convolutions with fractional pixel coordinates. We can freely change the shape of the convolution, which provides greater freedom to form CNN structures. Second, the shape of the convolution is learned while training and there is no need to tune it by hand. Third, the ACU can learn better than a conventional unit, where we obtained the improvement simply by changing the conventional convolution to an ACU. We tested our proposed method on plain and residual networks, and the results showed significant improvement using our method on various datasets and architectures in comparison with the baseline.

Testing Code

You can validate backpropagation using test code. Because it is not differentiable on lattice points, you should not use integer point position when you are testing code. It is simply possible to define "TEST_ACONV_FAST_ENV" macro in aconv_fast_layer.hpp

  1. Define "TEST_ACONV_FAST_ENV" macro in aconv_fast_layer.hpp
  2. > make test
  3. > ./build/test/test_aconv_fast_layer.testbin

You should pass all tests. Before the start, don't forget to undefine TEST_ACONV_FAST_ENV macro and make again.

Usage

ACU has 4 parameters(weight, bias, x-positions, y-positions of synapse). Even though you don't use bias term, the order will not be changed.

Please refer deploy file in models/ACU

If you want define arbitary shape of convolution,

  1. use non SQUARE type in aconv_param
  2. define number of synapse using kernel_h, kernel_w parameter in convolution_param

In example, if you want define cross-shaped convolution with 4 synapses, you can use like belows.

...
aconv_param{   type: CIRCLE }
convolution_param {    num_output: 48    kernel_h: 1    kernel_w: 4    stride: 1 }
...

When you use user-defined shape of convolution, you'd better edit aconv_fast_layer.cpp directly to define initial position of synapses.

Example

This is the result of plain ACU network, and there an example in models/ACU of CIFAR-10

Network CIFAR-10(%) CIFAR-100(%)
baseline 8.01 27.85
ACU 7.33 27.11
Improvement +0.68 +0.74

This is changes of the positions over iterations.

You can draw learned position by using ipython script.

active-convolution's People

Contributors

blgene avatar cypof avatar dgolden1 avatar ducha-aiki avatar eelstork avatar erictzeng avatar flx42 avatar jamt9000 avatar jeffdonahue avatar jyegerlehner avatar kkhoot avatar kloudkl avatar longjon avatar lukeyeager avatar mavenlin avatar mohomran avatar mtamburrano avatar netheril96 avatar philkr avatar qipeng avatar rbgirshick avatar ronghanghu avatar sergeyk avatar sguada avatar shelhamer avatar ste-m5s avatar timmeinhardt avatar tnarihi avatar yangqing avatar yosinski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.