A beginner’s guide to AI: Supervised and unsupervised learning
Welcome to TNW Basics, a collection of tips, guides, and advice on how to easily get the most out of your gadgets, apps, and other stuff. This is also a part of our “Beginner’s guide to AI,” featuring articles on algorithms, neural networks, computer vision, natural language processing, and artificial general intelligence.
The AI we use everyday in our phones, cameras, and smart devices usually falls into the category of deep learning. We’ve previously covered algorithms and artificial neural networks – concepts surrounding deep learning – but this time we’ll take a look at how deep learning systems actually learn.
Deep learning, to put it simply, is a method by which a machine can extract information from data by sending it through different layers of abstraction. It’s a bit like using a series of increasingly small sifters to sort through chunks of rock for tiny bits of gold. At first you’d filter out large stones, then small rocks and pebbles, and finally you’d sift through whats left for flakes.
Only with deep learning you’re teaching an AI to recognize the differences between things like cats and dogs, and to find patterns in large amounts of data.
The way this is accomplished is through two different types of learning: supervised and unsupervised. Technically, there’s also semi-supervised learning, but for the purposes of this basics article we’ll only be covering, well, the basics.
Supervised learning is responsible for most of the AI you interact with. Your phone, for example, can tell if the picture you’ve just taken is food, a face, or your pet because it was trained to recognize these different subjects using a supervised learning paradigm.
Here’s how it works: developers use labeled datasets to teach the AI how specific objects appear in images. They might take one million images of different food dishes from Instagram, for example, and painstakingly label each one before feeding it to the AI.
It’ll then process everything it can about the images to determine how items with the same labels are similar. In essence it puts bits of data into groups – like separating laundry before washing. Once it’s done, developers check it for accuracy, make any necessary tweaks, and repeat the process until the AI can correctly identify objects in images without labels.
When we know exactly what we’re looking for, supervised learning is the way to go. But in instances where we’re unsure or we just want some insights, it won’t work.
Let’s say, for example, you’re trying to determine if someone is fudging the books at work, but you’ve got millions of pages of financial records to examine. You need a computer to help you look for patterns that could indicate theft, but there’s no way to create a dataset with ground-truth examples because you’re not entirely sure what you’re looking for. Enter unsupervised learning.
Here’s how it works: developers create algorithms that scour data for similarities. Instead of trying to determine if a group of pixels is cat or a dog, for example, it simply tries to figure out everything it can about an unlabeled dataset. Since AI has no way of knowing what a cat or a dog is unless you label their images in your data, it’ll just output patterns in clusters. It might separate the images into dogs, cats, brown animals, white animals, spotted ones, striped ones, big ones, furry ones … you get the picture.
In the aforementioned situation where we’re looking for evidence someone’s cooked the books, we might design the algorithms to look for math that doesn’t add up. Thanks to deep learning – in this case powered by unsupervised learning methods – our model should be able to detect anomalies that, while meaningless to the computer, indicate where the money’s gone missing from.
Deep learning is complex, and often difficult to understand. But the concepts behind it, specifically how it learns, are relatively straightforward. When a developer knows what the output should be, they’ll use supervised learning. If the output is uncertain they’ll use unsupervised learning – training with unlabeled datasets.