Deep Learning and Simulink

2 ビュー (過去 30 日間)
Pierclaudio Savino
Pierclaudio Savino 2020 年 3 月 20 日
編集済み: Arkadiy Turevskiy 2021 年 10 月 28 日
How can I create a block in Simulink that keeps a CNN already trained to classify? I wish it had photos of an Android camera as input.
  2 件のコメント
Sutanu Maiti
Sutanu Maiti 2020 年 5 月 22 日
You can achieve this by using Simulink support package for Android Devices.
There is also an example Recognize Handwritten Digits Using MNIST Data Set on Android Device that generates code and deploys on Android device.
Pierclaudio Savino
Pierclaudio Savino 2020 年 5 月 22 日
My problem is how to import a pretrained CNN in Simulink.

サインインしてコメントする。

採用された回答

Arkadiy Turevskiy
Arkadiy Turevskiy 2021 年 10 月 18 日
編集済み: Arkadiy Turevskiy 2021 年 10 月 28 日
Starting with R2020b you can use Image Classifier block that ships with Deep Learning Toolbox.
For more information on how to use deep learning in Simulink, please see Deep Learning with Simulink doc page.
HTH.
Arkadiy

その他の回答 (1 件)

Dinesh Yadav
Dinesh Yadav 2020 年 3 月 24 日
This can be done by adding a MATLAB function block to simulink model and inside that function block writing the implemenatation of your Deep Learning CNN architecture and then train the model for classification. As of now there are no pretrained models for Deep Learning in Simulink.
  1 件のコメント
Pierclaudio Savino
Pierclaudio Savino 2020 年 5 月 23 日
I used the MATLAB function with the following code:
function out=mynetwork_predict(in)
out=zeros(1,3);
persistent mynet
if isempty(mynet)
mynet=coder.loadDeepLearningNetwork('crackNetwork.mat','crackNetwrok');
end
im=imresize(in,[227 227]);
out=mynet.predict(im);
When I try to simulate the model there are these errors:
Undefined function or variable 'dltargets.cudnn'.
P-code function 'DeepLearningNetwork.p' produced an error.
Component:MATLAB Function | Category:Coder error
Function call failed.
Function 'loadDeepLearningNetwork.m' (#42.3569.3643), line 100, column 15:
"coder.DeepLearningNetwork(coder.const(matfile), coder.const(''), param{:})"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Function call failed.
Function 'MATLAB Function' (#45.94.158), line 5, column 11:
"coder.loadDeepLearningNetwork('crackNetwork.mat','crackNetwrok')"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Persistent variable 'mynet' must be assigned before it is used. The only exception is a check using 'isempty(mynet)' that can be performed prior to assignment.
Function 'MATLAB Function' (#45.195.200), line 8, column 5:
"mynet"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'untitled/MATLAB Function'
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'untitled/MATLAB Function'

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by