WebNN Use Case Investigation:
Semantic Segmentation
Ningxin Hu, Intel
1/9/2019
Semantic Segmentation
Segmentation
Background replacement
Requirements of DeepLabV3+ MobileNet V2 Model
Required Ops | NNAPI | MPS | ONNX | clDNN |
Element-wise Add | ANEURALNETWORKS_ADD | MPSNNAdditionNode | Add | eltwise (mode as eltwise_mode::sum) |
Average Pooling | ANEURALNETWORKS_AVERAGE_POOL_2D | MPSCNNPoolingAverageNode | AveragePool | pooling (mode as pooling_mode::average) |
Concatenation | ANEURALNETWORKS_CONCATENATION | MPSNNConcatenationNode | Concat | concatenation |
Convolution | ANEURALNETWORKS_CONV_2D | MPSCNNConvolutionNode | Conv | convolution |
Depthwise Convolution | ANEURALNETWORKS_DEPTHWISE_CONV_2D | MPSCNNConvolutionNode (MPSCNNDepthWiseConvolutionDescriptor) | Conv with attributes["group"] equals to in_channels | convolution (weights split as depth_out) |
Atrous Convolution | MPSCNNConvolutionNode (MPSCNNConvolutionDescriptor.dilationRate[XY]) | Conv with attributes[“dilations”] | convolution (dilation) | |
Resize bilinear | ANEURALNETWORKS_RESIZE_BILINEAR (without support of “align_corners”) | MPSCNNUpsamplingBilinearNode | Upsample with attributes[“mode”] as bilinear (without support of “align_corners”) | By custom kernel (interp.cl) |
Checkout details: WebNN POC supported models, supported ops and native mappings
Performance