0
\$\begingroup\$

I'm working on a problem where we convert a 5 layered CNN which is capable of predicting the possibility of an epilepsy episode (yes or no), into a Spiking Neural Network (SNN), making it useful for low power applications. The end goal is to implement it on an FPGA. But since I lack experience with FPGAs, (and have decent experience with microcontrollers), my professor suggested me to try deploying it on a microcontroller, so I thought of trying it out on an arduino board.

From what I've seen, the Arduino nano BLE sense 33 allows deployment of tensorflow models using Tflite. However, I'm not sure wether the memory constraints of the board will allow me to deploy my CNN model. I want to be sure before investing in the board. The model summary is:

Total params: 24,010

Trainable params: 23,874

Non-trainable params: 136

It has 5 convolutional layers followed by max pooling and batch normalization. Can this be deployed on an arduino nano board? I also quantized the model to further reduce it's size before converting it to a tflite model.

Another important question is that how can we measure the power consumption while inference? This can be done using FPGAs easily, but I want to know if it can be done by the arduino board.

And finally, my last question is, wether we can convert the arduino C code into Verilog/VHDL so that this becomes implementable on FPGAs. Are there tools/converters for this?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

The AVR328 is much too small to do this. You'd have better success with a more powerful processor such as what's on the Raspberry Pi.

You can measure the power per inference by measuring current, and windowing the measurement during the inference interval and subtracting the baseline.

I doubt you would find a migration from AVR C source to FPGA. You're more likely to find a path from TensorFlow, Pytorch or other environment to HDL. A possible: https://github.com/marph91/pocket-cnn

Also check out Lattice SenseAI: https://www.latticesemi.com/sensAI

\$\endgroup\$
4
  • \$\begingroup\$ I thought if RPi as well but the end goal is to implement it on an FPGA. I thought it will be possible to do that if I implement on an arduino first, and then use some C-->HDL converter. Can this sort of thing be done with Pi? And can I also measure power consumption on that as well? Measuring the power consumption is an important aspect \$\endgroup\$
    – satan 29
    May 12, 2023 at 0:16
  • \$\begingroup\$ I don't know of a path that can take C code and convert it into a CNN deployable on an FPGA. You'd need to go back to your AI development environment (e.g., Pytorch) and get FPGA HDL from that. \$\endgroup\$ May 12, 2023 at 0:23
  • 1
    \$\begingroup\$ The quoted board "Arduino Nano 33 BLE Sense" uses a nRF52840 ARM corrtex m4 with an FPU, 1MB flash and 256kb SRAM - Not an AVR328. store-usa.arduino.cc/products/arduino-nano-33-ble-sense \$\endgroup\$
    – Bryan
    May 12, 2023 at 1:22
  • \$\begingroup\$ Ah, ok. Still, you might find it easier on the R.pi. \$\endgroup\$ May 12, 2023 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.