android 4models,README.md

CnnForAndroid:A Classification Project using Convolutional Neural Network(CNN) in Android platform。It also support Caffe Model

CnnForAndroid is an android platform's implementation of deep learning using Tiny-cnn structure and provide two Recognition sample:one is gender Recognition for caffe net ; two is Car logo recognition for tiny-cnn net.

Todo List

add opencl support.

change to the tiny-dnn new version

Optimise the code and improve the speed.

Dependencies

Opencv(for Android platform Opencv-2.4.9)

Tiny-cnn(old Version)

Support Caffe model

tiny-cnn provide the caffe-convertor.cpp to support the caffe model.The project also support the caffe model from compiling the caffe_convertor and protobuf.

Gender Recognition

this project also provide a sample for caffe model to distingguish man from woman also called gender recognition.

1.Where from training data?

MORPH Album 2.

the test accuracy is 90.01% in my caffe's net.

2.the net of caffe ?

net.PNG

3.How to train yourself caffe's model?

(1)Please using caffe and train your model.

(2)then replace /assets/tinyfile//.caffemodel and /assets/tinyfile/*.protobuf file/.

(3)Finish change those filenames in tinyCnn.java file.

How to install it?

no need install.

Just download or git clone it and then open it by eclipse with opencv for java lib , use NDK to build it.

Surely your libs docu have the opencv_java.so file or you must add this file(from Opencv-android docu).

Compile it

needful tools: NDK + eclipse + adt.

or android studio.

#For Vehicle Recogniton for tiny-cnn net

1.What is Vehicle Recognition?

this project classify car according to car logo.Now the lasting Version just distinguish VM car from other.

2.Where from Training Data ?

The major sources of our dataset include images captured by ourselves,Medialab LPR Dataset [1].

20.jpg

21.jpg

3.this models?

You can get it in JNi/test.cpp file.

Code:

static const bool tbl[] = {

O, X, O, O, O, O, O, O, O, O, O, X, O, O, O, O,

O, X, X, X, O, O, O, X, X, O, O, O, X, X, O, O,

O, O, X, X, X, O, O, O, X, X, O, O, X, X, X, O,

O, O, O, X, X, X, O, O, O, X, X, O, X, X, O, O,

O, O, O, O, X, X, O, O, O, O, X, X, O, X, X, O,

O, X, O, O, O, X, X, O, O, O, O, X, O, O, X, O,

};

nn << convolutional_layer(40 , 40 , 3 , 1 , 6)

<< average_pooling_layer(38 , 38 , 6 , 2)

<< convolutional_layer(19 , 19 , 4 , 6 , 16 ,

connection_table(tbl, 6, 16))

<< average_pooling_layer(16 , 16 , 16 , 2)

<< convolutional_layer(8 , 8 , 3 , 16, 16)

<< fully_connected_layer(16 * 6 * 6 , 64)

<< fully_connected_layer(64 , 2);

My models have three conv-layers and two pooling layer , fully-connect layer , in the end layer , the activation functions is relu and the size of all conv-kernel is 3x3.The optimization algorithm of cnn is stochastic gradient levenberg marquardt.

Other arguments can't be public.

4.Experiment

data:

500 train image , 298 test image.

platform:

Windows+VS2013.

Result:

the recognition rate is above 94.29%

test.PNG

How to use it to recognize face or other object?

If want to recognition other object , you must learning Cnn and tiny-cnn , contructing optimal model and training it using

enough object images to get the wb-file(weights and bias values).Finish , replace /assets/tinyfile/carlogo file with wb-file.

References

[1]Medialab LPR dataset, March. 2013[online]. Available: http://www.medialab.ntua.gr/research/LPRdataset.html

[2]Humayun Karim Sulehria, Ye Zhang.Vehicle Logo Recognition Using Mathematical Morphology

[3]Humayun Karim Sulehria, Ye Zhang.Vehicle Logo Recognition Based on Bag-of-Words.IEEE International Conference on Advanced Video and Signal Based Surveillance,2013.

Running Screenshot

(1)For Vehicle Recogniton

23.png

24.png

(3)For gender Recognition

app.png

Discussing

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值