Neural Networks
Earlier this year (towards the end of my undergrad) I started to record some notes on machine learning applications and the datasets that power them. While I did find some interesting artifacts (see the FERET database) and read some good articles (such as The Body and the Archive), I never managed to really train and use a neural network in practice.
I did experiment with some pre-built networks, such as DCGAN by and char-rnn, but I didn't really undestand what was happening under the surface. More importantly, I couldn't modify these networks to change their outputs (apart from tweaking some hyperparameters).
The focus of the next few months is going to be to change that. As with earlier projects, I will be taking notes here as I go along.
Ideas for a workshop
Sheena suggested I might run a workshop with Interpolate on the subject of machine learning. This comes after a discussion at Designing a Feminist Alexa. We agreed that there seems to be an awful lot of magical thinking among humanities-folk about what machine learning is. To me, it often feels like these debates are floating in thin air. Arguments seem to be based more on Black Mirror episodes and Ted Talks than the papers where the working mechanisms of neural networks are being developed.
The goal of the workshop would be to dispel some of those myths, and give people some low-level understanding of what they're talking about. I'm proposing to do this by having a group of people train a neural network by hand — using nothing but pen, paper, and maybe a basic calculator. Over the course of a few hours, we'd build up a network using string and index cards pinned to the wall. Once the network is sufficiently trained, we'd use it to generate some kind of outcome.
I'm imagining it like the scene in Apollo 13 where engineers in mission control are working out orbital mechanics using slide rules.
The main question is: What kind of task do we train this network on? It has to be simple enough to be accomplished by a small network with limited computing power, yet complex enough to keep people interested.
- MNIST Digit recognition would be possible from a technical standpoint. Classification might be a bit dry, but maybe an opportunity to talk about social/political issues.
- Image generation would be great for outcomes, but hard to achieve given the recources. It could work if the images were extremely low resolution? But then teh results might be hard to distinguish from random pixels.
- Text generation. A recurrant net would probably be hard to convey. Outcomes could be useful though.
November 22, 2018: Some more specific workshop ideas
- The dataset will be a combination of images from the FERET database (scaled down to 12 × 18 = 216 pixels) and random images from CIFAR-10 cropped/scaled to the same size.
- We'll be training a linear classifier that distinguishes between two classes:
face
andno face
. (I think it's easy enough to make the connection from that to a full neural network) using SVM loss and vanilla gradient descent.
The learning algorithm is taken straight out of Rosenblatt (1958):
$$w_{i,j}^{\text{next step}} = w_{i,j} + \eta (y_i - \hat{y}_j)x_i$$
Once the model is trained, it can be evaluated:
- Accuracy/Recall
- Can we draw images that will trick the model?
- What can we say about the data that we fed into the model? Where does it come from?
- What about the idea that we created two distinct categories?
- What about the idea of processing power (how centralised is it)?
- Can we visualise the weight matrix (turn it back into a two-dimensional image)
Monday, December 17
Notes from running the workshop myself:
- Cutting up the test image into strips leads to a good visual artefact
- It might be better to present the images in black and white to avoid connfusion when converting them to decimals.
- Not sure if inputs need to be normalised
- Random numbers are necessary to initialise the weight matrix, maybe bring a printed list not unlike the RAND corporation book of 1,000,000 random numbers.
- What happens if the initalisation happens to give correct predictions? Might be better to cherrypick initial values for $$W$$ so a smooth training process can happen.
- Probably best to print all the graph paper in advance
- Also design it such that the pixels and the coumns are lined up, to make it easier to find which numbers to multiply. This will be nice as it results in one big drawing / document at the end.
- All numbers in the $$W$$ and $$X$$ need to have one decimal only, so they can be multiplied without using a calculator.
Things that my go in the reader
- Image classification models are easily tricked
- A chapter from Classification and its Consequences
- Rosenblatt (1954)
- Something on the biological neuron
- Paglen: Your images are looking at you
- A few examples of contemporary stories about facial recognition going wrong
- FERET collection method
- Hito Steyerl: Pattern (Mis-)Recognition
- Facebook paper on face recognition
- Maybe the paper about the PhD student doing the ImageNet challenge by hand
- Something about mechanical turk - human labour of cleaning datasets is outsourced into poor countries (perhaps collect examples from papers)