S32V234 Matlab Vision Toolbox: Neural network without images as input?

cancel
Showing results for 
Search instead for 
Did you mean: 

S32V234 Matlab Vision Toolbox: Neural network without images as input?

Jump to solution
632 Views
fixed-term_luka
Contributor I

Hello,

I am currently evaluating on how the S32V234 can be used for running neural networks. The provided CNN Matlab examples work pretty well on my dev-board. What I could not find was an example for a neural network that does not use an image as the input (but e.g. numbers), so I wonder what the recommended way is to use such networks.

  • Can I just use any neural network in Matlab and compile it for the S32V234 with nxpvt_codegen(…)?
  • Can I use any layers/neural network types I want?
  • Is there example code I overlooked?
  • Is there a better way to do this, other than Matlab?
  • If I do not use any of the nxpvt.apexcv.xxx commands the compiled program will solely run on the ARM processor?
  • Does the Vision Toolbox support the integrated Vivante GPU in any way?

Thanks a lot!

Labels (1)
1 Solution
259 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi fixed-term.lukas.ebenstein@de.bosch.com‌,

Thanks for your feedback. In regards, with your questions, please let me try to provide some insights. I might not have a final answer to all of them but if further clarifications are needed we can continue the discussions.

Q1: Can I just use any neural network in Matlab and compile it for the S32V234 with nxpvt_codegen(…)?

Since NXP S32V processor is based on Cortex A53 ARM, you need to consider the ARM Compute Library support in MATLAB for code generation. Here is a link with the up to date information about the CNN/Deep Learning code generation support for ARM cores.

The list is available here: https://www.mathworks.com/help/coder/ug/networks-and-layers-supported-for-c-code-generation.html#mw_...

The networks supported on S32V are: AlexNet, GoogLeNet, Inception-v3, ResNet-50, ResNet-101, SqueezeNet, VGG-16 and VGG-19.

Q2: Can I use any layers/neural network types I want?

You can use most of them. The complete list can be found on the MathWorks site here: https://www.mathworks.com/help/coder/ug/networks-and-layers-supported-for-c-code-generation.html#mw_...

You can also use MATLAB command prompt to get a list of layers with the command:

pastedImage_16.png

Q3: Is there example code I overlooked?

In NXP Vision Toolbox, all examples are stored under ..\NXP_Vision_Toolbox_for_S32V234\examples folder

Another very useful page is MathWorks Getting Started with Deep Learning Toolbox page where you can find more examples. Anyhow, keep in mind that NXP is focusing on Vision part, hence this is why you see only examples related with pictures/frames/videos

Q4: Is there a better way to do this, other than Matlab?

Not sure if I'm fully understanding your question. 

I think that MATLAB provides one of the best approaches on the market: it provides the pre-trained CNN ready to be simulated, generate code, re-train, visualize.

MATLAB provides all the tools necessary to visualize the layers, design new networks from scratch, transfer learning and import/export between various frameworks like Caffe, Tensorflow, PyTorch, etc

NXP provides an additional framework to accelerate the CNN using APEX vision accelerators. If you need more information please contact your FAE/Sale representative.

Q5: If I do not use any of the nxpvt.apexcv.xxx commands the compiled program will solely run on the ARM processor?

Correct.

Q6: Does the Vision Toolbox support the integrated Vivante GPU in any way?

Short answer is No. All the code that is generated by MATLAB is executed either on ARM or the APEX cores. To run on any other processing unit apart of ARM, our tool relies on existing drivers, classes and kernels provided by NXP Vision SDK. Unfortunately, Vision SDK does not support the GPU. If in the future that will change, then we are going to expose such functionality in MATLAB too via NXP Vision Toolbox with some commands like nxpvt.gpu.xxx

Q7: What I could not find was an example for a neural network that does not use an image as the input (but e.g. numbers), so I wonder what the recommended way is to use such networks.

We do not have such example, but i think we can find some on MathWorks website here: 

https://www.mathworks.com/help/deeplearning/examples/time-series-forecasting-using-deep-learning.htm...

https://www.mathworks.com/help/deeplearning/examples/sequence-to-sequence-regression-using-deep-lear...

Typically we focus on Computer Vision related tasks but since the S32V is a ARM based platform i guess you can use it for any other jobs related with industrial, iot or automotive.

Hope this helps you!

If you have further questions do not hesitate to contact us.

View solution in original post

1 Reply
260 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi fixed-term.lukas.ebenstein@de.bosch.com‌,

Thanks for your feedback. In regards, with your questions, please let me try to provide some insights. I might not have a final answer to all of them but if further clarifications are needed we can continue the discussions.

Q1: Can I just use any neural network in Matlab and compile it for the S32V234 with nxpvt_codegen(…)?

Since NXP S32V processor is based on Cortex A53 ARM, you need to consider the ARM Compute Library support in MATLAB for code generation. Here is a link with the up to date information about the CNN/Deep Learning code generation support for ARM cores.

The list is available here: https://www.mathworks.com/help/coder/ug/networks-and-layers-supported-for-c-code-generation.html#mw_...

The networks supported on S32V are: AlexNet, GoogLeNet, Inception-v3, ResNet-50, ResNet-101, SqueezeNet, VGG-16 and VGG-19.

Q2: Can I use any layers/neural network types I want?

You can use most of them. The complete list can be found on the MathWorks site here: https://www.mathworks.com/help/coder/ug/networks-and-layers-supported-for-c-code-generation.html#mw_...

You can also use MATLAB command prompt to get a list of layers with the command:

pastedImage_16.png

Q3: Is there example code I overlooked?

In NXP Vision Toolbox, all examples are stored under ..\NXP_Vision_Toolbox_for_S32V234\examples folder

Another very useful page is MathWorks Getting Started with Deep Learning Toolbox page where you can find more examples. Anyhow, keep in mind that NXP is focusing on Vision part, hence this is why you see only examples related with pictures/frames/videos

Q4: Is there a better way to do this, other than Matlab?

Not sure if I'm fully understanding your question. 

I think that MATLAB provides one of the best approaches on the market: it provides the pre-trained CNN ready to be simulated, generate code, re-train, visualize.

MATLAB provides all the tools necessary to visualize the layers, design new networks from scratch, transfer learning and import/export between various frameworks like Caffe, Tensorflow, PyTorch, etc

NXP provides an additional framework to accelerate the CNN using APEX vision accelerators. If you need more information please contact your FAE/Sale representative.

Q5: If I do not use any of the nxpvt.apexcv.xxx commands the compiled program will solely run on the ARM processor?

Correct.

Q6: Does the Vision Toolbox support the integrated Vivante GPU in any way?

Short answer is No. All the code that is generated by MATLAB is executed either on ARM or the APEX cores. To run on any other processing unit apart of ARM, our tool relies on existing drivers, classes and kernels provided by NXP Vision SDK. Unfortunately, Vision SDK does not support the GPU. If in the future that will change, then we are going to expose such functionality in MATLAB too via NXP Vision Toolbox with some commands like nxpvt.gpu.xxx

Q7: What I could not find was an example for a neural network that does not use an image as the input (but e.g. numbers), so I wonder what the recommended way is to use such networks.

We do not have such example, but i think we can find some on MathWorks website here: 

https://www.mathworks.com/help/deeplearning/examples/time-series-forecasting-using-deep-learning.htm...

https://www.mathworks.com/help/deeplearning/examples/sequence-to-sequence-regression-using-deep-lear...

Typically we focus on Computer Vision related tasks but since the S32V is a ARM based platform i guess you can use it for any other jobs related with industrial, iot or automotive.

Hope this helps you!

If you have further questions do not hesitate to contact us.

View solution in original post