Artificial Intelligence: Question 3

Syllabus 18.1

Structured A2 6 marks

A photo-sharing app uses an artificial neural network to decide whether an uploaded photo shows a cat or does not show a cat. The network is trained on a large set of existing photos, each already labelled cat or no cat.

(a) Describe the three types of layer found in a typical artificial neural network, stating what each one does in this scenario. [2]

(b) State what a "weight" is in an artificial neural network, and explain what changing a weight allows the network to do. [2]

(c) Describe how back propagation of errors is used, during training, to improve the accuracy of the network's future predictions. [2]

Show worked solution Hide worked solution

Worked solution

Part (a): Layers of an artificial neural network

  • Input layer, receives the raw data for one example (here, data representing the uploaded photo) and passes it into the network.
  • Hidden layer(s), one or more layers of connected nodes sitting between the input and output layers; each node combines the weighted values it receives and passes on a result, allowing the network to learn more complex patterns in the photos than a single layer could on its own.
  • Output layer, produces the network’s final result for this example, here a prediction of cat or no cat.

[2 marks]: [1] for correctly describing the input and output layers in the context of this scenario, [1] for correctly describing the hidden layer(s) as sitting between them and carrying out the pattern-learning.

Part (b): Weights

A weight is a numerical value attached to a connection between two nodes (neurons) in the network, controlling how much influence the value passing along that connection has on the node it feeds into.

Changing a weight changes how strongly one node’s output affects the next node it is connected to. By adjusting its many weights during training, the network gradually changes which patterns in a photo most strongly push its prediction towards cat or towards no cat. This is how the network “learns” from examples, rather than being explicitly programmed with fixed rules.

[2 marks]: [1] for correctly describing a weight as a value attached to a connection between neurons, [1] for explaining that adjusting weights changes what the network has learned / how it produces its prediction.

Part (c): Back propagation of errors

During training, the network’s predicted output for a photo (cat or no cat) is compared with that photo’s known, correct label, to work out the size of the error.

This error is then passed back through the network, from the output layer, through the hidden layer(s), towards the input layer. Adjusting the weights on the connections that contributed most to the error, so that the network’s output for this photo would have been closer to the correct label. Repeating this process over many labelled training photos gradually reduces the overall error, improving the accuracy of the network’s future predictions.

[2 marks]: [1] for comparing the predicted output with the known label to find the error, [1] for describing the error being passed back through the network, adjusting the weights layer by layer to reduce future error.

Final answers

  • (a) Input layer (receives photo data), hidden layer(s) (learn patterns), output layer (produces the cat / no cat prediction)
  • (b) A weight is a value on a connection between two neurons; adjusting it changes what the network has learned
  • (c) Back propagation compares the predicted output with the known label, then passes the error back through the network, adjusting weights layer by layer to reduce future error