Nature of Code Assignment 6: Neural Networks!

I started this assignment by doing the first two code walkthroughs from coding train for ml5. I didn’t have any brainchildren about how to expand on the exercise with the bird images, so i moved on to the image extractor exercise.

I got the sketch up and running without much difficulty so I tried to experiment with adding more emotion buttons. In addition to


and sad:

I added tasty (tongue out):


and a wink:

No matter how many images i categorized, I only seemed to be able to get two to show up as categorization options (it could be any two, but never more than two)

you can see this code here


So I went back to the original example with just happy and sad, and decided to make a game where you have to maintain an “emotional equilibrium” by alternating sad and happy faces to stay within a prescribed “emotional range”. I set a variable ‘equilibrium’ to 50, and each time the camera registered a “happy” face, it would add one. Each time it recognized a “sad” face, it would remove one. I added a tracking bar and some feedback phrases.

Overall, I’m pretty happy with how the game works – in practice, the user has to do some completely unstable-looking facial contortions to be categorized by the sketch as “stable”

code available here
sketch available here


Leave a Reply

Your email address will not be published. Required fields are marked *