DeepLab is a series of image semantic segmentation models, DeepLabV3 improves significantly over previous versions. Two keypoints of DeepLabV3:Its multi-grid atrous convolution makes it better to deal with segmenting objects at multiple scales, and augmented ASPP makes image-level features available to capture long range information.
DeepLab is a series of image semantic segmentation models, DeepLabV3 improves significantly over previous versions. Two keypoints of DeepLabV3: Its multi-grid atrous convolution makes it better to deal with segmenting objects at multiple scales, and augmented ASPP makes image-level features available to capture long range information.
This repository provides a script and recipe to DeepLabV3 model and achieve state-of-the-art performance.
## Table Of Contents
* [Model overview](#model-overview)
* [Model Architecture](#model-architecture)
* [Default configuration](#default-configuration)
* [Setup](#setup)
* [Requirements](#requirements)
* [Quick start guide](#quick-start-guide)
* [Performance](#performance)
* [Results](#results)
* [Training accuracy](#training-accuracy)
* [Training performance](#training-performance)
* [One-hour performance](#one-hour-performance)
## Model overview
Refer to [this paper][1] for network details.
`Chen L C, Papandreou G, Schroff F, et al. Rethinking atrous convolution for semantic image segmentation[J]. arXiv preprint arXiv:1706.05587, 2017.`
[1]: https://arxiv.org/abs/1706.05587
## Default Configuration
- network structure
Resnet101 as backbone, atrous convolution for dense feature extraction.
- preprocessing on training data:
crop size: 513 * 513
random scale: scale range 0.5 to 2.0
random flip
mean subtraction: means are [103.53, 116.28, 123.675]
- preprocessing on validation data:
The image's long side is resized to 513, then the image is padded to 513 * 513
- training parameters:
- Momentum: 0.9
- LR scheduler: cosine
- Weight decay: 0.0001
## Setup
The following section lists the requirements to start training the deeplabv3 model.
### Requirements
Before running code of this project,please ensure you have the following environments:
- [MindSpore](https://www.mindspore.cn/)
- Hardware environment with the Ascend AI processor
For more information about how to get started with MindSpore, see the following sections:
### 2. Install python packages in requirements.txt
### 3. Download and preprocess the dataset
# [Model Architecture](#contents)
Resnet101 as backbone, atrous convolution for dense feature extraction.
# [Dataset](#contents)
Pascal VOC datasets and Semantic Boundaries Dataset
- Download segmentation dataset.
- Prepare the training data list file. The list file saves the relative path to image and annotation pairs. Lines are like:
@@ -95,7 +45,7 @@ cd ModelZoo_DeepLabV3_MS_MTI/00-access
......
```
- Configure and run build_data.sh to convert dataset to mindrecords. Arguments in build_data.sh:
- Configure and run build_data.sh to convert dataset to mindrecords. Arguments in scripts/build_data.sh:
```
--data_root root path of training data
@@ -105,17 +55,136 @@ cd ModelZoo_DeepLabV3_MS_MTI/00-access
--shuffle shuffle or not
```
### 4. Generate config json file for 8-cards training
# [Features](#contents)
## Mixed Precision
The [mixed precision](https://www.mindspore.cn/tutorial/zh-CN/master/advanced_use/mixed_precision.html) training method accelerates the deep learning neural network training process by using both the single-precision and half-precision data types, and maintains the network precision achieved by the single-precision training at the same time. Mixed precision training can accelerate the computation process, reduce memory usage, and enable a larger model or batch size to be trained on specific hardware.
For FP16 operators, if the input data type is FP32, the backend of MindSpore will automatically handle it with reduced precision. Users could check the reduced-precision operators by enabling INFO log and then searching ‘reduce precision’.
# [Environment Requirements](#contents)
- Hardware(Ascend)
- Prepare hardware environment with Ascend. If you want to try Ascend , please send the [application form](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/file/other/Ascend%20Model%20Zoo%E4%BD%93%E9%AA%8C%E8%B5%84%E6%BA%90%E7%94%B3%E8%AF%B7%E8%A1%A8.docx) to ascend@huawei.com. Once approved, you can get the resources.