{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ghostnetv2-enhance-cheap-operation-with-long","title":"GhostNetV2: Enhance Cheap Operation with Long-Range Attention","arxiv_id":"2211.12905","date":"2022-11-23","proceeding":null,"authors":["Yehui Tang","Kai Han","Jianyuan Guo","Chang Xu","Chao Xu","Yunhe Wang"],"abstract":"Light-weight convolutional neural networks (CNNs) are specially designed for applications on mobile devices with faster inference speed. The convolutional operation can only capture local information in a window region, which prevents performance from being further improved. Introducing self-attention into convolution can capture global information well, but it will largely encumber the actual speed. In this paper, we propose a hardware-friendly attention mechanism (dubbed DFC attention) and then present a new GhostNetV2 architecture for mobile applications. The proposed DFC attention is constructed based on fully-connected layers, which can not only execute fast on common hardware but also capture the dependence between long-range pixels. We further revisit the expressiveness bottleneck in previous GhostNet and propose to enhance expanded features produced by cheap operations with DFC attention, so that a GhostNetV2 block can aggregate local and long-range information simultaneously. Extensive experiments demonstrate the superiority of GhostNetV2 over existing architectures. For example, it achieves 75.3% top-1 accuracy on ImageNet with 167M FLOPs, significantly suppressing GhostNetV1 (74.5%) with a similar computational cost. The source code will be available at https://github.com/huawei-noah/Efficient-AI-Backbones/tree/master/ghostnetv2_pytorch and https://gitee.com/mindspore/models/tree/master/research/cv/ghostnetv2.","url_abs":"https://arxiv.org/abs/2211.12905v1","url_pdf":"https://arxiv.org/pdf/2211.12905v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/james77777778/keras-image-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/likyoo/GhostNetV2-PyTorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/rwightman/pytorch-image-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/2023-MindSpore-1/ms-code-214/tree/main/Inception-v2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/2023-MindSpore-4/Code10/tree/main/ghostnetv2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/MindSpore-paper-code-3/code10/tree/main/ghostnet_quant","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/MindSpore-paper-code-3/code10/tree/main/ghostnetv2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/MindSpore-paper-code-3/code4/tree/main/ghostnet_quant","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/MindSpore-paper-code-3/code4/tree/main/ghostnetv2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/MindSpore-paper-code-3/code7/tree/main/ghostnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://github.com/leondgarse/keras_cv_attention_models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ghostnetv2-enhance-cheap-operation-with-long","repo_url":"https://gitlab.com/birder/birder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"depthwise-convolution","method_name":"Depthwise Convolution"},{"method_slug":"depthwise-separable-convolution","method_name":"Depthwise Separable Convolution"},{"method_slug":"ghost-bottleneck","method_name":"Ghost Bottleneck"},{"method_slug":"ghost-module","method_name":"Ghost Module"},{"method_slug":"ghostnet","method_name":"GhostNet"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"pointwise-convolution","method_name":"Pointwise Convolution"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"squeeze-and-excitation-block","method_name":"Squeeze-and-Excitation Block"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.12905","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.12905"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rwightman/pytorch-image-models","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2023-MindSpore-1/ms-code-214/tree/main/Inception-v2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/james77777778/keras-image-models","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code4/tree/main/ghostnet_quant","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code4/tree/main/ghostnetv2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leondgarse/keras_cv_attention_models","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code10/tree/main/ghostnetv2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code10/tree/main/ghostnet_quant","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/likyoo/GhostNetV2-PyTorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2023-MindSpore-4/Code10/tree/main/ghostnetv2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://gitlab.com/birder/birder","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code7/tree/main/ghostnet","reach":null}],"summary":{"ran":7,"ran_honours":1,"unverified":2},"by_repo_kind":{"listed":{"samples":10,"ran":8,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":10,"samples":[{"code_sha256_prefix":"f295958130866a4d","entry":"Activation","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f295958130866a4d"}},{"code_sha256_prefix":"5bc1a810d3aa4dfd","entry":"ConvUnit","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5bc1a810d3aa4dfd"}},{"code_sha256_prefix":"8e0938682f8c46bd","entry":"GhostModule","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8e0938682f8c46bd"}},{"code_sha256_prefix":"0362c80e323d4270","entry":"GhostModuleMul","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0362c80e323d4270"}},{"code_sha256_prefix":"5ba455372a5f8ea8","entry":"GlobalAvgPooling","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5ba455372a5f8ea8"}},{"code_sha256_prefix":"218a488e241986f2","entry":"MyHSigmoid","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"218a488e241986f2"}},{"code_sha256_prefix":"3c1bd49a9cc3a99d","entry":"SE","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c1bd49a9cc3a99d"}},{"code_sha256_prefix":"75495d6418418155","entry":"_make_divisible","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"75495d6418418155"}},{"code_sha256_prefix":"7394379d320c1eb9","entry":"GhostBottleneck","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7394379d320c1eb9"}},{"code_sha256_prefix":"ae3b3871629b22b2","entry":"GhostNet","repo":"likyoo/GhostNetV2-PyTorch","repo_kind":"listed","path":"ghostnetv2.py","file_url":"https://github.com/likyoo/GhostNetV2-PyTorch/blob/HEAD/ghostnetv2.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ae3b3871629b22b2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}