You can try a model similar to the one shown in this webinar:
For the ESP32, I’d recommend staying with a mobilenet-v1 with an apha of 0.05 to stay within the capacity of that board.
You can use the MNIST dataset to get started and try or use your own if you have one.