Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Arduino Neural Networks

Arduino Neural Networks

Neural Networks are another type of Artificial Intelligence used in computing. They are used in computer games, expert systems and at many more places.

A in a limited way you are able to use them on Arduino too - eg. to steer an Arduino robot! In my presentation I will explain more about this topic.

This slides were presented on my presentation "Arduino, roboti a neurální sítě" at Czech Arduino Day 2015 on BarCamp Plzeň (more info at https://plzenskybarcamp.cz/2015/arduino-day) #ArduinoD15 #Arduino #barCampCZ

Tomas Jukin

March 28, 2015
Tweet

More Decks by Tomas Jukin

Other Decks in Technology

Transcript

  1. Tomáš Jukin
    @Inza
    Arduino
    and Neural Nets

    View full-size slide

  2. 2 KB RAM 16 MHz

    View full-size slide

  3. 7 + 8 + 4 = 19!

    View full-size slide

  4. 7 + 8 + 4 = 19

    View full-size slide

  5. 7 + 8 + 4 = 19
    Input
    Hidden
    Output

    View full-size slide

  6. 7 + 8 + 4 = 19
    7 Segment Display to Binary

    View full-size slide

  7. Tomáš Jukin
    @Inza
    www.juicymo.cz
    @JuicymoCZ

    View full-size slide

  8. Tomáš Jukin
    @Inza
    academy.juicymo.cz
    @JuicymoAcademy

    View full-size slide

  9. Dendrite
    Nucleus
    Axon

    View full-size slide

  10. Input
    Activation Function
    Output

    View full-size slide

  11. Dendrite 2
    Nucleus
    Axon
    Dendrite 1

    View full-size slide

  12. Input 2
    Activation Function
    Output
    Input 1

    View full-size slide

  13. Input 2
    Activation Function
    Output
    Input 1
    0,2
    0,8
    0,43
    0,18
    0,37

    View full-size slide

  14. Input
    Hidden
    Output
    Feed Forward ANN

    View full-size slide

  15. Input Hidden Output

    View full-size slide

  16. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor

    View full-size slide

  17. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    Flow

    View full-size slide

  18. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…

    View full-size slide

  19. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…

    View full-size slide

  20. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…

    View full-size slide

  21. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…
    0,345

    = 34% power

    View full-size slide

  22. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power

    View full-size slide

  23. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055

    View full-size slide

  24. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º

    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055

    View full-size slide

  25. Input Hidden Output
    Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º
    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055
    W11 = 0,14
    W12 = 0,65
    W14 = 0,42
    W13 = 0,26
    W21 = 0,21
    W22 = 0,37
    W24 = 0,19
    W23 = 0,46

    View full-size slide

  26. Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º
    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055
    W11 = 0,14
    W12 = 0,65
    W14 = 0,42
    W13 = 0,26
    W21 = 0,21
    W22 = 0,37
    W24 = 0,19
    W23 = 0,46
    Backpropagation

    View full-size slide

  27. Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º
    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055
    W11 = 0,14
    W12 = 0,65
    W14 = 0,42
    W13 = 0,26
    W21 = 0,21
    W22 = 0,37
    W24 = 0,19
    W23 = 0,46
    Backpropagation

    View full-size slide

  28. Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º
    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055
    W11 = 0,14
    W12 = 0,65
    W14 = 0,42
    W13 = 0,26
    W21 = 0,21
    W22 = 0,37
    W24 = 0,19
    W23 = 0,46
    Backpropagation

    View full-size slide

  29. Ultrasonic
    Sensor
    Gyroscope
    Wheel
    Encoder
    Left

    Motor
    Right

    Motor
    20º
    = 20/180 = 0,111…
    0,345

    = 34% power
    0,4

    = 40% power
    0,4 - 0,345 = 0,055
    W11 = 0,14
    W12 = 0,65
    W14 = 0,42
    W13 = 0,26
    W21 = 0,21
    W22 = 0,37
    W24 = 0,19
    W23 = 0,46
    Backpropagation

    View full-size slide

  30. When to use ANNs?
    It can learn

    and detect patterns

    View full-size slide

  31. When to use ANNs?
    But beware local
    optimum!

    View full-size slide

  32. When to use ANNs?
    To much training is bad!

    View full-size slide

  33. When to use ANNs?
    To much training is bad!

    To few training is bad too!

    View full-size slide

  34. And what about hardware?

    View full-size slide

  35. How ANN stores data?
    FF ANN needs just

    a two dimensional array

    View full-size slide

  36. How ANN stores data?
    FF ANN needs just

    a
    Feed-Forward Artificial Neural Net

    View full-size slide

  37. Nice!
    So I can run it

    everywhere then, can I?

    View full-size slide

  38. ANN on UNO?
    NOPE :-(

    View full-size slide

  39. ANN on UNO?
    2 KB RAM =>

    19 neurons effectively

    View full-size slide

  40. ANN on UNO?
    Average ANN has

    >100 neurons

    View full-size slide

  41. ANN on UNO?
    Interesting ANN has

    >2000 neurons

    View full-size slide

  42. ANN on UNO?
    => No go on UNO …

    View full-size slide

  43. ANN on Raspi?
    Yop, that is a start…

    View full-size slide

  44. ANN on Raspi?
    Yop, that is a start…

    and I2C or UART

    will connect it with UNO…

    View full-size slide

  45. ANN on Raspi?
    Yop, that is a start…

    and I2C or UART

    will connect it with UNO…

    but BEWARE the VOLTAGE!

    View full-size slide

  46. #Probee Robot

    View full-size slide

  47. #Probee Robot
    3x UltraSonic Sensor (Forward / Backward / Turret)
    4x DC Motor
    1x Motor Controller (Left / Right)
    1x Arduino UNO (= brain)
    1x Bluetooth Module
    1x 2x16 I2C LCD (= status display)

    View full-size slide

  48. #Probee Robot UNO ANN
    Hours to learn movement…

    View full-size slide

  49. #Probee Robot UNO ANN
    Hours to learn movement…
    15 minutes battery

    View full-size slide

  50. #Probee Robot UNO ANN
    Hours to learn movement…
    15 minutes battery
    Needs better HW

    preparation …
    =>

    View full-size slide

  51. Interested?
    Build or Implement

    start today!
    You can start right now…
    …with any language…
    …or on Arduino!

    View full-size slide

  52. Inspiration
    http://goo.gl/sKTfsd
    Blog post about ANN on UNO
    http://goo.gl/cuIUiH
    ANN controlling robot in video

    View full-size slide

  53. Tomáš Jukin
    @Inza
    www.juicymo.cz
    @JuicymoCZ

    View full-size slide

  54. Photo Credits
    All photos used are CC from Flickr

    !

    View full-size slide