Perhaps this is what you want to do
https://appinventor.mit.edu/explore/resources/ai/picaboo
The artificial intelligence example might work for shapes but probably not colors. You would have to build a training file with different shapes.
Here is another possibility TMIC: App Inventor Extension for the Deployment of Image Classification Models Exported from Teachable Machine