[{"data":1,"prerenderedAt":811},["ShallowReactive",2],{"content-query-HAyHcppYVQ":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":805,"_id":806,"_source":807,"_file":808,"_stem":809,"_extension":810},"/technology-blogs/zh/823","zh",false,"","MindSpore新型轻量级神经网络GhostNet","在ImageNet分类、图像识别和目标检测等多个应用场景效果优异，已开源欢迎体验","2021-12-06","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/794a24091fbb48429f86943d4ef199b9.png","technology-blogs","大V博文",{"type":15,"children":16,"toc":784},"root",[17,25,31,44,55,60,74,86,98,110,122,128,149,163,171,176,190,196,207,212,247,254,259,268,273,280,315,324,338,345,350,369,376,381,390,404,411,416,422,436,443,448,454,468,473,480,485,490,497,511,516,523,529,538,543,548,565,572,577,587,592,597,623,630,635,641,649,662,675,688,703,709,714,721,726,731,743,755,760,772],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"mindspore新型轻量级神经网络ghostnet",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":30},"作者：李锐锋",{"type":18,"tag":26,"props":32,"children":33},{},[34,36],{"type":24,"value":35},"作者主页：",{"type":18,"tag":37,"props":38,"children":42},"a",{"href":39,"rel":40},"https://www.zhihu.com/people/risenberg/posts",[41],"nofollow",[43],{"type":24,"value":39},{"type":18,"tag":26,"props":45,"children":46},{},[47,49],{"type":24,"value":48},"文章来源：",{"type":18,"tag":37,"props":50,"children":53},{"href":51,"rel":52},"https://zhuanlan.zhihu.com/p/441356415",[41],[54],{"type":24,"value":51},{"type":18,"tag":26,"props":56,"children":57},{},[58],{"type":24,"value":59},"摘要",{"type":18,"tag":26,"props":61,"children":62},{},[63,65,72],{"type":24,"value":64},"华为研究员提出一种新型轻量神经网络架构，表现全面超越谷歌MobileNetV3和Facebook的FBNet，相关论文累计引用近300，入围PaperDigest的CVPR 2020 Most Influential Papers榜单。论文提出了一个全新的Ghost模块，旨在通过廉价操作生成更多的特征图。基于一组原始的特征图，作者应用一系列线性变换，以很小的代价生成许多能从原始特征发掘所需信息的“幻影”特征图（Ghost feature maps）。该Ghost模块即插即用，通过堆叠Ghost模块得出Ghost bottleneck，进而搭建轻量级",{"type":18,"tag":37,"props":66,"children":69},{"href":67,"rel":68},"https://www.zhihu.com/search?q=%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[70],{"type":24,"value":71},"神经网络",{"type":24,"value":73},"——GhostNet。GhostNet在多种场景如ImageNet分类、细粒度图像识别和目标检测等取得了明显优于MobileNet的效果。GhostNet做持续放大，构建出B1-B4系列模型，持续优于EfficientNet。",{"type":18,"tag":26,"props":75,"children":76},{},[77,79],{"type":24,"value":78},"论文链接1：",{"type":18,"tag":37,"props":80,"children":83},{"href":81,"rel":82},"https://link.zhihu.com/?target=https%3A//arxiv.org/abs/1911.11907",[41],[84],{"type":24,"value":85},"https://arxiv.org/abs/1911.11907",{"type":18,"tag":26,"props":87,"children":88},{},[89,91],{"type":24,"value":90},"论文链接2：",{"type":18,"tag":37,"props":92,"children":95},{"href":93,"rel":94},"https://link.zhihu.com/?target=https%3A//arxiv.org/abs/2108.00177",[41],[96],{"type":24,"value":97},"https://arxiv.org/abs/2108.00177",{"type":18,"tag":26,"props":99,"children":100},{},[101,103],{"type":24,"value":102},"Gitee开源地址：",{"type":18,"tag":37,"props":104,"children":107},{"href":105,"rel":106},"https://link.zhihu.com/?target=https%3A//gitee.com/mindspore/models/tree/master/research/cv/ghostnet",[41],[108],{"type":24,"value":109},"https://gitee.com/mindspore/models/tree/master/research/cv/ghostnet",{"type":18,"tag":26,"props":111,"children":112},{},[113,115],{"type":24,"value":114},"Github开源地址：",{"type":18,"tag":37,"props":116,"children":119},{"href":117,"rel":118},"https://link.zhihu.com/?target=https%3A//github.com/mindspore-ai/models/tree/master/research/cv/ghostnet",[41],[120],{"type":24,"value":121},"https://github.com/mindspore-ai/models/tree/master/research/cv/ghostnet",{"type":18,"tag":123,"props":124,"children":126},"h2",{"id":125},"引言",[127],{"type":24,"value":125},{"type":18,"tag":26,"props":129,"children":130},{},[131,138,140,147],{"type":18,"tag":37,"props":132,"children":135},{"href":133,"rel":134},"https://www.zhihu.com/search?q=%E5%8D%B7%E7%A7%AF%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[136],{"type":24,"value":137},"卷积神经网络",{"type":24,"value":139},"推动了计算机视觉诸多任务的进步，比如图像识别、目标检测等。但是，神经网络在移动设备上的应用还亟待解决，主要原因是现有模型又大又慢。因而，一些研究提出了模型的压缩方法，比如剪枝、量化、",{"type":18,"tag":37,"props":141,"children":144},{"href":142,"rel":143},"https://www.zhihu.com/search?q=%E7%9F%A5%E8%AF%86%E8%92%B8%E9%A6%8F&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[145],{"type":24,"value":146},"知识蒸馏",{"type":24,"value":148},"等；还有一些则着重于高效的网络结构设计，比如MobileNet、ShuffleNet等。本文就设计了一种全新的神经网络基本单元Ghost模块，从而搭建出轻量级神经网络架构GhostNet。",{"type":18,"tag":26,"props":150,"children":151},{},[152,154,161],{"type":24,"value":153},"在一个训练好的深度神经网络中，通常会包含丰富甚至冗余的特征图，以保证对输入数据有全面的理解。如下图所示，在",{"type":18,"tag":37,"props":155,"children":158},{"href":156,"rel":157},"https://www.zhihu.com/search?q=ResNet-50&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[159],{"type":24,"value":160},"ResNet-50",{"type":24,"value":162},"中，将经过第一个残差块处理后的特征图拿出来，三个相似的特征图对示例用相同颜色的框注释。 该对中的一个特征图可以通过廉价操作（用扳手表示）将另一特征图变换而获得，可以认为其中一个特征图是另一个的“幻影”。因为，本文提出并非所有特征图都要用卷积操作来得到，“幻影”特征图可以用更廉价的操作来生成。",{"type":18,"tag":26,"props":164,"children":165},{},[166],{"type":18,"tag":167,"props":168,"children":170},"img",{"alt":7,"src":169},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/7d00df42517a4d4aa3a5e360755f0263.jpg",[],{"type":18,"tag":26,"props":172,"children":173},{},[174],{"type":24,"value":175},"ResNet50特征图可视化",{"type":18,"tag":26,"props":177,"children":178},{},[179,181,188],{"type":24,"value":180},"在本文中，作者提出了一种新颖的Ghost模块，可以使用更少的参数来生成更多特征图。具体来说，深度神经网络中的普通卷积层将分为两部分。第一部分涉及普通卷积，但是将严格控制它们的总数。给定第一部分的固有特征图，然后将一系列简单的线性运算应用于生成更多特征图。与普通卷积神经网络相比，在不更改输出特征图大小的情况下，该Ghost模块中所需的参数总数和计算复杂度均已降低。基于Ghost模块，作者建立了一种有效的神经体系结构，即GhostNet。作者首先在",{"type":18,"tag":37,"props":182,"children":185},{"href":183,"rel":184},"https://www.zhihu.com/search?q=%E5%9F%BA%E5%87%86%E7%A5%9E%E7%BB%8F%E4%BD%93%E7%B3%BB%E7%BB%93%E6%9E%84&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[186],{"type":24,"value":187},"基准神经体系结构",{"type":24,"value":189},"中替换原始的卷积层，以证明Ghost模块的有效性，然后在几个基准视觉数据集上验证GhostNet的优越性。实验结果表明，所提出的Ghost模块能够在保持相似识别性能的同时降低通用卷积层的计算成本，并且GhostNet可以超越MobileNetV3等先进的高效深度模型，在移动设备上进行快速推断。",{"type":18,"tag":123,"props":191,"children":193},{"id":192},"ghostnet基础模型",[194],{"type":24,"value":195},"GhostNet基础模型",{"type":18,"tag":197,"props":198,"children":200},"h3",{"id":199},"ghost模块",[201],{"type":18,"tag":202,"props":203,"children":204},"strong",{},[205],{"type":24,"value":206},"Ghost模块",{"type":18,"tag":26,"props":208,"children":209},{},[210],{"type":24,"value":211},"深度卷积神经网络通常引用由大量卷积组成的卷积神经网络，导致大量的计算成本。尽管最近的工作，例如MobileNet和ShuffleNet引入了深度卷积或混洗操作，以使用较小的卷积核（浮点运算）来构建有效的CNN，其余1x1卷积层仍将占用大量内存和FLOPs。",{"type":18,"tag":26,"props":213,"children":214},{},[215,217,221,223,227,229,233,235,239,241,245],{"type":24,"value":216},"鉴于主流CNN计算出的中间特征图中存在大量的冗余（如图1所示），作者提出减少所需的资源，即用于生成它们的卷积核。实际上，给定输入数据",{"type":18,"tag":167,"props":218,"children":220},{"alt":7,"src":219},"https://pic1.zhimg.com/80/v2-5572c917a0a6d871046b3c2bff328ea4_720w.jpg",[],{"type":24,"value":222},"，其中c是输入通道数，h和w是高度，输入数据的宽度，分别用于生成n个特征图的任意卷积层的运算可表示为",{"type":18,"tag":167,"props":224,"children":226},{"alt":7,"src":225},"https://pic3.zhimg.com/80/v2-29b0e4aa18530fec3c28e68da2c258de_720w.jpg",[],{"type":24,"value":228},"其中*是卷积运算，b是偏差项，",{"type":18,"tag":167,"props":230,"children":232},{"alt":7,"src":231},"https://pic2.zhimg.com/80/v2-3047502d597a49f2031bf25485197ad5_720w.jpg",[],{"type":24,"value":234},"是具有n个通道的输出特征图，",{"type":18,"tag":167,"props":236,"children":238},{"alt":7,"src":237},"https://pic2.zhimg.com/80/v2-d5f0f635135698fe3a87857de59144a1_720w.jpg",[],{"type":24,"value":240},"是这一层中的卷积核。另外，h’和w’分别是输出数据的高度和宽度，kxk分别是卷积核f的内核大小。在此卷积过程中，由于卷积核数量n和通道数c通常非常大（例如256或512），所需的FLOPs数量达",{"type":18,"tag":167,"props":242,"children":244},{"alt":7,"src":243},"https://pic4.zhimg.com/80/v2-c9b64204c05fdbbceda10b80628f238b_720w.jpg",[],{"type":24,"value":246},"之多。",{"type":18,"tag":26,"props":248,"children":249},{},[250],{"type":18,"tag":167,"props":251,"children":253},{"alt":7,"src":252},"https://pic2.zhimg.com/80/v2-5cd97563e7c7564a93644611162ebb31_720w.jpg",[],{"type":18,"tag":26,"props":255,"children":256},{},[257],{"type":24,"value":258},"(a) 普通卷积层 (b) Ghost模块",{"type":18,"tag":26,"props":260,"children":261},{},[262,264],{"type":24,"value":263},"根据上述公式，要优化的参数数量（f和b中的参数）由输入和输出特征图的尺寸确定。如图1中所观察到的，卷积层的输出特征图通常包含很多冗余，并且其中一些可能彼此相似。作者指出，没有必要使用大量的FLOPs和参数一一生成这些冗余特征图，而是说，输出特征图是少数原始特征图通过一些廉价转换的“幻影”。这些原始特征图通常具有较小的大小，并由普通的卷积核生成。具体来说，m个原始特征图Y’是使用一次卷积生成的：",{"type":18,"tag":167,"props":265,"children":267},{"alt":7,"src":266},"https://pic4.zhimg.com/80/v2-a083a7a5eb37bfb2bdeca5eca5aa7d2b_720w.jpg",[],{"type":18,"tag":26,"props":269,"children":270},{},[271],{"type":24,"value":272},"其中f'是使用的卷积核，m\u003C=n，为简单起见，这里省略了偏差项。超参数（例如卷积核大小，stride，padding）与普通卷积中的超参数相同，以保持输出特征图的空间大小（即h’和w' ）保持一致。为了进一步获得所需的n个特征图，作者提出对Y'中的每个原始特征应用一系列廉价的线性运算，以生成s个幻影特征图：",{"type":18,"tag":26,"props":274,"children":275},{},[276],{"type":18,"tag":167,"props":277,"children":279},{"alt":7,"src":278},"https://pic2.zhimg.com/80/v2-f0e2f0b1157866e144e8afbcfd370909_720w.jpg",[],{"type":18,"tag":26,"props":281,"children":282},{},[283,285,289,291,295,297,301,303,307,309,313],{"type":24,"value":284},"其中y'_i是Y'中第i 个原始特征图，上述函数中的",{"type":18,"tag":167,"props":286,"children":288},{"alt":7,"src":287},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/3ba7de4604d44fb8bd704877448242b0.png",[],{"type":24,"value":290},"是第j个线性运算，用于生成第 j 个幻影特征图y_ {ij} ，也就是说，y'_i 可以具有一个或多个幻影特征图",{"type":18,"tag":167,"props":292,"children":294},{"alt":7,"src":293},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/e7065047e8c64d209f2b2cb053ab4a06.png",[],{"type":24,"value":296},"。最后的",{"type":18,"tag":167,"props":298,"children":300},{"alt":7,"src":299},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/32a7f314907f4085a48c67bfb2c81951.png",[],{"type":24,"value":302},"是用于保留原始特征图的恒等映射，如图2(b)所示。通过使用廉价操作，我们可以获得n=m*s个特征图",{"type":18,"tag":167,"props":304,"children":306},{"alt":7,"src":305},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/9c1b716c2fc841ffb140ff38cf2bed63.png",[],{"type":24,"value":308},"作为Ghost模块的输出数据。注意，线性运算",{"type":18,"tag":167,"props":310,"children":312},{"alt":7,"src":311},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/2bd8b6da39a1450698c39d72c88b7dbc.png",[],{"type":24,"value":314},"在每个通道上运行，其计算量比普通卷积少得多。实际上，Ghost模块中可能有几种不同的线性运算，例如3x3和5x5线性内核，将在实验部分进行分析。",{"type":18,"tag":197,"props":316,"children":318},{"id":317},"构建ghostnet",[319],{"type":18,"tag":202,"props":320,"children":321},{},[322],{"type":24,"value":323},"构建GhostNet",{"type":18,"tag":26,"props":325,"children":326},{},[327,329,336],{"type":24,"value":328},"**Ghost Bottleneck：**利用Ghost模块的优势，作者介绍了专门为小型CNN设计的Ghost bottleneck（G-bneck）。如图3所示，Ghost bottleneck似乎类似于ResNet中的基本残差块（Basic Residual Block），其中集成了多个卷积层和shortcut。Ghost bottleneck主要由两个堆叠的Ghost模块组成。第一个Ghost模块用作扩展层，增加了通道数。这里将输出通道数与输入通道数之比称为expansion ratio。第二个Ghost模块减少通道数，以与",{"type":18,"tag":37,"props":330,"children":333},{"href":331,"rel":332},"https://www.zhihu.com/search?q=shortcut%E8%B7%AF%E5%BE%84&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[334],{"type":24,"value":335},"shortcut路径",{"type":24,"value":337},"匹配。然后，使用shortcut连接这两个Ghost模块的输入和输出。这里借鉴了MobileNetV2，第二个Ghost模块之后不使用ReLU，其他层在每层之后都应用了批量归一化（BN）和ReLU非线性激活。上述Ghost bottleneck适用于stride= 1，对于stride = 2的情况，shortcut路径由下采样层和stride = 2的深度卷积（Depthwise Convolution）来实现。出于效率考虑，Ghost模块中的初始卷积是点卷积（Pointwise Convolution）。",{"type":18,"tag":26,"props":339,"children":340},{},[341],{"type":18,"tag":167,"props":342,"children":344},{"alt":7,"src":343},"https://pic2.zhimg.com/80/v2-101a9faf78fa173f6e0217e433ec44a9_720w.jpg",[],{"type":18,"tag":26,"props":346,"children":347},{},[348],{"type":24,"value":349},"Ghost bottleneck",{"type":18,"tag":26,"props":351,"children":352},{},[353,358,360,367],{"type":18,"tag":202,"props":354,"children":355},{},[356],{"type":24,"value":357},"GhostNet",{"type":24,"value":359},"：基于Ghost bottleneck，作者提出GhostNet，如表1所属。作者遵循MobileNetV3的基本体系结构的优势，然后使用Ghost bottleneck替换MobileNetV3中的bottleneck。GhostNet主要由一堆Ghost bottleneck组成，其中Ghost bottleneck以Ghost模块为构建基础。第一层是具有16个卷积核的标准卷积层，然后是一系列Ghost bottleneck，通道逐渐增加。这些Ghost bottleneck根据其输入特征图的大小分为不同的阶段。除了每个阶段的最后一个Ghost bottleneck是stride = 2，其他所有Ghost bottleneck都以stride = 1进行应用。最后，利用全局平均池和卷积层将特征图转换为1280维",{"type":18,"tag":37,"props":361,"children":364},{"href":362,"rel":363},"https://www.zhihu.com/search?q=%E7%89%B9%E5%BE%81%E5%90%91%E9%87%8F&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[365],{"type":24,"value":366},"特征向量",{"type":24,"value":368},"以进行最终分类。SE模块也用在了某些Ghost bottleneck中的残留层，如表1中所示。与MobileNetV3相比，这里用ReLU换掉了Hard-swish激活函数。尽管进一步的超参数调整或基于自动架构搜索的Ghost模块将进一步提高性能，但表1所提供的架构提供了一个基本设计参考。",{"type":18,"tag":26,"props":370,"children":371},{},[372],{"type":18,"tag":167,"props":373,"children":375},{"alt":7,"src":374},"https://pic1.zhimg.com/80/v2-d0be0131ab4107c8cf5a6876f62b1770_720w.jpg",[],{"type":18,"tag":26,"props":377,"children":378},{},[379],{"type":24,"value":380},"GhostNet网络架构",{"type":18,"tag":197,"props":382,"children":384},{"id":383},"ghostnet性能",[385],{"type":18,"tag":202,"props":386,"children":387},{},[388],{"type":24,"value":389},"GhostNet性能",{"type":18,"tag":26,"props":391,"children":392},{},[393,395,402],{"type":24,"value":394},"**ImageNet分类数据集：**为了验证所提出的GhostNet的优越性，作者对ImageNet分类任务进行了实验。在ImageNet验证集上报告的所有结果均是",{"type":18,"tag":37,"props":396,"children":399},{"href":397,"rel":398},"https://www.zhihu.com/search?q=single+crop&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[400],{"type":24,"value":401},"single crop",{"type":24,"value":403},"的top-1的性能。对于GhostNet，为简单起见，作者在初始卷积中设置了内核大小k = 1，在所有Ghost模块中设置了s = 2和 d = 3。作者和现有最优秀的几种小型网络结构作对比，包括MobileNet系列、ShuffleNet系列、IGCV3、ProxylessNAS、FBNet、MnasNet等。结果汇总在表5中，这些模型分为3个级别的计算复杂性，即~50，~150和200-300 MFLOPs。从结果中我们可以看到，通常较大的FLOPs会在这些小型网络中带来更高的准确性，这表明了它们的有效性。而GhostNet在各种计算复杂度级别上始终优于其他竞争对手，主要是因为GhostNet在利用计算资源生成特征图方面效率更高。",{"type":18,"tag":26,"props":405,"children":406},{},[407],{"type":18,"tag":167,"props":408,"children":410},{"alt":7,"src":409},"https://pic1.zhimg.com/80/v2-accee7a79c069b2cfbaec5704a6caba0_720w.jpg",[],{"type":18,"tag":26,"props":412,"children":413},{},[414],{"type":24,"value":415},"GhostNet在ImageNet数据集的表现",{"type":18,"tag":197,"props":417,"children":419},{"id":418},"硬件推理速度胜过其他最新模型如谷歌mobilenet系列proxylessnasfbnet和mnasnet",[420],{"type":24,"value":421},"**硬件推理速度：**胜过其他最新模型，如谷歌MobileNet系列，ProxylessNAS，FBNet和MnasNet。",{"type":18,"tag":26,"props":423,"children":424},{},[425,427,434],{"type":24,"value":426},"由于提出的GhostNet是为移动设备设计的，因此作者使用TFLite工具（下次用MindSpore Lite）在基于ARM的手机",{"type":18,"tag":37,"props":428,"children":431},{"href":429,"rel":430},"https://www.zhihu.com/search?q=%E5%8D%8E%E4%B8%BAP30Pr&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[432],{"type":24,"value":433},"华为P30Pr",{"type":24,"value":435},"o上进一步测量GhostNet和其他模型的实际推理速度。遵循MobileNet中的常用设置，作者使用Batch size为1的单线程模式。从图6的结果中，我们可以看到与具有相同延迟的MobileNetV3相比，GhostNet大约提高了0.5%的top-1的准确性，另一方面GhostNet需要更少的运行时间来达到相同的精度。例如，精度为75.0％的GhostNet仅具有40毫秒的延迟，而精度类似的MobileNetV3大约需要46毫秒来处理一张图像。总体而言，作者的模型总体上胜过其他最新模型，例如谷歌MobileNet系列，ProxylessNAS，FBNet和MnasNet。",{"type":18,"tag":26,"props":437,"children":438},{},[439],{"type":18,"tag":167,"props":440,"children":442},{"alt":7,"src":441},"https://pic1.zhimg.com/80/v2-aa8b706e52ca1193446c587198109ce4_720w.jpg",[],{"type":18,"tag":26,"props":444,"children":445},{},[446],{"type":24,"value":447},"GhostNet和其他模型的FLOPs、推理速度对比",{"type":18,"tag":123,"props":449,"children":451},{"id":450},"ghostnet模型放大",[452],{"type":24,"value":453},"GhostNet模型放大",{"type":18,"tag":26,"props":455,"children":456},{},[457,459,466],{"type":24,"value":458},"为了进一步提升",{"type":18,"tag":37,"props":460,"children":463},{"href":461,"rel":462},"https://www.zhihu.com/search?q=%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[464],{"type":24,"value":465},"深度学习",{"type":24,"value":467},"模型在目标数据集上的准确率，常用的方法是模型缩放，EfficientNet，FBNetV2和RegNet通过调整网络的深度，宽度和输入分辨率，在Imagenet数据集上取得了更高的准确率。但是这些方法都是基于人工的经验或者统计分析而获得的，而经验和统计数据都是基于大量的小网络结构获得的，因此这种方法对于模型放大并不适用。",{"type":18,"tag":26,"props":469,"children":470},{},[471],{"type":24,"value":472},"我们提出了一种基于网络结构搜索实现模型放大的方法，目标是把新增加的计算量（FLOPs）放到网络中最合适的位置，从而达到计算量的最优分配和最优利用。使用公式表达如下：",{"type":18,"tag":26,"props":474,"children":475},{},[476],{"type":18,"tag":167,"props":477,"children":479},{"alt":7,"src":478},"https://pic3.zhimg.com/80/v2-4fc35101d858a75f2757fcdd283c45be_720w.jpg",[],{"type":18,"tag":26,"props":481,"children":482},{},[483],{"type":24,"value":484},"上式中，N表示网络，θ表示网络中的待训练参数，r,d,w分别表示网络的输入分辨率，深度和宽度，δ是预设的误差阈值，T表示目标计算量。",{"type":18,"tag":26,"props":486,"children":487},{},[488],{"type":24,"value":489},"通过对每个stage进行深度和宽度的搜索，可以达到更细粒度的计算量分配和利用的目标，整体方法架构如图所示：",{"type":18,"tag":26,"props":491,"children":492},{},[493],{"type":18,"tag":167,"props":494,"children":496},{"alt":7,"src":495},"https://pic4.zhimg.com/80/v2-477cadb482626a6ed1f567aee0c33313_720w.jpg",[],{"type":18,"tag":26,"props":498,"children":499},{},[500,502,509],{"type":24,"value":501},"具体地，我们将整个搜索过程分为多个阶段，从一个给定的基础网络模型开始，在每一阶段不断增加计算量，然后搜索当前计算量下的最优网络结构，并把当前的最优网络结构加入到一个",{"type":18,"tag":37,"props":503,"children":506},{"href":504,"rel":505},"https://www.zhihu.com/search?q=%E6%9C%80%E4%BC%98%E7%BD%91%E7%BB%9C%E7%BB%93%E6%9E%84&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A441356415%7D",[41],[507],{"type":24,"value":508},"最优网络结构",{"type":24,"value":510},"集合中；在下一个搜索阶段，从当前的最优网络结构集合出发，搜索基于前面的最优网络结构在当前计算量下的网络结构，并进行快速评估，保留当前的最优网络结构并加入到最优网络结构集合中。这是一种动态规划的思想，最后我们会获得一个最优网络结构的集合，包括的不同计算量下的最优网络结构。",{"type":18,"tag":26,"props":512,"children":513},{},[514],{"type":24,"value":515},"在Imagenet上，我们利用的提出的方法将GhostNet基础网络进行放大，构建出GhostNet-B1和B4。如下表，我们的GhostNet大模型取得了比EfficientNet系列更好的结果。",{"type":18,"tag":26,"props":517,"children":518},{},[519],{"type":18,"tag":167,"props":520,"children":522},{"alt":7,"src":521},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/07/2e6eefbddc2f4a52840407a562f30a13.png",[],{"type":18,"tag":123,"props":524,"children":526},{"id":525},"ghostnet多场景应用作为骨干网络可以用于各类下游任务比如细粒度图像识别和目标检测",[527],{"type":24,"value":528},"GhostNet多场景应用：作为骨干网络，可以用于各类下游任务，比如细粒度图像识别和目标检测。",{"type":18,"tag":197,"props":530,"children":532},{"id":531},"细粒度图像识别",[533],{"type":18,"tag":202,"props":534,"children":535},{},[536],{"type":24,"value":537},"细粒度图像识别：",{"type":18,"tag":26,"props":539,"children":540},{},[541],{"type":24,"value":542},"细粒度图像识别任务是对属于同一大类的图像进一步做细分类，比如Oxford Pets数据集就是用于做猫狗细分类任务。下表展示了GhostNet用于猫狗品种分类的结果，在计算量更小、速度更快的情况下，GhostNet取得了比MobileNetV2更好的识别效果。",{"type":18,"tag":26,"props":544,"children":545},{},[546],{"type":24,"value":547},"GhostNet结合做猫狗品种识别的模型也已经发布在MindSpore Hub，欢迎开发者和高校师生试用。",{"type":18,"tag":549,"props":550,"children":551},"ul",{},[552],{"type":18,"tag":553,"props":554,"children":555},"li",{},[556,558],{"type":24,"value":557},"预训练模型：",{"type":18,"tag":37,"props":559,"children":562},{"href":560,"rel":561},"https://link.zhihu.com/?target=https%3A//mindspore.cn/resources/hub/details%3Fnoah-cvlab/gpu/1.0/ghostnet_v1.0_oxford_pets",[41],[563],{"type":24,"value":564},"https://mindspore.cn/resources/hub/details?noah-cvlab/gpu/1.0/ghostnet_v1.0_oxford_pets",{"type":18,"tag":26,"props":566,"children":567},{},[568],{"type":18,"tag":167,"props":569,"children":571},{"alt":7,"src":570},"https://pic3.zhimg.com/80/v2-8892b6ccff8037643a0a7c0efcbc22fe_720w.jpg",[],{"type":18,"tag":26,"props":573,"children":574},{},[575],{"type":24,"value":576},"GhostNet在Oxford Pets猫狗品种分类的表现",{"type":18,"tag":197,"props":578,"children":580},{"id":579},"目标检测",[581,585],{"type":18,"tag":202,"props":582,"children":583},{},[584],{"type":24,"value":579},{"type":24,"value":586},"：",{"type":18,"tag":26,"props":588,"children":589},{},[590],{"type":24,"value":591},"为了进一步评估GhostNet的泛化能力，作者在MS COCO数据集上进行了目标检测实验。具有功能金字塔网络（FPN）的两阶段Faster R-CNN和单阶段的RetinaNet作为baseline，而GhostNet用于骨干网络做特征提取器。下表显示了检测结果，其中FLOPs是使用224x224输入图像计算的。通过使用显着降低的计算成本，GhostNet可以在单阶段的RetinaNet和两阶段的Faster R-CNN框架上达到和MobileNetV2和MobileNetV3类似的mAP。",{"type":18,"tag":26,"props":593,"children":594},{},[595],{"type":24,"value":596},"GhostNet结合SSD做目标检测的代码也已经发布在MindSpore，欢迎开发者和高校师生试用。",{"type":18,"tag":549,"props":598,"children":599},{},[600,612],{"type":18,"tag":553,"props":601,"children":602},{},[603,605],{"type":24,"value":604},"代码：",{"type":18,"tag":37,"props":606,"children":609},{"href":607,"rel":608},"https://link.zhihu.com/?target=https%3A//gitee.com/mindspore/models/tree/master/research/cv/ssd_ghostnet",[41],[610],{"type":24,"value":611},"https://gitee.com/mindspore/models/tree/master/research/cv/ssd_ghostnet",{"type":18,"tag":553,"props":613,"children":614},{},[615,616],{"type":24,"value":557},{"type":18,"tag":37,"props":617,"children":620},{"href":618,"rel":619},"https://link.zhihu.com/?target=https%3A//mindspore.cn/resources/hub/details%3Fnoah-cvlab/ascend/1.0/ghostnet_ssd_v1.0",[41],[621],{"type":24,"value":622},"https://mindspore.cn/resources/hub/details?noah-cvlab/ascend/1.0/ghostnet_ssd_v1.0",{"type":18,"tag":26,"props":624,"children":625},{},[626],{"type":18,"tag":167,"props":627,"children":629},{"alt":7,"src":628},"https://pic3.zhimg.com/80/v2-478297c649214450b6a078a58800fd56_720w.jpg",[],{"type":18,"tag":26,"props":631,"children":632},{},[633],{"type":24,"value":634},"GhostNet在COCO目标检测任务的表现",{"type":18,"tag":123,"props":636,"children":638},{"id":637},"基于mindspore的ghostnet总结和开源地址欢迎体验",[639],{"type":24,"value":640},"基于MindSpore的GhostNet总结和开源地址，欢迎体验",{"type":18,"tag":26,"props":642,"children":643},{},[644],{"type":18,"tag":202,"props":645,"children":646},{},[647],{"type":24,"value":648},"GhostNet系列模型已经在MindSpore开源，路径汇总如下，欢迎开发者、研究人员、高校师生试用。",{"type":18,"tag":26,"props":650,"children":651},{},[652,657],{"type":18,"tag":202,"props":653,"children":654},{},[655],{"type":24,"value":656},"GhostNet训练：",{"type":18,"tag":37,"props":658,"children":660},{"href":105,"rel":659},[41],[661],{"type":24,"value":109},{"type":18,"tag":26,"props":663,"children":664},{},[665,670],{"type":18,"tag":202,"props":666,"children":667},{},[668],{"type":24,"value":669},"GhostNet图像分类：",{"type":18,"tag":37,"props":671,"children":673},{"href":560,"rel":672},[41],[674],{"type":24,"value":564},{"type":18,"tag":26,"props":676,"children":677},{},[678,683],{"type":18,"tag":202,"props":679,"children":680},{},[681],{"type":24,"value":682},"GhostNet目标检测：",{"type":18,"tag":37,"props":684,"children":686},{"href":607,"rel":685},[41],[687],{"type":24,"value":611},{"type":18,"tag":26,"props":689,"children":690},{},[691,696],{"type":18,"tag":202,"props":692,"children":693},{},[694],{"type":24,"value":695},"GhostNet量化：",{"type":18,"tag":37,"props":697,"children":700},{"href":698,"rel":699},"https://link.zhihu.com/?target=https%3A//gitee.com/mindspore/models/tree/master/research/cv/ghostnet_quant",[41],[701],{"type":24,"value":702},"https://gitee.com/mindspore/models/tree/master/research/cv/ghostnet_quant",{"type":18,"tag":197,"props":704,"children":706},{"id":705},"一个好消息",[707],{"type":24,"value":708},"一个好消息：",{"type":18,"tag":26,"props":710,"children":711},{},[712],{"type":24,"value":713},"最后告诉各位开发者一个好消息：根据Paperswithcode网站统计，基于MindSpore的AI论文2021年10月份在所有AI框架中占比11%，按月统计进入全球第二，感谢CAAI和各位高校老师支持，我们一起继续努力做好AI科研创新",{"type":18,"tag":26,"props":715,"children":716},{},[717],{"type":18,"tag":167,"props":718,"children":720},{"alt":7,"src":719},"https://pic4.zhimg.com/80/v2-ea0c1f4966da9b76cee9091010160a97_720w.jpg",[],{"type":18,"tag":26,"props":722,"children":723},{},[724],{"type":24,"value":725},"本文作者在MindSpore社区从事相关AI工作，欢迎您扫码加入QQ群，与数千MindSpore开发者一起交流，用MindSpore赋能千行百业，点亮您的智慧生活。",{"type":18,"tag":26,"props":727,"children":728},{},[729],{"type":24,"value":730},"官方QQ群: 486831414",{"type":18,"tag":26,"props":732,"children":733},{},[734,736],{"type":24,"value":735},"MindSpore官网：",{"type":18,"tag":37,"props":737,"children":740},{"href":738,"rel":739},"https://link.zhihu.com/?target=https%3A//www.mindspore.cn/",[41],[741],{"type":24,"value":742},"https://www.mindspore.cn/",{"type":18,"tag":26,"props":744,"children":745},{},[746,748],{"type":24,"value":747},"MindSpore论坛：",{"type":18,"tag":37,"props":749,"children":752},{"href":750,"rel":751},"https://link.zhihu.com/?target=https%3A//bbs.huaweicloud.com/forum/forum-1076-1.html",[41],[753],{"type":24,"value":754},"https://bbs.huaweicloud.com/forum/forum-1076-1.html",{"type":18,"tag":26,"props":756,"children":757},{},[758],{"type":24,"value":759},"代码仓地址：",{"type":18,"tag":26,"props":761,"children":762},{},[763,765],{"type":24,"value":764},"Gitee-",{"type":18,"tag":37,"props":766,"children":769},{"href":767,"rel":768},"https://link.zhihu.com/?target=https%3A//gitee.com/mindspore/mindspore.git",[41],[770],{"type":24,"value":771},"https://gitee.com/mindspore/mindspore.git",{"type":18,"tag":26,"props":773,"children":774},{},[775,777],{"type":24,"value":776},"GitHub-",{"type":18,"tag":37,"props":778,"children":781},{"href":779,"rel":780},"https://link.zhihu.com/?target=https%3A//github.com/mindspore-ai/mindspore.git",[41],[782],{"type":24,"value":783},"https://github.com/mindspore-ai",{"title":7,"searchDepth":785,"depth":785,"links":786},4,[787,789,796,797,802],{"id":125,"depth":788,"text":125},2,{"id":192,"depth":788,"text":195,"children":790},[791,793,794,795],{"id":199,"depth":792,"text":206},3,{"id":317,"depth":792,"text":323},{"id":383,"depth":792,"text":389},{"id":418,"depth":792,"text":421},{"id":450,"depth":788,"text":453},{"id":525,"depth":788,"text":528,"children":798},[799,800],{"id":531,"depth":792,"text":537},{"id":579,"depth":792,"text":801},"目标检测：",{"id":637,"depth":788,"text":640,"children":803},[804],{"id":705,"depth":792,"text":708},"markdown","content:technology-blogs:zh:823.md","content","technology-blogs/zh/823.md","technology-blogs/zh/823","md",1776506141662]