Ebook

Chapter 5

Deploy the Model


Once you’ve developed and trained your deep learning model, you will want to incorporate it into a larger system so that you can start using it.

MATLAB enables you to deploy deep learning networks from a single source onto various embedded hardware platforms such as NVIDIA® GPUs, Intel® and Arm® CPUs, and FPGA or SoC devices, or to a cloud or edge device—without rewriting the original model.

Clearly, you’ll select the deployment option that best meets your requirements for power consumption and footprint, and you’ll need to make tradeoffs. For example, one important consideration is latency. If an optical system uses a high-speed camera, you will probably need low latency, especially if safety is an issue. 

Figure 1

Comparing Deployment Options

 

Device Advantages Drawbacks
FPGA Low latency, low power Difficult to program
CPU Easy and flexible to program Lowest throughput
GPU Highest throughput High power consumption

Once you’ve selected a deployment option, you can try it out in MATLAB to see how it performs. If you’re deploying to an FPGA, you can make changes to better meet requirements and rerun, all within MATLAB. In the hex nut example, since the image is simple, you could simplify the network by removing some of the convolutional layers. Alternatively, you could quantize to fixed point to improve performance and reduce latency, potentially trading off accuracy.