{"id":13442904,"url":"https://github.com/pprp/GoodsRecognition.MindSpore","last_synced_at":"2025-03-20T15:31:26.231Z","repository":{"id":112698978,"uuid":"417682144","full_name":"pprp/GoodsRecognition.MindSpore","owner":"pprp","description":"基于MindSpore AI框架实现零售商品识别 top1方案","archived":false,"fork":false,"pushed_at":"2022-01-03T11:06:34.000Z","size":63529,"stargazers_count":32,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-01T03:42:20.452Z","etag":null,"topics":["classification","competition-code","mindspore","top1-solution"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pprp.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-16T01:24:36.000Z","updated_at":"2024-07-10T07:33:13.000Z","dependencies_parsed_at":"2024-01-18T14:41:31.642Z","dependency_job_id":"d9457337-1c3f-4154-acc9-9bcd574edb86","html_url":"https://github.com/pprp/GoodsRecognition.MindSpore","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/pprp%2FGoodsRecognition.MindSpore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprp%2FGoodsRecognition.MindSpore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprp%2FGoodsRecognition.MindSpore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprp%2FGoodsRecognition.MindSpore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pprp","download_url":"https://codeload.github.com/pprp/GoodsRecognition.MindSpore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221772599,"owners_count":16878137,"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":["classification","competition-code","mindspore","top1-solution"],"created_at":"2024-07-31T03:01:53.084Z","updated_at":"2024-10-28T03:31:18.140Z","avatar_url":"https://github.com/pprp.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\n\n# 基于MindSpore AI框架实现零售商品识别\n\n[TOC]\n\n## 1. 赛题任务\n\n本赛题中，参赛团队将设计算法对零售商品进行识别和分类，选手需要通过分析训练集中标注数据的特点，构建AI模型，对测试集中测试数据进行识别和分类。\n\n参赛者在规定时间内须使用MindSpore AI计算框架进行模型的设计、训练和预测，不得使用任何其他框架参赛。\n\n对于预训练模型，大赛只允许：\n- 使用MindSpore官方开源的预训练模型\n- 通过监督/自监督/无监督方法对比赛训练集（不允许用比赛测试集和外部数据集）训练得到的模型作为预训练模型，这里要求获取预训练模型的方法可复现\n\n## 2. 数据分析\n\nRP2K是品览基于零售商品识别能力发布的零售数据集。不同于一般聚焦新产品的数据集，RP2K收录了超过50万张零售商品货架图片，商品种类超过2000种，该数据集是目前零售类数据集中产品种类数量TOP1，同时所有图片均来自于真实场景下的人工采集，针对每种商品，提供了十分详细的注释。\n\n- 长尾分布特点明显\n\n![](fig/testclass_number_f0_t2388.png)\n\n- 数据长宽比分布失衡 \n\n![image-20211206155828916](fig/image-20211206155828916.png)\n\n- 错误标注问题\n\n![image-20211206155858789](fig/image-20211206155858789.png)\n\n- 其他具有挑战性的问题\n\n![image-20211206160006419](fig/image-20211206160006419.png)\n\n- 细粒度识别问题\n\n![image-20211206160101834](fig/image-20211206160101834.png)\n\n\n\n## 3.数据处理\n\n（1）Structure-Retention Resize策略，保留原有的结构化信息。性能上能够提升3个百分点。\n\n（2）测试了Cutout,AutoAug, Random Erasing等策略。\n\n（3）后处理使用了FixRes的技巧。\n\n详情参考：[【分类技巧】Fixing the train-test resolution discrepancy](https://blog.csdn.net/DD_PP_JJ/article/details/121202386)\n\n\n## 4. 环境要求\n\n- 硬件：昇腾处理器（Ascend）GTX 3090Ti\n\n- 框架\n  - [MindSpore](https://www.mindspore.cn/install)\n\n- 如需查看详情，请参见如下资源：\n\n  - [MindSpore教程](https://www.mindspore.cn/tutorial/training/en/master/index.html)\n\n  - [MindSpore Python API](https://www.mindspore.cn/doc/api_python/en/master/index.html)\n\n\n## 5. 模型架构说明\n\n**SE_ResNeXt50**是ResNeXt50的一个变体。ResNeXt50是一个简单、高度模块化的图像分类网络架构。\n\nResNeXt50的设计为统一的、多分支的架构，该架构仅需设置几个超参数。此策略提供了一个新维度，即“基数”（转换集的大小），它是深度和宽度维度之外的一个重要因素\n\nSqueeze \u0026 Excitation Module 能够让模型自适应调整各个通道的重要程度，学习通道之间的相关性，提升模型的感受野。\n\nSE_ResNeXt整体网络架构如下：\n\n![image-20211206160455392](fig/image-20211206160455392.png)\n\n**Inception_resnet_v2**:  是Inception系列经典模型，由浅至深是有Inception-ResNet-A,Inception-ResNet-B,Inception-ResNet-C组成，B中使用了7x1和1x7大卷积核可以有效提升模型感受野。\n\n模型优势：可以在更少的Epoch内部达到更高的准确率。\n\n![image-20211206160732171](fig/image-20211206160732171.png)\n\n**ResNet50_BAM**:  BottleNeck Attention Module 是通道注意力机制和空间注意力机制的综合，并行使用两种注意力及价值。其中，通道注意力机制使用的是SE，空间注意力则同各国特征图提取Spatial Attention，将两者结合起来队员图进行特征重标定。\n\n![image-20211206161009896](fig/image-20211206161009896.png)\n\n模型进一步改进：提出了SEResNet50_wider等wider系列模型，进行了模型容量扩充。\n\n![image-20211206161154249](fig/image-20211206161154249.png)\n\n## 6. 消融实验\n\n![image-20211206161457670](fig/image-20211206161457670.png)\n\n![image-20211206161528450](fig/image-20211206161528450.png)\n\n![image-20211206161547058](fig/image-20211206161547058.png)\n\n\n\n## 7. 经验总结\n\n（1）针对长宽比不均匀的数据，使用Structure-Retention Resize方法非常有效。\n\n（2）小的Batch Size训练得到的模型的泛化能力更强。\n\n（3）训练更长Epoch可以获得性能的提升，但迫于时间限制，并没有采取这个方案\n\n（4）网络设计方面应选择在深层使用更大Kernel 的卷积操作或者使用注意力模块来增大感受野，有助于模型性能提升。\n\n\n\n## 8. 类别扩展\n\n[敬请期待]\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprp%2FGoodsRecognition.MindSpore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpprp%2FGoodsRecognition.MindSpore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprp%2FGoodsRecognition.MindSpore/lists"}