• Stars
    star
    767
  • Rank 59,242 (Top 2 %)
  • Language
    C++
  • License
    Other
  • Created over 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

dabnn is an accelerated binary neural networks inference framework for mobile platform

dabnn

Build Status License jcenter Gitter Chat PRs Welcome

Enjoy binary neural networks on mobile!

Gitter: dabnn/dabnn, QQ group (Chinese)๏ผš1021964010, answer: nndab

[English] [Chinese/ไธญๆ–‡]

Our ACM MM paper: https://arxiv.org/abs/1908.05858

Introduction

Binary neural networks (BNNs) have great potential on edge devices since they replace float operations by efficient bit-wise operations. However, to leverage the efficiency of bit-wise operations, the reimplmentation of convolution layer and also other layers is needed.

To our best knowledge, dabnn is the first highly-optimized binary neural networks inference framework for mobile platform. We implemented binary convolutions with ARM assembly. On Google Pixel 1, our dabnn is as 800%~2400% faster as BMXNet (the only one open-sourced BNN inference framework except dabnn to our best knowledge) on a single binary convolution, and as about 700% faster as it on binarized ResNet-18.

Comparison

Build

We provide pre-built onnx2bnn and also dabnn Android package. However, you need to build it if you want to deploy BNNs on non-Android ARM devices.

We use CMake build system like most C++ projects. Check out docs/build.md for the detailed instructions.

Convert ONNX Model

We provide a conversion tool, named onnx2bnn, to convert an ONNX model to a dabnn model. We provide onnx2bnn pre-built binaries for all platforms in GitHub Releases. For Linux users, the onnx2bnn pre-built binary is AppImage format, see https://appimage.org for details.

Note: Binary convolution is a custom operator, so whether the ONNX model is dabnn-comptabile heavily depends on the implementation of the binary convolution in the training code. Please read the documentation about model conversion carefully.

After conversion, the generated dabnn model can be deployed on ARM devices (e.g., mobile phones and embedded devices). For Android developer, we have provided Android AAR package and published it on jcenter, for the usage please check out example project.

Pretrained Models

We publish two pretrained binary neural network models based on Bi-Real Net on ImageNet. More pretrained models will be published in the future.

  • Bi-Real Net 18, 56.4% top-1 on ImageNet, 61.3ms/image on Google Pixel 1 (single thread). [dabnn] [ONNX]

  • Bi-Real Net 18 with Stem Module, 56.4% top-1 on ImageNet, 43.2ms/image on Google Pixel 1 (single thread). The detailed network structure is described in our paper. [dabnn] [ONNX]

Implementation Details

For more details please read our ACM MM paper.

Example project

Android app demo: https://github.com/JDAI-CV/dabnn-example

Related works using dabnn

The following two papers use dabnn to measure the latency of their binary networks on real devices:

License and Citation

BSD 3 Clause

Please cite daBNN in your publications if it helps your research:

@misc{zhang2019dabnn,
  Author = {Jianhao Zhang and Yingwei Pan and Ting Yao and He Zhao and Tao Mei},
  Title = {daBNN: A Super Fast Inference Framework for Binary Neural Networks on ARM devices},
  Year = {2019},
  Eprint = {arXiv:1908.05858},
}

More Repositories

1

fast-reid

SOTA Re-identification Methods and Toolbox
Python
3,377
star
2

FaceX-Zoo

A PyTorch Toolbox for Face Recognition
Python
1,863
star
3

DCL

Destruction and Construction Learning for Fine-grained Image Recognition
Python
585
star
4

centerX

This repo is implemented based on detectron2 and centernet
Python
554
star
5

CoTNet

This is an official implementation for "Contextual Transformer Networks for Visual Recognition".
Python
512
star
6

VeRidataset

This is the project page for veri dataset which is a large scale image dataset for vehicle re-identification in urban traffic surveillance.
MATLAB
397
star
7

DNNLibrary

Daquexian's NNAPI Library. ONNX + Android NNAPI
C++
346
star
8

image-captioning

Implementation of 'X-Linear Attention Networks for Image Captioning' [CVPR 2020]
Python
269
star
9

lapa-dataset

A large-scale dataset for face parsing (AAAI2020)
258
star
10

Down-to-the-Last-Detail-Virtual-Try-on-with-Detail-Carving

Virtural try-on under arbitrary poses
Python
217
star
11

Partial-Person-ReID

Python
168
star
12

FADA

(ECCV 2020) Classes Matter: A Fine-grained Adversarial Approach to Cross-domain Semantic Segmentation
Python
140
star
13

DSD-SATN

ICCV19: Official code of Human Mesh Recovery from Monocular Images via a Skeleton-disentangled Representation
Python
133
star
14

LIO

Look-into-Object: Self-supervised Structure Modeling for Object Recognition (CVPR 2020)
Jupyter Notebook
113
star
15

PGPT

Implementation of โ€˜Pose-Guided Tracking-by-Detection: Robust Multi-Person Pose Trackingโ€™ [TMM 2020]
Python
47
star
16

CM-NAS

CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)
Python
46
star
17

CoTNet-ObjectDetection-InstanceSegmentation

Python
33
star
18

dabnn-example

Android demo for dabnn
Java
19
star
19

atlasWrapper

C++
8
star