• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

xiaochus/MobileNetV2: A Keras implementation of MobileNetV2.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

xiaochus/MobileNetV2

开源软件地址(OpenSource Url):

https://github.com/xiaochus/MobileNetV2

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

MobileNet v2

A Python 3 and Keras 2 implementation of MobileNet V2 and provide train method.

According to the paper: Inverted Residuals and Linear Bottlenecks Mobile Networks for Classification, Detection and Segmentation.

Requirement

  • OpenCV 3.4
  • Python 3.5
  • Tensorflow-gpu 1.5.0
  • Keras 2.2

MobileNet v2 and inverted residual block architectures

MobileNet v2:

Each line describes a sequence of 1 or more identical (modulo stride) layers, repeated n times. All layers in the same sequence have the same number c of output channels. The first layer of each sequence has a stride s and all others use stride 1. All spatial convolutions use 3 X 3 kernels. The expansion factor t is always applied to the input size.

MobileNetV2

Bottleneck Architectures:

residual block architectures

Train the model

The recommended size of the image in the paper is 224 * 224. The data\convert.py file provide a demo of resize cifar-100 dataset to this size.

The dataset folder structure is as follows:

| - data/
	| - train/
  		| - class 0/
			| - image.jpg
				....
		| - class 1/
		  ....
		| - class n/
	| - validation/
  		| - class 0/
		| - class 1/
		  ....
		| - class n/

Run command below to train the model:

python train.py --classes num_classes --batch batch_size --epochs epochs --size image_size

The .h5 weight file was saved at model folder. If you want to do fine tune the trained model, you can run the following command. However, it should be noted that the size of the input image should be consistent with the original model.

python train.py --classes num_classes --batch batch_size --epochs epochs --size image_size --weights weights_path --tclasses pre_classes

Parameter explanation

  • --classes, The number of classes of dataset.
  • --size, The image size of train sample.
  • --batch, The number of train samples per batch.
  • --epochs, The number of train iterations.
  • --weights, Fine tune with other weights.
  • --tclasses, The number of classes of pre-trained model.

Reference

@article{MobileNetv2,  
  title={Inverted Residuals and Linear Bottlenecks Mobile Networks for Classification, Detection and Segmentatio},  
  author={Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen},
  journal={arXiv preprint arXiv:1801.04381},
  year={2018}
}

Copyright

See LICENSE for details.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap