Neural Networks and Teachable Machine

Neural Networks

This project is an expansion of last week’s project on genetic algorithms. I received feedback from Dan Shiffman how my thoughts on social distancing would be a good fit for a neural network. As an overview, the CDC recommends 6 feet or 2 meters of distance between people and to avoid crowded places, overall lowering the risk of infection. Currently, the number of cases is increasing and people are still congregating in masses in some locations, like parks. I could explore the topic of “social distancing” and how distance between objects in p5.js could tell a story of infection. 

What problem are you trying to address?

In the time of coronavirus, the CDC recommends 6 feet or 2 meters of distance between people, to lower the risk of infection. Currently, people are not following this guideline and are still congregating in some locations, like parks. The problem that I’d like to address is how to reduce this congregation of people so that they conform to the 6 foot rule. The way I would represent that is a visualization of the park, where people in this case circles in p5.js, who are too close to one another turn red. The red symbolizes the transfer of infection.

How can AI help solve this issue?

The goal for all these circles is to be 6 feet away from another (in p5.js I would map the 6 foot criteria to a specific range). If they are less than 6 feet (or whatever the mapped distance is) both circles turn red, indicating they are too close and highlighting the increased chance of infection. Through evolution, the circles will increase their distance from each other. At the end, there will be less and less circles on canvas and no colors will show. 

What are the inputs of your system? 

The relative distance of neighboring circles

What are the outputs of your system?

Vector telling the circle of question which way to move

What is the training data? Does the data exist or does it need to be collected?

In this p5.js example, the data would be random placements of the circles. If I were to use real data to represent the circles, I would use location data of people within a park. Google has created mobility reports broken down by country, and by state in the United States (https://www.google.com/covid19/mobility/). They show aggregated, anonymized insights on movement trends over time across retail and recreation, groceries and pharmacies, parks, etc. Google is collecting movement through Google Maps from people who’ve opted in to storing their location history on their mobile phones. Therefore, in relation to this project, the location data exists and I would take a snapshot of a specific time in a park to determine if people are social distancing. 

What are the ethical considerations of collecting this data and/or applying this model? Is there a danger that the model will harm individual people or a community? Are there privacy considerations with the data?

There are enormous privacy concerns with using Google Map data. The Google Mobility report uses aggregated, anonymized data. If I were to look at social distancing within the park, hypothetically it would be on an individual level where each circle would represent a human. I would anonymize the circle so there would be no name, however, using an individual’s data based on their location can be seen as violating their privacy. Especially, if this dataset were to be hacked, it would reveal a large number of users and their location data, potentially leading to public shame. So, for the purposes of this p5.js project it would be randomly placed circles.

Teachable Machine

Training Model and Initial Prediction

This was my first time hearing about Teachable Machine and found it very approachable as a beginner’s AI tool. I trained my model on the various snacks I had in my house: pineapple, seaweed and chocolate. When I held up those same objects, it was able to predict with 100% confidence that what I was holding up was the correct item.

Pineapple
Seaweed
Chocolate

Further Predictions

I was curious to use this model and see its predictions for items I had not trained it on. The results were a bit surprising.

Clementine
Tissue Box
Notebook
Tea box

Naturally, the question is how is this model predicting what these objects are? What are the inputs? The one that stood at most to me was the tissue box – the prediction that it was the pineapple.

In watching the 3Blue1Brown video on Neural Networks, he states that our brain recognizes certain patterns in order to recognize numbers. For example, the two loops in an 8. In the neural network, the ideal is that anytime you feed in an image with a a loop like a 9 or 8, there’s a specific neuron whose activation is going to be close to one. The hope is that any generally loopy pattern towards the top sets off this neuron. That way, going from the third layer to the last one requires learning which combination of sub components corresponds to which digit.

Pattern Recognition
Neural Network

In the tissue box and pineapple example, the pattern that could determined the prediction was the top part of the pineapple. If it’s broken down into two sections – the pineapple bottom and the pineapple top or pineapple “hair”, that same mechanism could be applied to the tissue box bottom and the tissue box top or the tissue “hair”.

Leave a comment