[HN Gopher] Show HN: AI model on a $3 chip (esp32)
       ___________________________________________________________________
        
       Show HN: AI model on a $3 chip (esp32)
        
       We finished a design that allows a plug-and-play solution with
       TensorFlow Lite and a web server with the UI on ESP32. Here is a
       video of the process: https://youtu.be/aEZX3JMzwTo  I wanted to
       share the design in case anyone is interested as the camera is
       aimed at developers who want to play with AI models on the embedded
       side.
        
       Author : h317
       Score  : 68 points
       Date   : 2023-02-02 20:33 UTC (2 hours ago)
        
 (HTM) web link (maxlab.io)
 (TXT) w3m dump (maxlab.io)
        
       | txtai wrote:
       | Very interesting! Looking forward to seeing more embedded AI
       | devices coming out.
       | 
       | More NLP based, but here is an article on an effort to build
       | Transformers micromodels to run on embedded devices. The model in
       | this example is under 1MB.
       | 
       | https://neuml.hashnode.dev/train-a-language-model-from-scrat...
        
       | moffkalast wrote:
       | Nice job, though a smaller PCB would've been more practical? The
       | ESP32-CAM is definitely a bit tricky to work with software-wise.
       | 
       | I'm not sure how much sense it actually makes to run anything
       | onboard unless you want to take a snapshot every few seconds and
       | then spending a while classifying it. I've eventually just
       | resorted to streaming at SVGA and decent framerates and then
       | processing the output on another machine.
        
       | anigbrowl wrote:
       | How much do you plan to offer it for?
        
       | ottobonn wrote:
       | I signed up for updates! I have been looking for something
       | exactly like this for home automation, to detect occupancy, pets,
       | etc. I am very excited to pair it with HomeAssistant!
        
       | [deleted]
        
       | graiz wrote:
       | The ESP32 is a pretty standard sensor chip and the camera version
       | is also widely available. A basic version of OpenCV was ported ~3
       | years ago, so it's cool but not sure what's new here.
        
       | amelius wrote:
       | How would you characterize the performance of this chip, and
       | especially the AI part?
        
       | inspirerhetoric wrote:
       | What camera chip are you using?
        
       | drdaeman wrote:
       | Hmm... does it really work as advertised? Can it really run some
       | basic object detection in real-time on-device, and at what
       | resolution/framerate combination(s)?
       | 
       | Sorry for being skeptical, just that it sounds too incredible to
       | believe. I've toyed around with the same chips you're using,
       | OV2640 with ESP32-S3 and at any decent resolution it simply
       | seemed to lack the processing power to run even simple motion
       | detection, let alone anything fancier. Surely it was kind of fine
       | at low-res and it kinda works spotting an elephant in a room, but
       | it was completely incapable for detecting small fast-moving
       | targets (roaches) under less than perfect lighting conditions
       | (bathroom ceiling lights, decent but not overly bright). Best it
       | could do was serving a 1024p@5fps MJPEG stream over a network to
       | a more powerful machine for further processing.
        
         | nl wrote:
         | TFLite is designed for this:
         | 
         | > It has been tested extensively with many processors based on
         | the Arm Cortex-M Series architecture, and has been ported to
         | other architectures including ESP32.
         | 
         | https://www.tensorflow.org/lite/microcontrollers
         | 
         | Additionally there is an optimized kernel for ESP32:
         | https://github.com/espressif/tflite-micro-esp-examples
         | 
         | Edit: personally, I like the Sipeed MAIX for this application,
         | although the software was pretty annoying when I used it (in
         | 2020).
        
         | steve_adams_86 wrote:
         | I'm able to do it with a less powerful chip, albeit low
         | resolution and grayscale.
         | 
         | I'm hoping to make a pest detector for my automated hydroponic
         | garden. It seems very tractable at this point.
        
         | daveloyall wrote:
         | I'm skeptical, too. But apparently OP isn't the only one using
         | (or trying to use) "TensorFlow-Lite for Microcontrollers" on an
         | ESP32-S3. See this (little bit of) chatter:
         | https://github.com/tensorflow/tflite-micro/search?q=esp32&ty...
        
           | drdaeman wrote:
           | I haven't tried but it must be doable at low-res low-
           | framerate conditions, where CPUs still have plenty of time
           | left between the frames and frames aren't big (so maybe it
           | can even fully decode those JPEGs, not just extract the DC
           | coefficients for a quick-and-dirty hacks).
           | 
           | It's just the advertising page that sounds kinda
           | unbelievable: low power, night vision, image analysis on the
           | device, perfect for wildlife monitoring, can detect pests on
           | crops (implying high resolution unless we're talking about
           | deer and rabbits lol), etc etc.
        
         | ge96 wrote:
         | Here's a video of a guy squeezing an ML model into a Teensy
         | granted the Teensy is pretty powerful
         | 
         | https://youtu.be/6raRftH9yxM?t=436
         | 
         | edit: I will say processing IMU data is probably (a lot) easier
         | than frame by frame of some video
        
       ___________________________________________________________________
       (page generated 2023-02-02 23:00 UTC)