NN on arduino duo board

Hi,

I am trying to explore to run neural network models on arduino due board.I have tried running back propagation algorithm from the below site:
http://robotics.hobbizine.com/arduinoann.html

I was wandering is it possible to do more something like some kind of prediction on the board without training the model on the board ?

Please suggest me if any kind of stuff i can try,

Thank you .

I was wandering is it possible to do more something like some kind of prediction on the board without training the model on the board ?

If you have learning data on the PC you can do the training there and load the data on the Arduino. There no need to do the training on the Arduino but often the training data is not available elsewhere.

okay, i got the point.
thank you so much.

pylon:
If you have learning data on the PC you can do the training there and load the data on the Arduino. There no need to do the training on the Arduino but often the training data is not available elsewhere.

Hi,

I have trained the mnist model in PC and have hard coded the hidden weights and output weights in the code in arduino ide . I am using 3 layer network (inp=784,hidden=15 and output =10) to recognize the mnist dataset.

But i am not able to get the correct outputs. Any suggestions regarding this?PLz guide me how can i predict digits in arduino duo micro controller using 3 layer feed forward network?

If you use the same code on your PC you don't get the same results? Post your code!

pylon:
If you use the same code on your PC you don't get the same results? Post your code!

its working now..thank you so much for your response

Hi,

How can we read pixel values of a image from my PC to arduino?Is it possible from load an image(.jpeg format) from the system to arduino?Is there any library available other than TFT and SD libray?
Plz guide me regarding this.
Thank you.

An interesting tutorial for JPEG decoding on Arduino:

Okay,thank you for your response.I will go through it.

Actually.I need to read the pixel intensities of an image stored in my system onto arduino .Is it possible without an SD card?

So send the data to the Arduino on Serial. Decode the JPG or BMP on the PC and send the individual pixels. It will be slow so only very small images are practical. Start with something smaller than 64x64.

okay.

#include <SPI.h>
#include <SD.h>
#include <TFT.h>
//#include <stdio.h>
//File bmpImage;
File textFile;
int height,width;
File bmpImage;

void setup() {
Serial.begin (9600);
// Open
//bmpImage = SD.open("/u/snpe-1.2.2/models/mnist/data/Ex0.jpg", FILE_READ);
bmpImage = SD.open("/home/ee210201/Documents/7.march/img.bmp",FILE_READ);
textFile = SD.open("/u/test.txt", FILE_WRITE);
bmpImage.seek(0x1C);// width in pixel = 28
width = bmpImage.read();
bmpImage.seek(0x1C);// height in pixel = 28
height = bmpImage.read();
Serial.println(width);
Serial.println(height);
int imageSize = height*width;

//bmpImage.seek(0x36);//skip bitmap header

for(int i = 0; i < height; i ++) {
for (int j = 0; j < width; j ++) {
textFile.write(bmpImage.read());
textFile.write(" “);
}
textFile.write(”\n");
}

bmpImage.close();
textFile.close();

Serial.println(“done write”);

}

void loop()
{

}

Hi,

I wanted to measure the %CPU USAGE on arduino? Is there any tool to check it?

A tutorial for measuring CPU utilization with code (for AVR) you could easily adapt for a DUE:

There is an Atmel Application Note on this subject which might help you:
http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42627-CPU-Usage-Demonstration-Using-DMAC-of-SAML22_ApplicationNote_AT10843.pdf

Hi,
I have downloaded the source code from the above link.But i am wandering what changes i need to make for the arduino due .
Is there any specific library for measuring CPU usage

"Arduino_CPU_Usage.ino:1:20: fatal error: avr/io.h: No such file or directory"

This application note from Atmel might help you:
http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42627-CPU-Usage-Demonstration-Using-DMAC-of-SAML22_ApplicationNote_AT10843.pdf

okay, i will go through the pdf.
Thank you so much for instant reply.

hi sir,
could you please provide the link or code for the arduino due cpu usage and memory usage.
i search the whole links but its showing avr controllers only , but DUE is SAM architecture those (AVR) librariers are not supporting to the DUE .

Please reply ASAP.