# LBCNN
Torch implementation of CVPR'17 - Local Binary Convolutional Neural Networks http://xujuefei.com/lbcnn.html
## Abstract
We propose **local binary convolution (LBC)**, an efficient alternative to convolutional layers in standard convolutional neural networks (CNN). The design principles of LBC are motivated by local binary patterns (LBP). The LBC layer comprises of a set of fixed sparse pre-defined binary convolutional filters that are not updated during the training process, a non-linear activation function and a set of learnable linear weights. The linear weights combine the activated filter responses to approximate the corresponding activated filter responses of a standard convolutional layer. The LBC layer affords significant parameter savings, 9x to 169x in the number of learnable parameters compared to a standard convolutional layer. Furthermore, the sparse and binary nature of the weights also results in up to 9x to 169x savings in model size compared to a standard convolutional layer. We demonstrate both theoretically and experimentally that our local binary convolution layer is a good approximation of a standard convolutional layer. Empirically, CNNs with LBC layers, called **local binary convolutional neural networks (LBCNN)**, achieves performance parity with regular CNNs on a range of visual datasets (MNIST, SVHN, CIFAR-10, and ImageNet) while enjoying significant computational savings.
***
## Overview
<img src="http://xujuefei.com/lbcnn_image/01_LBP_3_5.png" width="300"><img src="http://xujuefei.com/lbcnn_image/02_LBP.png" width="520">
We draw inspiration from local binary patterns that have been very successfully used for facial analysis.
<img src="http://xujuefei.com/lbcnn_image/03_LBCNN_CNN.png" width="820">
Our LBCNN module is designed to approximate a fully learnable dense CNN module.
<img src="http://xujuefei.com/lbcnn_image/04_sparsity_2.png" width="260"><img src="http://xujuefei.com/lbcnn_image/04_sparsity_4.png" width="260"><img src="http://xujuefei.com/lbcnn_image/04_sparsity_9.png" width="260">
Binary convolutional kernels with different sparsity levels.
<img src="http://xujuefei.com/lbcnn_image/05_theory.png" width="820">
***
## Contributions
* Convolutional kernels inspired by local binary patterns.
* Convolutional neural network architecture with **non-mutable randomized sparse binary convolutional kernels**.
* Lightweight CNN with massive computational and memory savings.
***
## References
* Felix Juefei-Xu, Vishnu Naresh Boddeti, and Marios Savvides, [**Local Binary Convolutional Neural Networks**](http://xujuefei.com/felix_cvpr17_lbcnn.pdf),
* To appear in *IEEE Computer Vision and Pattern Recognition (CVPR), 2017*. (Spotlight Oral Presentation)
```
@inproceedings{juefei-xu2017lbcnn,
title={{Local Binary Convolutional Neural Networks}},
author={Felix Juefei-Xu and Vishnu Naresh Boddeti and Marios Savvides},
booktitle={IEEE Computer Vision and Pattern Recognition (CVPR)},
month={July},
year={2017}
}
```
***
## Implementations
The code base is built upon [fb.resnet.torch](https://github.com/facebook/fb.resnet.torch).
### Requirements
See the [installation instructions](INSTALL.md) for a step-by-step guide.
- Install [Torch](http://torch.ch/docs/getting-started.html) on a machine with CUDA GPU
- Install [cuDNN v4 or v5](https://developer.nvidia.com/cudnn) and the Torch [cuDNN bindings](https://github.com/soumith/cudnn.torch/tree/R4)
- Download the [ImageNet](http://image-net.org/download-images) dataset and [move validation images](https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md#download-the-imagenet-dataset) to labeled subfolders
If you already have Torch installed, update `nn`, `cunn`, and `cudnn`.
### Training Recipes
The `numChannels` parameter corresponds to the `output channels` in the paper.
* MNIST
*CNN*
```bash
th main.lua -netType resnet-dense-felix -dataset mnist -data '/media/Freya/juefeix/LBCNN' -save '/media/Freya/juefeix/LBCNN-Weights' -numChannels 16 -batchSize 10 -depth 75 -full 128
```
*LBCNN (~99.5% after 80 epochs)*
```bash
th main.lua -netType resnet-binary-felix -dataset mnist -data '/media/Freya/juefeix/LBCNN' -save '/media/Freya/juefeix/LBCNN-Weights' -numChannels 16 -batchSize 10 -depth 75 -full 128 -sparsity 0.5
```
* SVHN
*CNN*
```bash
th main.lua -netType resnet-dense-felix -dataset svhn -data '/media/Freya/juefeix/LBCNN' -save '/media/Freya/juefeix/LBCNN-Weights' -numChannels 16 -batchSize 10 -depth 40 -full 512
```
*LBCNN (~94.5% after 80 epochs)*
```bash
th main.lua -netType resnet-binary-felix -dataset svhn -data '/media/Freya/juefeix/LBCNN' -save '/media/Freya/juefeix/LBCNN-Weights' -numChannels 16 -batchSize 10 -depth 40 -full 512 -sparsity 0.9
```
* CIFAR-10
*CNN*
```bash
th main.lua -netType resnet-dense-felix -dataset cifar10 -data '/media/Caesar/juefeix/LBCNN' -save '/media/Caesar/juefeix/LBCNN-Weights' -numChannels 384 -numWeights 704 -batchSize 5 -depth 50 -full 512
```
*LBCNN (~93% after 80 epochs)*
```bash
th main.lua -netType resnet-binary-felix -dataset cifar10 -data '/media/Caesar/juefeix/LBCNN' -save '/media/Caesar/juefeix/LBCNN-Weights' -numChannels 384 -numWeights 704 -batchSize 5 -depth 50 -full 512 -sparsity 0.001
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
lbcnn.torch-master.zip (23个子文件)
lbcnn.torch-master
models
resnet-dense-felix.lua 2KB
preresnet.lua 7KB
init.lua 5KB
resnet-binary-felix.lua 2KB
main.lua 2KB
dataloader.lua 3KB
RandomBinaryConvolution.lua 1KB
INSTALL.md 3KB
LICENSE 1KB
train.lua 6KB
checkpoints.lua 2KB
opts.lua 6KB
README.md 5KB
datasets
svhn-gen.lua 780B
transforms.lua 8KB
mnist.lua 3KB
cifar10-gen.lua 2KB
cifar10.lua 1KB
mnist-gen.lua 774B
dataset-mnist.lua 2KB
README.md 1KB
svhn.lua 1013B
init.lua 1004B
共 23 条
- 1
资源评论
我虽横行却不霸道
- 粉丝: 72
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 聊天系统(java+applet).zip
- 毕业设计:基于SSM的mysql-高校学生请假管理系统(源码 + 数据库 + 说明文档)
- 博客系统(struts+hibernate+spring).rar
- c语言学生成绩管理系统源码.zip
- 毕业设计:基于SSM的mysql-网约车用户服务平台(源码 + 数据库 + 说明文档)
- 内容管理系统(hibernate3+struts2+spring2)130224.rar
- 基于Java的班级管理系统课程设计源码
- 内容管理系统(hibernate3+struts2+spring2).rar
- 路由器刷breed Web控制台助手v5.8版本.rar
- Java 在 JEP 12 提供的特性预览
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功