Training and retr aining
A trained neural network is able to take in a piece of data, such as an image, that it hasn’t seen before and output a prediction about what the data is, such as a category of flower, fish, car or whatever it’s been trained on. The process of training takes heaps of training data, which in this case is images labelled by what’s in them and tunes all the nodes in the network to accurately categorise all that training data and new data.
This is done by turning the image into a huge number of parameters, which you can think of as each pixel or groups of pixels. Inside the network, there are weights and biases that determine which pixels and groups of pixels are used to identify which category the image is expected to be in.
Training a network requires lots of data and computing power, which you don’t have on a Raspberry Pi. Yet it turns out that you can retrain a network by taking an existing trained network, which uses much less power and data.
Retraining enables you to take an existing network, keeping most of the network but replacing the final categorisation layer to suit your new training data (the labelled images). You can think of this as keeping the parts of the network that can identify shapes while replacing the final layer which categorises images, and using that ability to identify shapes.