Close

Goal and Plan

A project log for Generative AI on a Microcontroller

The Electronic Die of the Future

timTim 11/04/2023 at 23:280 Comments

Goal

The goal of this project is to build an electronic die using generative AI on a microcontroller. And of course it is a nice opportunity for me to play a bit with ML.

Pushing a button shall initiate the roll of a dice and a random result is shown on a display. Instead of using 7 LEDs and logic circuit, as in a traditional circuit project, we shall use a small display (e.g. SSD1306) and a microntroller (TBD - not sure how low we can go.).

Plan

  1. Since we want to employ a machine learning / AI algorithm, we first need to create a suitable set of training and test data.
  2. Once that is solved, we need to look intro a suitable approach for the generative AI model and test it. An important aspect will be to asses computational- and memory-footprint
  3. Train generative AI model and assess its performance.
  4. Pick a target platform that can meet the requirements derived in step 2.
  5. Implementation on the MCU

So far so good.

The first hunch for step 1) was to use AI image generators to create a set of synthetic training images. Curiously enough, creating pictures of dice seems to be a weak spot of current state-of-the-art models (why?`). Some examples are shown below. So we have to got for a simpler approach...

Top row: Dall-E 3 with the prompt: "a close up photo of a six-sided die on a table, looking straight from top, showing three pips on top". Bottom row: Stable diffusion with JuggernautXL (V6) and the same prompt.

Obviously, both can create great looking images of dice, but displaying the right number of pips is very difficult to control just with prtompting. It appears SDXL knows a great number of alien role playing dice, though...

Discussions