Commit d801c1de authored by sunxx1's avatar sunxx1
Browse files

更新readme

parent e33bd906
[submodule "mmclassification-mmcv"]
path = mmclassification-mmcv
url = http://developer.hpccube.com/codes/aicomponent/mmclassification-mmcv
# Mobilenetv2 # Mobilenetv2
## 论文
MobileNetV2: Inverted Residuals and Linear Bottlenecks
- https://openaccess.thecvf.com/content_cvpr_2018/papers/Sandler_MobileNetV2_Inverted_Residuals_CVPR_2018_paper.pdf
## 模型介绍 ## 模型介绍
MobileNetV2是一种轻量级的卷积神经网络模型,由Google在2018年提出。它是MobileNet系列中的第二个版本,主要用于移动设备和嵌入式设备等资源受限的环境中进行图像分类、目标检测等计算机视觉任务。 MobileNetV2是一种轻量级的卷积神经网络模型,由Google在2018年提出。它是MobileNet系列中的第二个版本,主要用于移动设备和嵌入式设备等资源受限的环境中进行图像分类、目标检测等计算机视觉任务。
## 模型结构 ![d15a0e56517b4f7284a862f1d6eaef9a](./images/d15a0e56517b4f7284a862f1d6eaef9a.png)
MobileNetV2的网络结构主要由两部分组成:特征提取层和分类器。
特征提取层采用了一连串的瓶颈块来减小模型大小和计算量。每个瓶颈块包括逐点卷积、逐通道扩展和逐点卷积三个操作。其中逐点卷积用于降低特征图的通道数量,逐通道扩展则是为了增加特征图的深度,逐点卷积再次将通道数量转换为更小的值。MobileNetV2引入了倒残差结构,即先使用逐点卷积缩小通道数量,然后使用瓶颈块处理特征图,最后再使用逐点卷积扩展通道数量。最后一个重要的设计是Squeeze-and-Excitation (SE)模块,它可以用于进一步优化特征提取。SE模块通过使用全局平均池化来获取特征图中每个通道的全局信息,并使用两个全连接层来动态地调整每个通道的权重,以增强重要的特征并抑制无关的特征。
分类器采用全局平均池化和全连接层来进行图像分类。全局平均池化将特征图的每个通道降为一个值,然后将这些值传递给全连接层进行分类。这种方法不仅可以减少参数数量,还可以防止过拟合。 ## 模型结构
## 数据集 MobileNetV2的网络结构主要由两部分组成:特征提取层和分类器。
在本测试中可以使用ImageNet数据集。 ![20231124104337](./images/20231124104337.png)
## Mobilenetv2训练 ## 环境配置
### 环境配置 ### Docker
下载工程代码: ```python
git clone --recursive http://developer.hpccube.com/codes/modelzoo/mobilenetv2_mmcv.git
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.10.0-centos7.6-dtk-22.10.1-py37-latest
# <your IMAGE ID>用以上拉取的docker的镜像ID替换
docker run --shm-size 10g --network=host --name=nit-pytorch --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/Mobilenetv2_mmcv:/home/Mobilenetv2_mmcv -it <your IMAGE ID> bash
http://developer.hpccube.com/codes/aicomponent/mmclassification-mmcv.git cd Mobilenetv2_mmcv/mmclassification-mmcv
pip install -r requirements.txt
```
提供[光源](https://www.sourcefind.cn/#/service-details)拉取的训练的docker镜像: ## 数据集
* 训练镜像:docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.10.0-centos7.6-dtk-22.10.1-py37-latest 在本测试中可以使用ImageNet数据集。
* pip install -r requirements.txt
* cd mmclassification ```
* pip install -e . ├── meta
├── train
├── val
```
### 训练 ### 训练
将训练数据解压到data目录下。 将训练数据解压到data目录下。
训练命令: ### 单机8卡
./mobilenetv2.sh ./mobilenetv2.sh
## 准确率数据 ## 精度
测试数据使用的是ImageNet数据集,使用的加速卡是DCU Z100L。 测试数据使用的是ImageNet数据集,使用的加速卡是DCU Z100L。
...@@ -47,9 +60,23 @@ http://developer.hpccube.com/codes/aicomponent/mmclassification-mmcv.git ...@@ -47,9 +60,23 @@ http://developer.hpccube.com/codes/aicomponent/mmclassification-mmcv.git
| :--: | :-----------------------: | | :--: | :-----------------------: |
| 8 | top1:0.71764;top5:0.90386 | | 8 | top1:0.71764;top5:0.90386 |
## result
![img](https://developer.hpccube.com/codes/modelzoo/vit_pytorch/-/raw/master/image/README/1695381570003.png)
## 应用场景
### 算法类别
图像分类
### 热点行业
制造,能源,交通,网安
### 源码仓库及问题反馈 ### 源码仓库及问题反馈
https://developer.hpccube.com/codes/modelzoo/mobilenetv2-mmcv https://developer.hpccube.com/codes/modelzoo/mobilenetv2_mmcv
### 参考 ### 参考
......
Subproject commit 0f6a312ab4b30c6e27efd93608268fe0fe3f7dcc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment