You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Readme.md 6.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # Contents
  2. - [GhostNet Description](#ghostnet-description)
  3. - [Model Architecture](#model-architecture)
  4. - [Dataset](#dataset)
  5. - [Environment Requirements](#environment-requirements)
  6. - [Script Description](#script-description)
  7. - [Script and Sample Code](#script-and-sample-code)
  8. - [Training Process](#training-process)
  9. - [Evaluation Process](#evaluation-process)
  10. - [Evaluation](#evaluation)
  11. - [Model Description](#model-description)
  12. - [Performance](#performance)
  13. - [Training Performance](#evaluation-performance)
  14. - [Inference Performance](#evaluation-performance)
  15. - [Description of Random Situation](#description-of-random-situation)
  16. - [ModelZoo Homepage](#modelzoo-homepage)
  17. ## [GhostNet Description](#contents)
  18. The GhostNet architecture is based on an Ghost module structure which generate more features from cheap operations. Based on a set of intrinsic feature maps, a series of cheap operations are applied to generate many ghost feature maps that could fully reveal information underlying intrinsic features.
  19. [Paper](https://openaccess.thecvf.com/content_CVPR_2020/papers/Han_GhostNet_More_Features_From_Cheap_Operations_CVPR_2020_paper.pdf): Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, Chang Xu. GhostNet: More Features from Cheap Operations. CVPR 2020.
  20. ## [Model architecture](#contents)
  21. The overall network architecture of GhostNet is show below:
  22. [Link](https://openaccess.thecvf.com/content_CVPR_2020/papers/Han_GhostNet_More_Features_From_Cheap_Operations_CVPR_2020_paper.pdf)
  23. ## [Dataset](#contents)
  24. Dataset used: [Oxford-IIIT Pet](https://www.robots.ox.ac.uk/~vgg/data/pets/)
  25. - Dataset size: 7049 colorful images in 1000 classes
  26. - Train: 3680 images
  27. - Test: 3369 images
  28. - Data format: RGB images.
  29. - Note: Data will be processed in src/dataset.py
  30. ## [Environment Requirements](#contents)
  31. - Hardware(Ascend/GPU)
  32. - Prepare hardware environment with Ascend or GPU.
  33. - Framework
  34. - [MindSpore](https://www.mindspore.cn/install/en)
  35. - For more information, please check the resources below:
  36. - [MindSpore Tutorials](https://www.mindspore.cn/tutorial/training/en/master/index.html)
  37. - [MindSpore Python API](https://www.mindspore.cn/doc/api_python/en/master/index.html)
  38. ## [Script description](#contents)
  39. ### [Script and sample code](#contents)
  40. ```python
  41. ├── GhostNet
  42. ├── Readme.md # descriptions about ghostnet # shell script for evaluation with CPU, GPU or Ascend
  43. ├── src
  44. │ ├──config.py # parameter configuration
  45. │ ├──dataset.py # creating dataset
  46. │ ├──launch.py # start python script
  47. │ ├──lr_generator.py # learning rate config
  48. │ ├──ghostnet.py # GhostNet architecture
  49. │ ├──ghostnet600.py # GhostNet-600M architecture
  50. ├── eval.py # evaluation script
  51. ├── mindspore_hub_conf.py # export model for hub
  52. ```
  53. ## [Training process](#contents)
  54. To Be Done
  55. ## [Eval process](#contents)
  56. ### Usage
  57. After installing MindSpore via the official website, you can start evaluation as follows:
  58. ### Launch
  59. ```bash
  60. # infer example
  61. Ascend: python eval.py --model [ghostnet/ghostnet-600] --dataset_path ~/Pets/test.mindrecord --platform Ascend --checkpoint_path [CHECKPOINT_PATH]
  62. GPU: python eval.py --model [ghostnet/ghostnet-600] --dataset_path ~/Pets/test.mindrecord --platform GPU --checkpoint_path [CHECKPOINT_PATH]
  63. ```
  64. > checkpoint can be produced in training process.
  65. ### Result
  66. ```bash
  67. result: {'acc': 0.8113927500681385} ckpt= ./ghostnet_nose_1x_pets.ckpt
  68. result: {'acc': 0.824475333878441} ckpt= ./ghostnet_1x_pets.ckpt
  69. result: {'acc': 0.8691741618969746} ckpt= ./ghostnet600M_pets.ckpt
  70. ```
  71. ## [Model Description](#contents)
  72. ### [Performance](#contents)
  73. #### Evaluation Performance
  74. ##### GhostNet on ImageNet2012
  75. | Parameters | | |
  76. | -------------------------- | -------------------------------------- |---------------------------------- |
  77. | Model Version | GhostNet |GhostNet-600|
  78. | uploaded Date | 09/08/2020 (month/day/year) ; | 09/08/2020 (month/day/year) |
  79. | MindSpore Version | 0.6.0-alpha |0.6.0-alpha |
  80. | Dataset | ImageNet2012 | ImageNet2012|
  81. | Parameters (M) | 5.2 | 11.9 |
  82. | FLOPs (M) | 142 | 591 |
  83. | Accuracy (Top1) | 73.9 |80.2 |
  84. ###### GhostNet on Oxford-IIIT Pet
  85. | Parameters | | |
  86. | -------------------------- | -------------------------------------- |---------------------------------- |
  87. | Model Version | GhostNet |GhostNet-600|
  88. | uploaded Date | 09/08/2020 (month/day/year) ; | 09/08/2020 (month/day/year) |
  89. | MindSpore Version | 0.6.0-alpha |0.6.0-alpha |
  90. | Dataset | Oxford-IIIT Pet | Oxford-IIIT Pet|
  91. | Parameters (M) | 3.9 | 10.6 |
  92. | FLOPs (M) | 140 | 590 |
  93. | Accuracy (Top1) | 82.4 |86.9 |
  94. ###### Comparison with other methods on Oxford-IIIT Pet
  95. |Model|FLOPs (M)|Latency (ms)*|Accuracy (Top1)|
  96. |-|-|-|-|
  97. |MobileNetV2-1x|300|28.2|78.5|
  98. |Ghost-1x w\o SE|138|19.1|81.1|
  99. |Ghost-1x|140|25.3|82.4|
  100. |Ghost-600|590|-|86.9|
  101. *The latency is measured on Huawei Kirin 990 chip under single-threaded mode with batch size 1.
  102. ## [Description of Random Situation](#contents)
  103. In dataset.py, we set the seed inside “create_dataset" function. We also use random seed in train.py.
  104. ## [ModelZoo Homepage](#contents)
  105. Please check the official [homepage](https://gitee.com/mindspore/mindspore/tree/master/model_zoo).