{"notes":[{"id":"lightweight/ghostnet","category":"lightweight","legacyPath":"lightweight/1911-ghostnet","legacySlug":"1911-ghostnet","legacyPaths":[],"title":"GhostNet","subtitle":"Ghost in Feature Maps","author":"Z. Yuan","paperDate":"2019-11-27","publishedOn":"2024-07-23","paperTitle":"GhostNet: More Features from Cheap Operations","paperUrl":"https://arxiv.org/abs/1911.11907","bibliography":{"title":"GhostNet: More Features from Cheap Operations","authors":["Kai Han","Yunhe Wang","Qi Tian","Jianyuan Guo","Chunjing Xu","Chang Xu"],"url":"https://arxiv.org/abs/1911.11907","pdfUrl":"https://arxiv.org/pdf/1911.11907","codeUrl":"https://github.com/huawei-noah/ghostnet","preprint":{"id":"1911.11907","submittedOn":"2019-11-27","url":"https://arxiv.org/abs/1911.11907"},"publication":{"venue":"CVPR","year":2020,"kind":"conference","url":"https://arxiv.org/abs/1911.11907"},"citation":"@misc{lightweightghostnet2019,\n  title = {{GhostNet: More Features from Cheap Operations}},\n  author = {Kai Han and Yunhe Wang and Qi Tian and Jianyuan Guo and Chunjing Xu and Chang Xu},\n  year = {2019},\n  eprint = {1911.11907},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1911.11907}\n}\n","citationPath":"/content/papers/citations/lightweight/ghostnet.4dd65d9540bb.bib"},"thumbnail":{"src":"/content/papers/assets/22fa9d36b042deb7995e9695a803de3a973542f58cd9cd48e37ef13167df2222.jpg","width":972,"height":904},"locale":"en","path":"/content/papers/en/lightweight/ghostnet.fb6ae4b0873d.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"module-configuration","text":"Module Configuration","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"performance-on-imagenet","text":"Performance on ImageNet","depth":3},{"id":"actual-inference-speed","text":"Actual Inference Speed","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"lightweight/shufflenet","relation":"comparison","topic":"Reducing convolution and channel cost"},{"id":"lightweight/pp-lcnet","relation":"comparison","topic":"Reducing convolution and channel cost"}]},{"id":"lightweight/shufflenet","category":"lightweight","legacyPath":"lightweight/1707-shufflenet","legacySlug":"1707-shufflenet","legacyPaths":[],"title":"ShuffleNet","subtitle":"Channel Shuffling Network","author":"Z. Yuan","paperDate":"2017-07-04","publishedOn":"2024-06-26","paperTitle":"ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices","paperUrl":"https://arxiv.org/abs/1707.01083","bibliography":{"title":"ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices","authors":["Xiangyu Zhang","Xinyu Zhou","Mengxiao Lin","Jian Sun"],"url":"https://arxiv.org/abs/1707.01083","pdfUrl":"https://arxiv.org/pdf/1707.01083","codeUrl":null,"preprint":{"id":"1707.01083","submittedOn":"2017-07-04","url":"https://arxiv.org/abs/1707.01083"},"publication":{"venue":"CVPR","year":2018,"kind":"conference","url":"https://doi.org/10.1109/cvpr.2018.00716"},"citation":"@misc{lightweightshufflenet2017,\n  title = {{ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices}},\n  author = {Xiangyu Zhang and Xinyu Zhou and Mengxiao Lin and Jian Sun},\n  year = {2017},\n  eprint = {1707.01083},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1707.01083}\n}\n","citationPath":"/content/papers/citations/lightweight/shufflenet.1e5a6869f5a9.bib"},"thumbnail":{"src":"/content/papers/assets/6d0c746d403d2823809ffbd52c9b3614cc2063afee07608d6d0cb26b11fc3ac8.jpg","width":1746,"height":678},"locale":"en","path":"/content/papers/en/lightweight/shufflenet.faaefe20498b.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"computation-and-speed-do-not-always-match","text":"Computation and Speed Do Not Always Match","depth":3},{"id":"the-cost-of-11-convolutions","text":"The Cost of 1×1 Convolutions","depth":3},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"group-convolution-and-cross-group-flow","text":"Group Convolution and Cross-Group Flow","depth":3},{"id":"channel-shuffle","text":"Channel Shuffle","depth":3},{"id":"where-does-the-shuffle-go","text":"Where Does the Shuffle Go?","depth":3},{"id":"network-architecture","text":"Network Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"effect-of-group-convolution","text":"Effect of Group Convolution","depth":3},{"id":"effect-of-channel-shuffle","text":"Effect of Channel Shuffle","depth":3},{"id":"comparison-with-mobilenet","text":"Comparison with MobileNet","depth":3},{"id":"actual-inference-speed","text":"Actual Inference Speed","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"lightweight/ghostnet","relation":"comparison","topic":"Reducing convolution and channel cost"},{"id":"lightweight/pp-lcnet","relation":"comparison","topic":"Reducing convolution and channel cost"}]},{"id":"lightweight/pp-lcnet","category":"lightweight","legacyPath":"lightweight/2109-pp-lcnet","legacySlug":"2109-pp-lcnet","legacyPaths":[],"title":"PP-LCNet","subtitle":"Exploring the Boundaries of Speed","author":"Z. Yuan","paperDate":"2021-09-17","publishedOn":"2024-06-25","paperTitle":"PP-LCNet: A Lightweight CPU Convolutional Neural Network","paperUrl":"https://arxiv.org/abs/2109.15099","bibliography":{"title":"PP-LCNet: A Lightweight CPU Convolutional Neural Network","authors":["Cheng Cui","Tingquan Gao","Shengyu Wei","Yuning Du","Ruoyu Guo","Shuilong Dong","Bin Lu","Ying Zhou","Xueying Lv","Qiwen Liu","Xiaoguang Hu","Dianhai Yu","Yanjun Ma"],"url":"https://arxiv.org/abs/2109.15099","pdfUrl":"https://arxiv.org/pdf/2109.15099","codeUrl":null,"preprint":{"id":"2109.15099","submittedOn":"2021-09-17","url":"https://arxiv.org/abs/2109.15099"},"publication":null,"citation":"@misc{lightweightpplcnet2021,\n  title = {{PP-LCNet: A Lightweight CPU Convolutional Neural Network}},\n  author = {Cheng Cui and Tingquan Gao and Shengyu Wei and Yuning Du and Ruoyu Guo and Shuilong Dong and Bin Lu and Ying Zhou and Xueying Lv and Qiwen Liu and Xiaoguang Hu and Dianhai Yu and Yanjun Ma},\n  year = {2021},\n  eprint = {2109.15099},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2109.15099}\n}\n","citationPath":"/content/papers/citations/lightweight/pp-lcnet.2f8ae63c431a.bib"},"thumbnail":{"src":"/content/papers/assets/bba59bbde82b2b9237b883b28433cb3ac5b8dc0ff1fe8b70b81c04b2581078c3.jpg","width":1224,"height":708},"locale":"en","path":"/content/papers/en/lightweight/pp-lcnet.e4f3ad98b05f.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"experimental-results","text":"Experimental Results","depth":3},{"id":"ablation-studies","text":"Ablation Studies","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"lightweight/shufflenet","relation":"comparison","topic":"Reducing convolution and channel cost"},{"id":"lightweight/ghostnet","relation":"comparison","topic":"Reducing convolution and channel cost"},{"id":"lightweight/senet","relation":"comparison","topic":"Channel attention in lightweight networks"}]}],"text":"After the introduction of MobileNet, many researchers continued to work on improving the performance of lightweight networks.\n\nThis paper specifically addresses the problem of \"feature map redundancy.\"\n\n## Defining the Problem\n\n\n\n![Paper Figure 1: similar feature-map pairs across ResNet-50 channels](/content/papers/assets/30260181e4f0f24a1fb9d4336bc664c884f94b9f32a8510d330eda05e534cae2.jpg \"Han et al., GhostNet, arXiv:1911.11907v2, Figure 1\")\n\n\n\nConvolutional networks often produce similar feature maps in different channels. These maps still carry useful information, but making each one with a full convolution costs computation. The figure highlights pairs of similar maps across channels: could some be generated from others with cheaper operations?\n\n## Solving the Problem\n\nGenerally, there are two common approaches: model compression and making the model more compact.\n\n### Model Architecture\n\n\n\n![Paper Figure 2: standard convolution and the Ghost module producing the same output-channel count](/content/papers/assets/22fa9d36b042deb7995e9695a803de3a973542f58cd9cd48e37ef13167df2222.jpg \"Han et al., arXiv:1911.11907v2, Figure 2\")\n\n\n\nIn GhostNet, the authors proposed a new model architecture, as shown above.\n\nUnlike typical convolutional networks, the GhostNet module operates in two steps:\n\n1. First, fewer convolutional filters generate a small set of intrinsic feature maps A. There are fewer intrinsic channels than the target output channels, though not necessarily fewer than the input channels.\n2. Then, linear operations are applied to each channel of the base feature map A to generate \"ghost feature maps\" B.\n\nFinally, the base feature map A and the ghost feature maps B are concatenated to obtain the final feature map.\n\nThese channel-wise operations can be depthwise convolutions. Compared with full convolutions that mix input channels, they generate the additional maps at lower cost.\n\n\n> [!TIP]\n> \n> The paper allows different cheap linear operations for each channel. Its experiments mainly use depthwise convolution to generate the extra features independently from each intrinsic channel.\n\n\n### Module Configuration\n\n\n\n![Paper Figure 3: stride-1 and stride-2 Ghost bottlenecks](/content/papers/assets/ca97024033178cb8b7cf2cb16e463e14864a43aa77eca036350dfa6429e4dfd1.jpg \"Han et al., arXiv:1911.11907v2, Figure 3\")\n\n\n\n- **Ghost Bottlenecks**\n\n  Leveraging the advantages of the ghost module, the authors introduced ghost bottlenecks (G-bnecks) designed specifically for small CNNs. This design is similar to the basic residual blocks in ResNet, combining multiple convolution layers and shortcuts.\n\n  The ghost bottleneck primarily consists of two stacked ghost modules. The first ghost module acts as an expansion layer, increasing the number of channels, with the expansion ratio defined as the ratio of the output channels to the input channels. The second ghost module reduces the number of channels to match the shortcut path and connects the input and output of these two ghost modules through a shortcut.\n\n  The first Ghost module is followed by batch normalization (BN) and ReLU. Following MobileNetV2, the second is followed by BN but no ReLU. For stride 2, a depthwise downsampling convolution is inserted between the modules, and the shortcut is resized to match.\n\n- **GhostNet**\n\n  Based on ghost bottlenecks, the authors proposed GhostNet.\n\n  This architecture generally follows the design of MobileNetV3, replacing its bottleneck blocks with ghost bottlenecks. GhostNet mainly consists of a series of ghost bottlenecks, starting with a standard convolution layer with 16 filters, followed by a series of ghost bottlenecks with gradually increasing channels. These ghost bottlenecks are divided into different stages based on the size of the input feature maps.\n\n  Stride 2 is used where the network reduces spatial resolution; the other bottlenecks use stride 1. The configuration table below specifies these transitions. Finally, the feature map is converted to a 1280-dimensional feature vector for final classification through global average pooling and a convolution layer.\n\n  Some ghost bottlenecks also use squeeze-and-excitation (SE) modules. Unlike MobileNetV3, GhostNet does not use hard-swish because of its latency cost in the authors' setting.\n\n- **Width Multiplier**:\n\n  Although the basic architecture of GhostNet already provides low latency and high accuracy, in some cases, smaller, faster models or higher accuracy for specific tasks may be required.\n\n  To meet different needs, the number of channels in each layer can be multiplied by a factor $\\alpha$, known as the width multiplier. This changes the width of the network, with model size and computation scaling **roughly** with $\\alpha^2$. Channel-wise work and fixed-width layers mean this is only an approximation; actual latency still needs measurement.\n\n  Generally, smaller $\\alpha$ leads to lower latency and performance, while larger $\\alpha$ improves performance. This design flexibility allows GhostNet to adapt to different application scenarios and requirements.\n\nThe final model configuration is shown in the table below:\n\n\n\n![Paper Table 1: GhostNet stage inputs, expansion channels, outputs, SE, and strides](/content/papers/assets/0e3c7c64cb950b248ef12b3efb591d3cf304a49fd2a60620023eeb39706b49d3.jpg \"Han et al., arXiv:1911.11907v2, Table 1\")\n\n\n\n## Discussion\n\n### Performance on ImageNet\n\n![Paper Table 7: parameters and ImageNet accuracy across three FLOP ranges](/content/papers/assets/e7b1d57e46c0e2950d6fe50638c871ccc12f3e4bdd0b22d4202175a7ab71d395.jpg \"Han et al., arXiv:1911.11907v2, Table 7\")\n\nTo verify the superiority of the proposed GhostNet, the authors conducted experiments on the ImageNet image classification task.\n\nThe authors follow earlier training settings, except that the initial learning rate is 0.4 for a batch of 1024 on 8 GPUs. All results report single-crop top-1 accuracy on the ImageNet validation set. For GhostNet, the primary convolution has kernel size k = 1, and all Ghost modules use s = 2 (two outputs per intrinsic channel, including the original) and d = 3 (the cheap convolution's kernel size).\n\nThe authors selected several modern small network architectures as competitors, including the MobileNet series, ShuffleNet series, ProxylessNAS, FBNet, and MnasNet, with results summarized in the table above.\n\nThese models are grouped around **50**, **150**, and **200–300 MFLOPs**, common budgets for mobile applications. GhostNet is competitive in all three groups. For example, GhostNet 0.5× reports **42 MFLOPs/66.2%** versus MobileNetV3 Small 0.75× at **44/65.4%**, and GhostNet 1.0× reports **141/73.9%** versus MobileNetV3 Large 0.75× at **155/73.3%**. GhostNet 1.3× reaches **226/75.7%** versus MobileNetV3 Large 1.0× at **219/75.2%**: it is more accurate there, but also uses slightly more FLOPs.\n\n### Actual Inference Speed\n\nSince the proposed GhostNet is designed for mobile applications, the authors further measured the actual inference speed of GhostNet on an ARM-based mobile phone using TFLite tools. In single-thread mode with a batch size of 1, they used common settings from the literature.\n\nFrom the results below, it can be seen that GhostNet achieves approximately **0.5 percentage points** higher top-1 accuracy than MobileNetV3 at the same latency, and GhostNet requires less runtime to achieve similar performance. For instance, GhostNet has only 40ms latency at 75.0% accuracy, whereas MobileNetV3 requires about 45ms to process an image at a similar accuracy level.\n\n![Paper Figures 6 and 7: ImageNet top-1 against FLOPs and ARM-phone inference latency](/content/papers/assets/e9d9398b003d3d3279303fc7ed6ac3f5c3dcfc5a341a2fa6092a9524fab69844.jpg \"Han et al., arXiv:1911.11907v2, Figures 6–7\")\n\n\n> [!TIP]\n> \n> In the paper, the test inference speed is based on ARM architecture mobile phones and tested with TF-Lite. In fact, the author did not mention which mobile phone to use. Based on our own experience, the same configuration and model will perform differently on different brands of mobile phones.\n> \n> Therefore, we recommend that readers conduct their own experiments when using GhostNet to ensure that its inference speed meets their needs.\n\n\n## Conclusion\n\nTo reduce the computational cost of deep networks, the paper proposes a Ghost module for building efficient architectures. It is a convenient building block that can replace convolutions when designing a compact model, while retaining comparable performance after training. It is not an exact conversion that guarantees the original accuracy without retraining.\n\nIn the process of developing neural networks, the GhostNet architecture can be a viable option, especially in resource-constrained scenarios, potentially offering more possibilities.\n","imageSizes":{"/content/papers/assets/30260181e4f0f24a1fb9d4336bc664c884f94b9f32a8510d330eda05e534cae2.jpg":{"width":1224,"height":816},"/content/papers/assets/22fa9d36b042deb7995e9695a803de3a973542f58cd9cd48e37ef13167df2222.jpg":{"width":972,"height":904},"/content/papers/assets/ca97024033178cb8b7cf2cb16e463e14864a43aa77eca036350dfa6429e4dfd1.jpg":{"width":856,"height":744},"/content/papers/assets/0e3c7c64cb950b248ef12b3efb591d3cf304a49fd2a60620023eeb39706b49d3.jpg":{"width":960,"height":1080},"/content/papers/assets/e7b1d57e46c0e2950d6fe50638c871ccc12f3e4bdd0b22d4202175a7ab71d395.jpg":{"width":1224,"height":732},"/content/papers/assets/e9d9398b003d3d3279303fc7ed6ac3f5c3dcfc5a341a2fa6092a9524fab69844.jpg":{"width":3703,"height":1352}}}
