Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions vision/classification/resnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ResNet models perform image classification - they take images as input and classify the major object in the image into a set of pre-defined classes. They are trained on ImageNet dataset which contains images from 1000 classes. ResNet models provide very high accuracies with affordable model sizes. They are ideal for cases when high accuracy of classification is required.

## Description
Deeper neural networks are more difficult to train. Residual learning framework ease the training of networks that are substantially deeper. The research explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. It also provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset the residual nets were evaluated with a depth of up to 152 layers — 8× deeper than VGG nets but still having lower complexity.
Deeper neural networks are more difficult to train. Residual learning framework ease the training of networks that are substantially deeper. The research explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. It also provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset the residual nets were evaluated with a depth of up to 152 layers — 8× deeper than VGG nets but still having lower complexity.

## Model

Expand All @@ -13,35 +13,35 @@ ResNet v2 uses pre-activation function whereas ResNet v1 uses post-activation f

* Version 1:

|Model |Download |Checksum|Download (with sample test data)| ONNX version |Opset version|Top-1 accuracy (%)|Top-5 accuracy (%)|
|-------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|
|ResNet-18| [44.7 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v1/resnet18v1.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v1/resnet18v1-md5.txt)|[42.9 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v1/resnet18v1.tar.gz) | 1.2.1 |7| 69.93 | 89.29|
|ResNet-34| [83.3 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v1/resnet34v1.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v1/resnet34v1-md5.txt)| [78.6 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v1/resnet34v1.tar.gz) | 1.2.1 |7|73.73 | 91.40 |
|ResNet-50| [97.8 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v1/resnet50v1.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v1/resnet50v1-md5.txt)|[92.2 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v1/resnet50v1.tar.gz) |1.2.1 |7|74.93 | 92.38 |
|ResNet-101| [170.6 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v1/resnet101v1.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v1/resnet101v1-md5.txt)|[159.8 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v1/resnet101v1.tar.gz) | 1.2.1 |7 | 76.48 | 93.20 |
|ResNet-152| [230.6 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v1/resnet152v1.onnx) |[MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v1/resnet152v1-md5.txt)|[217.2 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v1/resnet152v1.tar.gz) | 1.2.1 |7 |77.11 | 93.61 |
|Model |Download |Download (with sample test data)| ONNX version |Opset version|Top-1 accuracy (%)|Top-5 accuracy (%)|
|-------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|
|ResNet-18| [44.7 MB](model/resnet18-v1.onnx) |[42.9 MB](model/resnet18-v1.tar.gz) | 1.2.1 |7| 69.93 | 89.29|
|ResNet-34| [83.3 MB](model/resnet34-v1.onnx) | [78.6 MB](model/resnet34-v1.tar.gz) | 1.2.1 |7|73.73 | 91.40 |
|ResNet-50| [97.8 MB](model/resnet50-v1.onnx) |[92.2 MB](model/resnet50-v1.tar.gz) |1.2.1 |7|74.93 | 92.38 |
|ResNet-101| [170.6 MB](model/resnet101-v1.onnx) | [159.8 MB](model/resnet101-v1.tar.gz) | 1.2.1 |7 | 76.48 | 93.20 |
|ResNet-152| [230.6 MB](model/resnet152-v1.onnx) |[217.2 MB](model/resnet152-v1.tar.gz) | 1.2.1 |7 |77.11 | 93.61 |


* Version 2:

|Model |Download |Checksum|Download (with sample test data)| ONNX version |Opset version|Top-1 accuracy (%)|Top-5 accuracy (%)|
|-------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|
|ResNet-18| [44.6 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v2/resnet18v2.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v2/resnet18v2-md5.txt)| [42.9 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v2/resnet18v2.tar.gz) | 1.2.1 |7 | 69.70 | 89.49 |
|ResNet-34| [83.2 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v2/resnet34v2.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v2/resnet34v2-md5.txt)|[78.6 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet34v2/resnet34v2.tar.gz) | 1.2.1 |7| 73.36 | 91.43 |
|ResNet-50| [97.7 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v2/resnet50v2.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v2/resnet50v2-md5.txt)|[92.0 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet50v2/resnet50v2.tar.gz) | 1.2.1 |7|75.81 | 92.82 |
|ResNet-101| [170.4 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v2/resnet101v2.onnx) |[MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v2/resnet101v2-md5.txt)|[159.4 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet101v2/resnet101v2.tar.gz) | 1.2.1 |7 | 77.42 | 93.61 |
|ResNet-152| [230.3 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v2/resnet152v2.onnx) | [MD5](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v2/resnet152v2-md5.txt)|[216.0 MB](https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet152v2/resnet152v2.tar.gz) | 1.2.1 |7 | 78.20 | 94.21 |
|Model |Download |Download (with sample test data)| ONNX version |Opset version|Top-1 accuracy (%)|Top-5 accuracy (%)|
|-------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|
|ResNet-18| [44.6 MB](model/resnet18-v2.onnx) | [42.9 MB](model/resnet18-v2.tar.gz) | 1.2.1 |7 | 69.70 | 89.49 |
|ResNet-34| [83.2 MB](model/resnet34-v2.onnx) |[78.6 MB](model/resnet34-v2.tar.gz) | 1.2.1 |7| 73.36 | 91.43 |
|ResNet-50| [97.7 MB](model/resnet50-v2.onnx) |[92.0 MB](model/resnet50-v2.tar.gz) | 1.2.1 |7|75.81 | 92.82 |
|ResNet-101| [170.4 MB](model/resnet101-v2.onnx) |[159.4 MB](model/resnet101-v2.tar.gz) | 1.2.1 |7 | 77.42 | 93.61 |
|ResNet-152| [230.3 MB](model/resnet152-v2.onnx) |[216.0 MB](model/resnet152-v2.tar.gz) | 1.2.1 |7 | 78.20 | 94.21 |


## Inference
We used MXNet as framework with gluon APIs to perform inference. View the notebook [imagenet_inference](../imagenet_inference.ipynb) to understand how to use above models for doing inference. Make sure to specify the appropriate model name in the notebook.
We used MXNet as framework with gluon APIs to perform inference. View the notebook [imagenet_inference](../imagenet_inference.ipynb) to understand how to use above models for doing inference. Make sure to specify the appropriate model name in the notebook.

### Input
All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (N x 3 x H x W), where N is the batch size, and H and W are expected to be at least 224.
### Input
All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (N x 3 x H x W), where N is the batch size, and H and W are expected to be at least 224.
The inference was done using jpeg image.

### Preprocessing
The images have to be loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225]. The transformation should preferrably happen at preprocessing.
The images have to be loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225]. The transformation should preferrably happen at preprocessing.

The following code shows how to preprocess a NCHW tensor:

Expand Down
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet101-v1.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet101-v1.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet101-v2.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet101-v2.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet152-v1.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet152-v1.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet152-v2.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet152-v2.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet18-v1.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet18-v1.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet18-v2.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet18-v2.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet34-v1.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet34-v1.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet34-v2.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet34-v2.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet50-v1.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet50-v1.tar.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet50-v2.onnx
Git LFS file not shown
3 changes: 3 additions & 0 deletions vision/classification/resnet/model/resnet50-v2.tar.gz
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Download:
Model size: 103 MB

## Description
ResNet-50 is a deep convolutional networks for classification.
ResNet-50 is a deep convolutional network for classification.

### Paper
[Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
Expand Down