Machine learning for the classroom
Machine learning is a hot topic. It is a subset of artificial intelligence and is about teaching a computer, rather than programming it. One of the approaches in machine learning are artificial neural networks (ANNs) that mimic the function of our brains. Though much simpler than their biological counterparts, they are impressive in what they can do, especially when it comes to image processing.
I recently had a conversation with my year 8 twins about learning strategies. I tried to explain to them how their brains learn and why, therefore, breaks are important to give the brain time to 'digest' new information (aka to consolidate the molecular updates that regulate the exchange of information between the neurons). So I drew a couple of neurons on a sheet of paper, interconnected them and showed how a brain learns and thinks.
A neuron (artist impression).
I thought I could do better than this. I wanted my boys to look inside and experiment with an actual neural network. If you followed some of my earlier work with the B4 computer processor kit, you would have guessed that I am the kind of person that likes to open windows into things that are otherwise hidden. I have previous experiences with ANNs which gave me a head start. I tweaked an ANN that I made previously and created the UI to look inside.
Here is a screenshot of an experiment where the ANN has been trained and is able to recognise the letters A .. J.
A trained ANN recognises the letter B.
On the left, the eye sees a pattern in a 5x7 grid. It forwards the bits via the optical nerve to the brain that consists of three layers (input/hidden/output). On the right, a nerve cell (perceptron) fires. The network has recognised the B.
We can play with the information that the eye sees. Clicking into the grid, we can set and unset pixels. As we gradually modify the B, the ANN will be less sure about this being a B. Is it perhaps a D?
B or a D? Bit of both!
Changing the pattern one bit further towards the D, the ANN gets much more confident that this is a D.
More B than D.
So neural networks are great at dealing with information that is not quite ideal. This is often the case in the real world, especially when it comes to image processing. Imagine a self-driving car. The ANN produces a probability value, the more black a box, the more certain it is.
From the perspective of an ANN, anything is a pattern. So we let it loose on a couple of emojis:
Our ANN recognises emojis.
But what about more complex patterns? Could our simple ANN convert decimal numbers into binary? Yes, it can:
ANN recognising the number 5 and converting it into binary.
This educational ANN has three special features:
The learning process is short, animated and is entertaining to look at.
The line colours change subtly as the network learns. You can observe the network learning and the learning is in the network. Each network has its own fingerprint.
You can observe the perceptrons (nerve cells) firing as the network processes information.
The network has been programmed with different learning strategies. It can also forget information. Your students will see why revision is important and understand why they sometimes forget things they have learned (see experiments 6 and 7).
The website mycomputerbrain.net hosts the ANN. Your primary and secondary students can experiment with it. I have prepared a couple of experiments (with instructions suitable for school kids), and more might follow. Any ideas?
I think the ANN would be of interest to teachers of Digital Technologies or Biology, but generally to anyone who teachers growth mindset and learning techniques.