{"id":13499094,"url":"https://github.com/shicai/MobileNet-Caffe","last_synced_at":"2025-03-29T04:30:27.285Z","repository":{"id":49934064,"uuid":"89568797","full_name":"shicai/MobileNet-Caffe","owner":"shicai","description":"Caffe Implementation of Google's MobileNets (v1 and v2)","archived":false,"fork":false,"pushed_at":"2021-06-08T06:28:43.000Z","size":28678,"stargazers_count":1263,"open_issues_count":47,"forks_count":705,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-03-18T07:25:35.613Z","etag":null,"topics":["caffe","imagenet","mobilenet","mobilenetv2","mobilnet-v2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shicai.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-27T07:29:23.000Z","updated_at":"2025-03-15T00:13:32.000Z","dependencies_parsed_at":"2022-07-29T01:18:14.551Z","dependency_job_id":null,"html_url":"https://github.com/shicai/MobileNet-Caffe","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/shicai%2FMobileNet-Caffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shicai%2FMobileNet-Caffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shicai%2FMobileNet-Caffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shicai%2FMobileNet-Caffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shicai","download_url":"https://codeload.github.com/shicai/MobileNet-Caffe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245431722,"owners_count":20614182,"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":["caffe","imagenet","mobilenet","mobilenetv2","mobilnet-v2"],"created_at":"2024-07-31T22:00:28.481Z","updated_at":"2025-03-29T04:30:25.416Z","avatar_url":"https://github.com/shicai.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes","Core ML"],"sub_categories":["MobileNet","Models :rocket:"],"readme":"# MobileNet-Caffe\n\n### Introduction\n\nThis is a Caffe implementation of Google's MobileNets (v1 and v2). For details, please read the following papers:\n- [v1] [MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)\n- [v2] [Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation](https://arxiv.org/abs/1801.04381)\n\n\n### Pretrained Models on ImageNet\n\nWe provide pretrained MobileNet models on ImageNet, which achieve slightly better accuracy rates than the original ones reported in the paper. \n\nThe top-1/5 accuracy rates by using single center crop (crop size: 224x224, image size: 256xN):\n\nNetwork|Top-1|Top-5|sha256sum|Architecture\n:---:|:---:|:---:|:---:|:---:\nMobileNet v1| 70.81| 89.85| 8d6edcd3 (16.2 MB) | [netscope](http://ethereon.github.io/netscope/#/gist/2883d142ae486d4237e50f392f32994e), [netron](http://lutzroeder.github.io/netron?gist=2883d142ae486d4237e50f392f32994e)\nMobileNet v2| 71.90| 90.49| a3124ce7 (13.5 MB)| [netscope](http://ethereon.github.io/netscope/#/gist/d01b5b8783b4582a42fe07bd46243986), [netron](http://lutzroeder.github.io/netron?gist=d01b5b8783b4582a42fe07bd46243986)\n\n\n### Evaluate Models with a single image\n\nEvaluate MobileNet v1:\n\n`python eval_image.py --proto mobilenet_deploy.prototxt --model mobilenet.caffemodel --image ./cat.jpg`\n\nExpected Outputs:\n\n```\n0.42 - 'n02123159 tiger cat'\n0.08 - 'n02119022 red fox, Vulpes vulpes'\n0.07 - 'n02119789 kit fox, Vulpes macrotis'\n0.06 - 'n02113023 Pembroke, Pembroke Welsh corgi'\n0.06 - 'n02123045 tabby, tabby cat'\n```\n\nEvaluate MobileNet v2:\n\n`python eval_image.py --proto mobilenet_v2_deploy.prototxt --model mobilenet_v2.caffemodel  --image ./cat.jpg`\n\nExpected Outputs:\n\n```\n0.26 - 'n02123159 tiger cat'\n0.22 - 'n02124075 Egyptian cat'\n0.15 - 'n02123045 tabby, tabby cat'\n0.04 - 'n02119022 red fox, Vulpes vulpes'\n0.02 - 'n02326432 hare'\n```\n\n### Finetuning on your own data\nModify `deploy.prototxt` and save it as your `train.prototxt` as follows:\nRemove the first 5 `input`/`input_dim` lines, and add `Image Data` layer in the beginning like this:\n```\nlayer {\n  name: \"data\"\n  type: \"ImageData\"\n  top: \"data\"\n  top: \"label\"\n  include {\n    phase: TRAIN\n  }\n  transform_param {\n    scale: 0.017\n    mirror: true\n    crop_size: 224\n    mean_value: [103.94, 116.78, 123.68]\n  }\n  image_data_param {\n    source: \"your_list_train_txt\"\n    batch_size: 32 # your batch size\n    new_height: 256\n    new_width: 256\n    root_folder: \"your_path_to_training_data_folder\"\n  }\n}\n\n```\n\nRemove the last `prob` layer, and add `Loss` and `Accuracy` layers in the end like this:\n```\nlayer {\n  name: \"loss\"\n  type: \"SoftmaxWithLoss\"\n  bottom: \"fc7\"\n  bottom: \"label\"\n  top: \"loss\"\n}\nlayer {\n  name: \"top1/acc\"\n  type: \"Accuracy\"\n  bottom: \"fc7\"\n  bottom: \"label\"\n  top: \"top1/acc\"\n  include {\n    phase: TEST\n  }\n}\nlayer {\n  name: \"top5/acc\"\n  type: \"Accuracy\"\n  bottom: \"fc7\"\n  bottom: \"label\"\n  top: \"top5/acc\"\n  include {\n    phase: TEST\n  }\n  accuracy_param {\n    top_k: 5\n  }\n}\n```\n### Related Projects\nMobileNet in this repo has been used in the following projects, we recommend you to take a look:\n- The MobileNet neural network using Apple's new CoreML framework\n [hollance/MobileNet-CoreML](https://github.com/hollance/MobileNet-CoreML)\n- Mobile-deep-learning [baidu/mobile-deep-learning](https://github.com/baidu/mobile-deep-learning)\n- Receptive Field Block Net for Accurate and Fast Object Detection [ruinmessi/RFBNet](https://github.com/ruinmessi/RFBNet)\n- Depthwise Convolutional Layer [yonghenglh6/DepthwiseConvolution](https://github.com/yonghenglh6/DepthwiseConvolution)\n- MobileNet-MXNet [KeyKy/mobilenet-mxnet](https://github.com/KeyKy/mobilenet-mxnet)\n- Caffe2-MobileNet [camel007/caffe2-mobilenet](https://github.com/camel007/caffe2-mobilenet)\n\n\n### Updates (Feb. 5, 2018)\n\n- Add pretrained MobileNet v2 models (including deploy.prototxt and weights)\n- Hold pretrained weights in this repo\n- Add sha256sum code for pretrained weights\n- Add some code snippets for single image evaluation\n- Uncomment **engine: CAFFE** used in `mobilenet_deploy.prototxt`\n- Add params (`lr_mult` and `decay_mult`) for `Scale` layers of `mobilenet_deploy.prototxt`\n- Add `prob` layer for `mobilenet_deploy.prototxt`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshicai%2FMobileNet-Caffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshicai%2FMobileNet-Caffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshicai%2FMobileNet-Caffe/lists"}