{"id":13499093,"url":"https://github.com/Zehaos/MobileNet","last_synced_at":"2025-03-29T03:32:20.524Z","repository":{"id":42187767,"uuid":"88717189","full_name":"Zehaos/MobileNet","owner":"Zehaos","description":"MobileNet build with Tensorflow","archived":false,"fork":false,"pushed_at":"2017-11-06T01:23:28.000Z","size":413,"stargazers_count":1624,"open_issues_count":47,"forks_count":469,"subscribers_count":83,"default_branch":"master","last_synced_at":"2025-03-25T10:08:04.271Z","etag":null,"topics":["detection","mobilenets","multigpu","slim","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zehaos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-19T07:55:09.000Z","updated_at":"2025-03-17T13:58:32.000Z","dependencies_parsed_at":"2022-09-05T15:01:09.061Z","dependency_job_id":null,"html_url":"https://github.com/Zehaos/MobileNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zehaos%2FMobileNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zehaos%2FMobileNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zehaos%2FMobileNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zehaos%2FMobileNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zehaos","download_url":"https://codeload.github.com/Zehaos/MobileNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246135765,"owners_count":20729056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detection","mobilenets","multigpu","slim","tensorflow"],"created_at":"2024-07-31T22:00:28.457Z","updated_at":"2025-03-29T03:32:20.222Z","avatar_url":"https://github.com/Zehaos.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes"],"sub_categories":["MobileNet"],"readme":"# MobileNet\n\nA tensorflow implementation of Google's [MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)\n\nThe official implementation is avaliable at [tensorflow/model](https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md).\n\nThe official implementation of object detection is now released, see [tensorflow/model/object_detection](https://github.com/tensorflow/models/tree/master/research/object_detection).\n\n# News\nYellowFin optimizer has been intergrated, but I have no gpu resources to train on imagenet with it. Call for training \\~_\\~\n\nOfficial implement [click here](https://github.com/JianGoForIt/YellowFin)\n\n## Base Module\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Zehaos/MobileNet/blob/master/figures/dwl_pwl.png\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n## Accuracy on ImageNet-2012 Validation Set\n\n| Model | Width Multiplier |Preprocessing  | Accuracy-Top1|Accuracy-Top5 |\n|--------|:---------:|:------:|:------:|:------:|\n| MobileNet |1.0| Same as Inception | 66.51% | 87.09% |\n\nDownload the pretrained weight: [OneDrive](https://1drv.ms/u/s!AvkGtmrlCEhDhy1YqWPGTMl1ybee), [BaiduYun](https://pan.baidu.com/s/1i5xFjal) \n\n**Loss**\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Zehaos/MobileNet/blob/master/figures/epoch90_full_preprocess.png\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n## Time Benchmark\nEnvironment: Ubuntu 16.04 LTS, Xeon E3-1231 v3, 4 Cores @ 3.40GHz, GTX1060.\n\nTF 1.0.1(native pip install), TF 1.1.0(build from source, optimization flag '-mavx2')\n\n\n| Device | Forward| Forward-Backward |Instruction set|Quantized|Fused-BN|Remark|\n|--------|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|\n|CPU|52ms|503ms|-|-|-|TF 1.0.1|\n|CPU|44ms|177ms|-|-|On|TF 1.0.1|\n|CPU|31ms| - |-|8-bits|-|TF 1.0.1|\n|CPU|26ms| 75ms|AVX2|-|-|TF 1.1.0|\n|CPU|128ms| - |AVX2|8-bits|-|TF 1.1.0|\n|CPU|**19ms**| 89ms|AVX2|-|On|TF 1.1.0|\n|GPU|3ms|16ms|-|-|-|TF 1.0.1, CUDA8.0, CUDNN5.1|\n|GPU|**3ms**|15ms|-|-|On|TF 1.0.1, CUDA8.0, CUDNN5.1|\n\u003e Image Size: (224, 224, 3), Batch Size: 1\n\n## Usage\n\n### Train on Imagenet\n\n1. Prepare imagenet data. Please refer to Google's tutorial for [training inception](https://github.com/tensorflow/models/tree/master/inception#getting-started).\n\n2. Modify './script/train_mobilenet_on_imagenet.sh' according to your environment.\n\n```\nbash ./script/train_mobilenet_on_imagenet.sh\n```\n\n### Benchmark speed\n```\npython ./scripts/time_benchmark.py\n```\n\n### Train MobileNet Detector (Debugging)\n\n1. Prepare KITTI data.\n\nAfter download KITTI data, you need to split it data into train/val set.\n```\ncd /path/to/kitti_root\nmkdir ImageSets\ncd ./ImageSets\nls ../training/image_2/ | grep \".png\" | sed s/.png// \u003e trainval.txt\npython ./tools/kitti_random_split_train_val.py\n```\nkitti_root floder then look like below\n```\nkitti_root/\n                  |-\u003etraining/\n                  |     |-\u003e image_2/00****.png\n                  |     L-\u003e label_2/00****.txt\n                  |-\u003etesting/\n                  |     L-\u003e image_2/00****.png\n                  L-\u003eImageSets/\n                        |-\u003e trainval.txt\n                        |-\u003e train.txt\n                        L-\u003e val.txt\n```\nThen convert it into tfrecord.\n```\npython ./tools/tf_convert_data.py\n```\n\n2. Mobify './script/train_mobilenet_on_kitti.sh' according to your environment.\n```\nbash ./script/train_mobilenetdet_on_kitti.sh\n```\n\n\u003e The code of this subject is largely based on SqueezeDet \u0026 SSD-Tensorflow.\n\u003e I would appreciated if you could feed back any bug.\n\n## Trouble Shooting\n\n1. About the MobileNet model size\n\nAccording to the paper, MobileNet has 3.3 Million Parameters, which does not vary based on the input resolution. It means that the number of final model parameters should be larger than 3.3 Million, because of the fc layer.\n\nWhen using RMSprop training strategy, the checkpoint file size should be almost 3 times as large as the model size, because of some auxiliary parameters used in RMSprop. You can use the inspect_checkpoint.py to figure it out.\n\n2. Slim multi-gpu performance problems\n\n[#1390](https://github.com/tensorflow/models/issues/1390)\n[#1428](https://github.com/tensorflow/models/issues/1428#issuecomment-302589426)\n\n## TODO\n- [x] Train on Imagenet\n- [x] Add Width Multiplier Hyperparameters\n- [x] Report training result\n- [ ] Intergrate into object detection task(in progress)\n\n## Reference\n[MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)\n\n[SSD-Tensorflow](https://github.com/balancap/SSD-Tensorflow)\n\n[SqueezeDet](https://github.com/BichenWuUCB/squeezeDet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZehaos%2FMobileNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZehaos%2FMobileNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZehaos%2FMobileNet/lists"}