Closed tomfisher closed 6 years ago
Yes, it is. Our research group has already deployed a ANN in a STM32F411 microcontroller (which has been previously trained on the PC) and it is working properly.
The only thing that you need to be careful with is to use the fixed point version of the library if your MCU does not have FPU. Also, if you are compiling the library for a MCU, try to reduce it as much as you can (removing training functions if you are doing the training step on the PC, etc.).
I hope this helps. We are now writting a paper for the Neurocomputing Journal in which we describe some tests that we have performed using the library on the microcontroller and the results that we have obtained. The preprocessing step and the network architecture are both studied in "Performance Evaluation of Neural Networks for Animal Behaviors Classification: Horse Gaits Case Study" (E. Cerezuela-Escuedero, et al., 2016).
Thanks a lot for your reply. I'll read your paper.
I am wondering and will be grateful if it's possible to share your reduced code.
It would be very interesting share the code or some example
Yes you could share your code with us!!
I tried to do it with mbed and FRDM-KL25Z. There is too little RAM to store nets of sufficient sizes, however, I could make XOR example work. Probably, I'll switch to some more hi-end MCU later.
Do you remember how much memory is necessary? Generally the compiler show this value.
I'm talking about RAM not flash. Basically, you need at least 4 bytes per each weight, plus some overhead in neurons. With fully connected net you have NxM weights between layers N and M. With mbed, SD card lib and fann basic examples, it's about 8 kB of flash used.
Yes, I was referring to RAM memory, the major "problem". Generally after the compilation the IDE shows the total amount of flash and RAM needed.
The RAM shown in IDE doesn't consider dynamically allocated RAM when loading net. I'd expect slightly more RAM to store the net than size of net file.
@spsancti Do you need to change many things in the example?
Well, here it is: https://developer.mbed.org/users/spsancti/code/neurorace-jr/ I tried it with FRDM-K64F and it works. Hope this helps.
Since all questions here seem to be solved, can we close this issue?
Hi,
Is it possible to compile FANN for some MCUs such as ARM-Cortext M0? We just want to use the recognition part on MCU after a model has been trained on PC side.
Thanks.