AI, ML, deep learning
Each term names a smaller field inside the one before
AI is the goal, machine learning the method, deep learning its strongest form.
Four words get used as if they meant the same thing. They do not. Artificial intelligence is the widest: any machine doing work that seems to need intelligence. A chess program from 1997 counts, even though every rule in it was written by hand. Machine learning is the part of AI that learns its rules from data. A spam filter learns from mail people marked as spam. Deep learning is machine learning with large neural networks, and it is what made faces and speech recognisable. Generative AI is the part of deep learning that makes new things: text, images, code.
AI, ML, deep learning · Going deeper
Programming writes the rules; machine learning learns them
Training makes the model once. Inference uses it on every request.
Supervised learning
Labelled examples teach the model which answer to give
Features go in, the label is the answer. Regression predicts numbers, classification classes.
Most machine learning in use today is supervised. You start with examples where the answer is known: houses with their size, rooms and area, and the price each one sold for. The inputs are called features. The answer is the label. Training fits a model to the pattern that links them. Then you give it a house it has never seen, and it predicts a price. When the label is a number, that is regression. When it is a category, that is classification.
Unsupervised learning
With no labels, the model finds the structure itself
Clustering groups similar rows. A person names what the groups mean.
Sometimes there is no answer to learn from. Here are forty eight customers, plotted by how often they visit and how much they spend. No one has labelled them. A clustering model finds three groups on its own: big occasional baskets, loyal regulars, and occasional small spenders. The model did not name them. A person looks at each group and decides what it means, and marketing treats each one differently.
Dimensionality reduction · Going deeper
PCA swaps many columns for a few that keep most of the variation
Principal component analysis keeps the directions of most spread and drops the rest.
Reinforcement learning
An agent learns from the rewards its actions earn
Act, see the reward, do more of what paid. Chat models are tuned this way with RLHF.
The third kind of learning has no labels at all, only a score. An agent chooses an action. The environment, a game or a robot or a simulated market, reacts. It hands back the new situation and a reward, good or bad. Over millions of tries the agent learns which actions lead to the most reward in the long run. This is how AlphaGo learned to beat the world champion at Go. It is also how chat assistants are polished: people rank answers, and the rankings become the reward.
Reinforcement learning · Going deeper
Self-supervised learning: the data supplies its own labels
Hide the next word, then guess it. That is how LLMs are pretrained.
AI workloads
Most AI products do one of six jobs, sold ready-made
Match the need to a workload, then to the provider’s pretrained service.
Most AI products you will be asked to build do one of six jobs. Vision reads images. Text analysis finds sentiment and names in text. Speech turns audio into words and back. Translation moves between languages. Information extraction pulls fields out of forms and invoices. And generative AI writes, summarises and acts. Every cloud sells each of these as a pretrained service behind an API, so you can use it without training anything.
Task vocabulary · Going deeper
The exact task names that exam questions turn on
The question describes an output; the answer is the task name that produces it.
The question describes an output; the answer is the task name that produces it. Vision. Image classification one label for the whole image: "cat". Object detection a label and a bounding box for each object: three cars, and where. Semantic segmentation a class for every pixel: road, pavement, sky. Instance segmentation pixels grouped per object: this car, that car. OCR printed or handwritten text in an image becomes characters. Face detection finds that a face is present, and where. Recognition or verification says whose it is; Microsoft gates that behind an approval form (Limited Access). Language and speech. Sentiment analysis positive, negative, neutral or mixed, with a score. Named entity recognition finds people, places, organisations, dates, amounts. Key phrase extraction the main talking points of a text. Text classification your own categories: billing, complaint, sales. Summarisation extractive picks sentences from the text; abstractive writes new ones. Speech recognition and synthesis speech to text, and text to speech. Every pretrained service returns a confidence score from 0 to 1 with each label, box or entity. Choosing the cut-off is your job: it is the decision threshold of lesson 3. The two pairs most often confused: classification (what) against detection (what and where), and detection of a face against recognition of a person.
Vision
- Image classification one label for the whole image: "cat".
- Object detection a label and a bounding box for each object: three cars, and where.
- Semantic segmentation a class for every pixel: road, pavement, sky.
- Instance segmentation pixels grouped per object: this car, that car.
- OCR printed or handwritten text in an image becomes characters.
- Face detection finds that a face is present, and where. Recognition or verification says whose it is; Microsoft gates that behind an approval form (Limited Access).
Language and speech
- Sentiment analysis positive, negative, neutral or mixed, with a score.
- Named entity recognition finds people, places, organisations, dates, amounts.
- Key phrase extraction the main talking points of a text.
- Text classification your own categories: billing, complaint, sales.
- Summarisation extractive picks sentences from the text; abstractive writes new ones.
- Speech recognition and synthesis speech to text, and text to speech.
When not to use ML
Use it only when the rules can’t be written and data exists
Known rule: write code. Unknown pattern, enough data, tolerable error: use ML.
Machine learning is not always the answer. Ask five questions. Can the rule be written exactly? Then write code. Must every answer be exactly right and explainable? A model is right most of the time, never always. Is there enough relevant data? Without it there is no model. Does the pattern change faster than you could retrain? And is a wrong answer cheap, or caught by a person? When it is, machine learning fits well.
Lesson complete
You finished “What AI and machine learning are”
Nicely done.