MathWorks - Mobile View
  • 碻形冰暨硞 MathWorks 帐憷碻形冰暨硞 MathWorks 帐憷
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
MathWorks
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
  • 碻形冰暨硞 MathWorks 帐憷碻形冰暨硞 MathWorks 帐憷
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出

视频与网上研讨会

  • MathWorks
  • 视频
  • 视频首页
  • 搜索
  • 视频首页
  • 搜索
  • 联系销售
  • 试用软件
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Deep Learning in Simulink

Emmanouil Tzorakoleftherakis, MathWorks

With MATLAB® R2020b, you can use the Deep Learning Toolbox™ block library as well as MATLAB Function block to simulate and generate code from trained deep learning models in Simulink®.

See how you can simulate deep learning networks in Simulink with control, signal processing, and sensor fusion components to assess the impact of your deep learning model on system-level performance. Learn more about using NVIDIA® GPUs to speed up the execution of your deep learning network model in Simulink.

As of R2020b release of MATLAB®, you can use the MATLAB Function block as well as the Deep Learning Toolbox™ block library to simulate and generate code from trained deep learning models in Simulink®. For example, to design a highway lane following system, you can use the deep learning blocks to create a Simulink subsystem that performs lane and vehicle detection, integrate this subsystem with a larger Simulink model that includes additional components such as the vehicle dynamics model, the lane following controller, sensor fusion and 3D visualization, and verify performance of the overall design through system-level simulation before deployment. Let’s see how we can create a subsystem that performs vehicle and lane detection in Simulink. The first thing we will need is a C++ compiler. We will also need the support packages that provide interfaces from MATLAB Coder™ and GPU coder™ to target-specific deep learning libraries. Finally, we assume that we have a pretrained lane detection network as well as a pretrained yolov2 vehicle detector stored in MATLAB files. In the Simulink model, we are reading from a traffic video file, and after the vehicle and lane detection parts we are displaying the traffic video again with lane and vehicle annotations. For lane detection, first we are resizing the video frames to match the input expected by the trained lane detection network. Next we will use the ‘Predict’ block from the deep learning block library to perform inference on the trained network. To link the block to the lane detector object we are providing the path to the appropriate MATLAB file. Another option here would be to use a MATLAB function. The predict block will output two lane boundaries represented by a parabolic equation with 3 parameters that are then transformed into lanes in image coordinates. For vehicle detection, we will use a MATLAB Function block to perform inference on the pretrained yolov2 vehicle detector. Inside the MATLAB Function block we will load the pretrained network, and call the detect method to get the bounding boxes and associated confidence scores. Next, we will specify the dimensions of the block outputs. The MATLAB Function block can also be used with other types of networks like LSTMs, and you can also use it to output activations from specific layers of the network. The last thing we need to do before we run the simulation, is to set the simulation target language to C++ in the model settings. Clicking the Run button will under the hood generate code from the Predict and MATLAB Function blocks and compile it for CPU-accelerated simulation. The output of the simulation displays the annotated traffic video as expected. Finally, you can also use GPU Coder with NVIDIA® GPUs to accelerate simulation of deep learning models in Simulink. To configure the model for GPU Acceleration, check the ‘GPU Acceleration’ box under Simulation Target in the Model Settings. Once the system design is verified in simulation, you can generate code from the Simulink model for deployment. You can use Simulink Coder™, Embedded Coder® or GPU Coder to generate C++ or CUDA code and deploy deep learning networks on Intel®, ARM®, or NVIDIA platforms.

Related Products

  • Deep Learning Toolbox
  • GPU Coder
  • Simulink

Learn More

Deep Learning in Simulink for NVIDIA GPUs: Generate CUDA Code Using GPU Coder (3:29)

Feedback

Featured Product

Deep Learning Toolbox

  • Request Trial
  • Get Pricing

Up Next:

45:19
Enabling Project-Based Learning with MATLAB, Simulink, and...

Related Videos:

42:22
Enabling Project-Based Learning with MATLAB and Simulink
4:45
Run a Simulink Model on Zynq: Exploring the Simulink Model...
12:33
Simulink for Work Groups Using Simulink Projects
31:03
Utilization of Simulink Verification and Validation and...

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 联系销售
  • 试用软件

了解产品

  • MATLAB
  • Simulink
  • 学生版软件
  • 硬件支持
  • 文件交换

试用或购买

  • 下载
  • 试用软件
  • 联系销售
  • 定价和许可
  • 如何购买

如何使用

  • 文档
  • 教程
  • 示例
  • 视频与网上研讨会
  • 培训

获取支持

  • 安装帮助
  • MATLAB 问答社区
  • 咨询
  • 许可中心
  • 联系支持

关于 MathWorks

  • 招聘
  • 新闻室
  • 社会愿景
  • 联系销售
  • 关于 MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks 公司是世界领先的为工程师和科学家提供数学计算软件的开发商。

发现…

  • Select a Web Site United States
  • 专利
  • 商标
  • 隐私权政策
  • 防盗版
  • 应用状态

京ICP备12052471号

© 1994-2021 The MathWorks, Inc.

  • Weibo
  • WeChat

    WeChat

  • Bilibili
  • Youku
  • Facebook
  • Twitter
  • LinkedIn
  • RSS

关注我们