All Projects → lyttonhao → Factorized Bilinear Network

lyttonhao / Factorized Bilinear Network

FBN: Factorized Bilinear Models for Image Recognition (ICCV 2017)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Factorized Bilinear Network

Healthapp
This application is designed for the effective interaction between patients and doctors
Stars: ✭ 28 (-57.58%)
Mutual labels:  image-recognition
Opencv Face Filters
Snapchat-like Face Filters in OpenCV
Stars: ✭ 51 (-22.73%)
Mutual labels:  image-recognition
Imago
Optical position recognition for the game of Go
Stars: ✭ 59 (-10.61%)
Mutual labels:  image-recognition
Max Image Segmenter Web App
Deploy a Deep Learning Powered "Magic Cropping Tool" using Pre-Trained Open Source Models
Stars: ✭ 29 (-56.06%)
Mutual labels:  image-recognition
Duplicate Images Finder
🏞🌉 Find and Delete Duplicate Images / Photos
Stars: ✭ 36 (-45.45%)
Mutual labels:  image-recognition
Estimated Depth Map Helps Image Classification
Depth estimation with neural network, and learning on RGBD images
Stars: ✭ 52 (-21.21%)
Mutual labels:  image-recognition
Attention Ocr
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.
Stars: ✭ 844 (+1178.79%)
Mutual labels:  image-recognition
Pneumonia Detection From Chest X Ray Images With Deep Learning
Detecting Pneumonia in Chest X-ray Images using Convolutional Neural Network and Pretrained Models
Stars: ✭ 64 (-3.03%)
Mutual labels:  image-recognition
Rapiddraw
A simple artificial intelligence experiment to find out if mobile neural networks can recognize human-made doodles
Stars: ✭ 39 (-40.91%)
Mutual labels:  image-recognition
Rostensorflow
TensorFlow ImageNet demo using ROS sensor_msgs/Image
Stars: ✭ 59 (-10.61%)
Mutual labels:  image-recognition
Recogcaptcha
Técnica de reconhecimento de captcha utilizando o framework AForge.NET e o Tesseract
Stars: ✭ 29 (-56.06%)
Mutual labels:  image-recognition
Channel Pruning
Channel Pruning for Accelerating Very Deep Neural Networks (ICCV'17)
Stars: ✭ 979 (+1383.33%)
Mutual labels:  image-recognition
Image recognition
Packages for image recognition - Robocup TU/e Robotics
Stars: ✭ 53 (-19.7%)
Mutual labels:  image-recognition
Deep learning projects
Stars: ✭ 28 (-57.58%)
Mutual labels:  image-recognition
People Counter Python
Create a smart video application using the Intel Distribution of OpenVINO toolkit. The toolkit uses models and inference to run single-class object detection.
Stars: ✭ 62 (-6.06%)
Mutual labels:  image-recognition
Udacity Deep Learning Nanodegree
This is just a collection of projects that made during my DEEPLEARNING NANODEGREE by UDACITY
Stars: ✭ 15 (-77.27%)
Mutual labels:  image-recognition
Cordova Plugin Tensorflow
On-device image recognition via TensorFlow/Inception. For Cordova/PhoneGap.
Stars: ✭ 51 (-22.73%)
Mutual labels:  image-recognition
Fastai deeplearn part1
Notes for Fastai Deep Learning Course
Stars: ✭ 1,135 (+1619.7%)
Mutual labels:  image-recognition
Papers
A list of paper, books and sites for various different topics related to machine learning and deep learning along with various field in which it is implemented
Stars: ✭ 63 (-4.55%)
Mutual labels:  image-recognition
Biglittlenet
Official repository for Big-Little Net
Stars: ✭ 57 (-13.64%)
Mutual labels:  image-recognition

Factorized-Bilinear-Network

This repository holds the MXNet code for the paper:

Factorized Bilinear Models for Image Recognition, Yanghao Li, Naiyan Wang, Jiaying Liu, and Xiaodi Hou, arXiv preprint arXiv:1611.05709, 2016

[Arxiv Preprint]

Introduction

Factorized-Bilinear-Network proposes a novel Factorized Bilinear (FB) layer to model the pairwise feature interactions by considering the quadratic terms in the transformations. The factorized parameterization makes our FB layer only require a linear increase of parameters and affordable computational cost. A specific remedy called DropFactor is also devised during the training process to further reduce the risk of overfitting of the FB layer.

CIFAR Results:

Method params CIFAR-10 CIFAR-100
Inception-BN 1.7M 5.82 24.70
ResNet-164 (ours) 1.7M 5.30 23.64
ResNet-1001 (ours) 10.2M 4.04 20.50
Inception-BN-FBN 2.4M 5.58 21.98
ResNet-164-FBN 2.2M 5.00 22.50
ResNet-1001-FBN 10.7M 4.09 19.67

ImageNet Results:

Method Top-1(%) Top-5 (%)
Inception-BN 27.5 9.2
Inception-BN-FBN 26.4 8.4
ResNet-34 27.7 9.1
ResNet-34-FBN 26.3 8.4
ResNet-50 24.7 7.4
ResNet-50-FBN 24.0 7.1

Prepare Datasets

Prepare the corresponding datasets (CIFAR-10, CIFAR-100 or ImageNet) before training FBNs. In our experiments, we use RecordIO data format to generate .rec files for different datasets. Please refer to MXNet Example.

For example, you should first prepare the train.lst and test.lst, then generate the .rec file using im2rec tool. An example for ImageNet:

$im2rec_path train.lst train/ data/imagenet/train_480_q90.rec resize=480 quality=90

Usage

Download this repo recursively:

git clone --recursive https://github.com/lyttonhao/Factorized-Bilinear-Network.git

We implement two versions of factorized bilinear layer:

  1. mx.symbol.FMConvolution1(): similar to Convolution layer with additional FB parameters:

    • num_factor: the factor number for the FB layer. We use 20 in CIFAR dataset. For ImageNet, larger value (50) may improve the performance.
    • p: drop rate for DropFactor
  2. mx.symbol.FMConvolution3(): speed-up version of FMConvolution1 using batch_dot, but cost more memory. (The GPU memory may not be enough for large model.)

CIFAR

The original fully connected layer can be replaced by a FMConvolution3 layer:

bilinear = mx.symbol.FMConvolution3(data=in5b, num_filter=num_classes, num_factor=args.fmconv_factor,
                                    kernel=(1, 1), stride=(1, 1),
                                    pad=(0, 0), p=args.fmconv_drop, name='bilinear1')

The training command:

python train_cifar.py --gpus 2,3 --data-dir /mnt/hdd/lytton/mx_data/cifar-100 --lr 0.1 --wd 0.0001 --batch-size 128 --data-shape 32 --num-epoches 100 --network resnet-small-fmconv --num-classes 100 --lr-step 50,75 --model-prefix cifar100_res18_fmconv22-3  --res-module-num 18  --fmconv-slowstart 3 --fmconv-drop 0.5 --fmconv-factor 20

More examples can be seen in the cifar/run.sh and you can run python cifar/train_cifar.py with -h to see more options.

ImageNet

Our training policy and augmentation methods follow the MXNet ResNet which reproduced ResNet in MXNet. Please using specific settings (like lr schedulers and training epochs) in MXNet ResNet if compares with its original MXNet ResNet results.

An example of training command:

python train_imagenet.py --gpus 0,1,2,3,4,5,6,7  --model-prefix resnet34-fmconv --network resnet-fmconv --batch-size 256 --aug-level 2  --num-epoches 120 --frequent 50  --lr 0.1 --wd 0.0001   --lr-step 60,75,90  --fmconv-drop 0.5  --fmconv-slowstart 1 --fmconv-factor 50 --depth 34

Usually, we will cancel the scale/color/aspect augmentation during training (set --aug-level=1 for around additional 10 epochs) for better result.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].