CIE AS & A Level Computer Science, section 18.1 (Artificial Intelligence)
Machine learning
Machine learning is where a computer learns from data to improve at a task, rather than being given every rule by a programmer. It is a part of Artificial Intelligence (AI), which is the ability of a computer to do tasks that normally need human intelligence.
Types of learning
| Type | How it learns | Example |
|---|---|---|
| Supervised | from labelled data: each example has the correct answer. It learns to predict the label | recognising handwritten digits |
| Unsupervised | from unlabelled data: it finds patterns or groups by itself | grouping customers with similar buying habits |
| Reinforcement | by trial and error, receiving a reward for good actions and a penalty for bad | a program learning to play a game |
Neural networks
An artificial neural network is modelled on the brain. It is made of nodes (neurons) in layers:
- an input layer (one node for each input value)
- one or more hidden layers
- an output layer
Each connection has a weight. A node adds up its weighted inputs, applies an activation function, and passes the result on.
Learning
The weights are adjusted during training. The network's output is compared with the correct output, and the error is back-propagated, changing weights to reduce the error. This is repeated for many examples.
Deep learning
Deep learning uses networks with many hidden layers. Each layer finds more complex features in the data (for example edges, then shapes, then whole objects in an image). It suits image recognition and speech.
Benefits and concerns
- Benefits: can handle very complex problems and improve with more data.
- Concerns: needs large amounts of data, can inherit bias in the data, and it is hard to explain why a decision was made.
Common mistake: mixing up supervised and unsupervised learning. Supervised learning uses labelled data with the right answers; unsupervised has no labels and finds structure. Also, reinforcement learning uses rewards, not labelled examples.
Exam tip: for each type, state what data it uses and give an example. For a neural network, name the layers and say the weights are adjusted by training.
Check yourself
What is the difference between supervised and unsupervised learning?
Supervised learning uses labelled data with correct answers, whereas unsupervised learning finds patterns in unlabelled data.
What is adjusted when a neural network learns?
The weights on the connections between nodes.
What is deep learning?
The use of neural networks with many hidden layers to learn complex features.