Difference: TinyML (7 vs. 8)

Revision 82023-09-11 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

TinyML

Introduction

Line: 23 to 23
  Here we go through the ESP32 C++ examples
Changed:
<
<
Michael O'Cleirigh has started a project on github trying to port these examples to MicroPython (https://github.com/mocleiri/tensorflow-micropython-examples). Since there are several ESP32 modules that include a simple camera, I2S microphones are supported in MicroPython and several accelerometers with I2C interface are available, it should be possible to run these examples on the ESP32.
>
>
Michael O'Cleirigh has started a project on github trying to port these examples to MicroPython (https://github.com/mocleiri/tensorflow-micropython-examples). Since there are several ESP32 modules that include a simple camera, I2S microphones are supported in MicroPython and several accelerometers with I2C interface are available, it should be possible to run these examples on the ESP32.
 

The hardware

Changed:
<
<
There are several esp32-cam boards integrating a camera with the ESP32 CPU. Some also provide an SD card interface, such that photos or videos from the camera can be recorded onto an SD card. Some of these boards have only 16 output pin and are therefore very limited in the number of GPIO lines available to interface external devices and others use 40 output pins. None of them has a microphone and/or an accelerometer on board. To my knowledge there is only one such board using the ESP32S3 chip with vector instructions speeding up neural network operations and that one is a 40 pin device. I therefore selected this device for my studies.
>
>
For the person detection example several esp32-cam boards integrating a camera with the ESP32 CPU are available. Some provide an SD card interface, such that photos or videos from the camera can be recorded onto an SD card. Some of these boards have only 16 output pins and are therefore very limited in the number of GPIO lines available to interface external devices and others use 40 output pins. None of them has a microphone and/or an accelerometer on board. To my knowledge there is only one such board using the ESP32S3 chip with vector instructions speeding up neural network operations and that one is a 40 pin device. I therefore selected this device for my studies.
  ESP32S3_kit.png
Added:
>
>
Of course it is possible to interface the microphone and/or the accelerometer to the above board, but in this case a bread board and quite a bit of external cabling is needed. I therefore prefer to use the WeMos D1 mini eco-system with an ESP32S3 CPU, a triple base and prototype boards onto which the microphone and the accelerometer are mounted.

The photos below show the CPU and the backplane board.

esp32s3_cpu.png triple_board.png proto.png
ESP32S3 CPU back plane (riple board) prototype board

in addition we need the microphone and the accelerometer. The I2S driver in MicroPython support the MH-ET Live and the SPH0645 microphones. There are many accelerometers on the market and I selected the LSM6DS3 because this is also used in the TinyML book.

sph0645.png mh-et-live.png lsm6ds3.png
SPH0645 microphone MH-ET Live microphone LSM6DS3 accelerometer

The photo below shows the MH-ET Live microphone mounted on a prototype board. The connections are made with small cables on the back. The prototype board can then simply be plugged onto the base board.

microphone.png micro_back.png
top view of the microphone mounted on the prototype board cabling on the back

 Setting up the PC and MicroPython for TensorFlow

The following pages show how to set up the PC to run TensorFlow, how to create models and how to down-scale them for use on the ESP32. Then a custom version of MicroPython must be created including the esp32-camera driver and its MicroPython interface as well as ulab, a stripped down version of numpy and scipy as well as the tflm library and its MicroPython access routines.

Line: 54 to 69
 
META FILEATTACHMENT attachment="ESP32S3_kit.png" attr="" comment="" date="1693646417" name="ESP32S3_kit.png" path="ESP32S3_kit.png" size="297059" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ESP32S3_pinout.png" attr="" comment="" date="1693646914" name="ESP32S3_pinout.png" path="ESP32S3_pinout.png" size="359825" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="microphone.png" attr="" comment="" date="1694420329" name="microphone.png" path="microphone.png" size="349049" user="UliRaich" version="2"
META FILEATTACHMENT attachment="esp32s3_cpu.png" attr="" comment="" date="1694419188" name="esp32s3_cpu.png" path="esp32s3_cpu.png" size="290745" user="UliRaich" version="1"
META FILEATTACHMENT attachment="triple_board.png" attr="" comment="" date="1694419188" name="triple_board.png" path="triple_board.png" size="108158" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sph0645.png" attr="" comment="" date="1694419189" name="sph0645.png" path="sph0645.png" size="121710" user="UliRaich" version="1"
META FILEATTACHMENT attachment="mh-et-live.png" attr="" comment="" date="1694419859" name="mh-et-live.png" path="mh-et-live.png" size="159361" user="UliRaich" version="1"
META FILEATTACHMENT attachment="lsm6ds3.png" attr="" comment="" date="1694419860" name="lsm6ds3.png" path="lsm6ds3.png" size="71225" user="UliRaich" version="1"
META FILEATTACHMENT attachment="proto.png" attr="" comment="" date="1694420071" name="proto.png" path="proto.png" size="175932" user="UliRaich" version="1"
META FILEATTACHMENT attachment="micro_back.png" attr="" comment="" date="1694421710" name="micro_back.png" path="micro_back.png" size="367313" user="UliRaich" version="2"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback