Skip to main content

What is Machine Learning?

Robot thinking about a problem

Robot thinking about a problem (PhonlamaiPhoto, iStockphoto)

Robot thinking about a problem

Robot thinking about a problem (PhonlamaiPhoto, iStockphoto)

Let's Talk Science
6.7

How does this align with my curriculum?

Share on:

Discover how computers can learn and find out about the three types of machine learning.

From Big Data to Machine Learning

Data has a story to tell - if you know how to look for it! In the past, people analyzed data to find meaningful patterns and trends. This is fairly easy with a small amount of data. But when there is a lot of data, it can be very difficult. Using computers can make data analysis much easier and faster.

So, how much data is out there? Short answer - a lot! People generate lots of data, especially on the internet. This is often called “Big Data.” Data scientists and computer engineers have had to develop bigger and better systems to deal with this. Cloud computing is one such system. Developers created it because individual computers could not process large amounts of data on their own.

All this data has changed the relationship between humans and computers. In the past, humans used computers to help organize and represent data. But humans still had to make sense of it. Now, machines are figuring out how to understand and explain data that is difficult for humans to make sense of. We call this Machine Learning (ML).

Misconception Alert

The terms machine learning and artificial intelligence are often used together. But they do not mean the same thing. Machine learning is one type of artificial intelligence.

Where is machine learning used? 

Machine learning can be used in any situation that involves large amounts of data. This is almost anywhere! Businesses were among the first to use machine learning. This is mainly because they had the money to invest in the technology, which was very expensive. Now, machine learning is less expensive and easier to access. In fact, people share many machine learning programs online as open source files.

Did you know?

Open source is the term for when people freely share their code online. People can change open source code to suit their needs, and to help improve it.

Machine learning is used in autonomous vehicles, medical research, and marketing campaigns. But did you know that machine learning is also used in sportsrestaurants, and even in writing rap lyrics? The possible uses of machine learning are endless. And we are just beginning to use this powerful tool. 

How does machine learning work?

There are many types of machine learning. Each has its own strengths and weaknesses. Below is a table that summarizes the different types.

  Supervised Unsupervised Reinforcement (self-supervised)
Key aspect Computers are provided with data that has been labelled by people Computers look for patterns in data that are difficult for people to label Computer creates its own data and supervises its learning
Mostly used when... We have a well-defined and time-consuming task We want to find new patterns in data We have a goal but we may not know the best way to achieve it

Supervised Machine Learning

The first type of machine learning is supervised machine learning. As you might guess, here people supervise the computer as it is trained. Let's look at an example.

Say you were designing a self-driving car. You would want the car to know the difference between different types of road signs. In this case, you would need to design a machine learning model. This is a program that can find patterns and make decisions based on a set of data.

To help the model figure out a pattern to correctly identify stop signs, people need to teach it what a stop sign looks like. First the model is given labelled pictures of stop signs and other road signs. Each label is either “stop” or “non-stop”. In computer language, we say that these pictures and their labels are the input data. The label name, “stop” or “non-stop”, is what we want the model to be able to identify later. This is the output data. To do this, the model may learn to look for the shape of an octagon.

Shown is a colour diagram of supervised machine learning with street signs.
Supervised machine learning (Let’s Talk Science using images from Pop_jop via iStockphoto and Infografx via iStockphoto).
Image - Text Version

Shown is a colour diagram of supervised machine learning with street signs. In the centre of the image is a small flow chart with unlabelled shapes connected by black lines. This is labelled “Algorithm.” On the left is a group of six street signs, including one stop sign. This is labelled “Raw Data.” A black arrow points from here to the algorithm. At the centre top is a group of signs labelled “Training Images.” Within this group, a red rectangle has been drawn around four signs. These are labelled “Non-stop.” A green rectangle has been drawn around a red, octagonal sign. This is labelled “Stop” and “ Desired Output.” A black arrow points from here to the algorithm. This is labelled “Rule = stop signs are octagonal. Two black arrows point from the algorithm to an area on the right side of the image, labelled “Output.” At the end of the top arrow is one octagonal red sign. This is labelled “Stop signs.” At the end of the bottom arrow are six other street signs. These are labelled “Non-stop signs.”

Once there is a model, engineers test it using new data. The model should be able to identify stop sign images it has never seen before. If it can’t, then it needs more training. Sound familiar? It's a lot like learning new things yourself!

Below is a video showing a simple version of supervised machine learning. First, the computer is first shown the required output – images of Waldo. Then it analyzes images to match this output data with input from its camera system.

There's Waldo is a robot that finds Waldo (2018) by redpepper (0:58 min.)

You may wonder how good machine learning is at this. We call the percentage of correct solutions accuracy. For example, if the machine learning identified stop signs 98 times out of 100, the accuracy would be 98%. But accuracy is an imperfect measure of a model’s performance on its own. Imagine a system that is given 98 images of cats and 2 images of dogs. It can recognize cats with a 98% accuracy if it just guesses “cat” every time! To get meaningful results, the system needs to be given the same amount of input data for each object.

When people use images to train a computer to see, it is called computer vision. Computer vision helps self-driving cars. It also helps computers read handwriting.

Try this!

Identifying a stop sign may seem easy to you, but it's hard for a computer. Look at this set of pictures and try to describe them only using shapes and colours!

The previous examples used machine learning to classify things. But supervised machine learning can also be used to make predictions. For example, a company could use machine learning to predict how long people will stay with the company. Machine learning could analyze input data like an employee’s education and years of experience. The output data would be how many years they stayed at the company. Once machine learning creates a model from existing employee data, it can be used to predict how long new employees will stay.

The biggest disadvantage of supervised machine learning is that it needs good labelled data to train on. A study about data labelling found that up to 80% of machine learning engineers’ time was spent making sure the labels were correct. 

Unsupervised Machine Learning

Unsupervised machine learning is used to find patterns in data sets that are difficult to label. One example of this type of data is human speech. All people's speech sounds different. So it is hard to tell a computer exactly how a word should sound. Unsupervised machine learning can be used to analyze spoken words.

Another example is in medicine. To help treat or cure a disease, scientists may want to figure out if it involves specific genes. Genes carry the information that makes you who you are. Each of your cells contains 25 000 to 35 000 genes. Researchers could use unsupervised machine learning to look for similarities in the genes of people who have the disease.

To see how unsupervised machine learning works, let's go back to the self-driving car example. Here, the system is not given labelled training images and the output is not pre-defined. Instead, the system takes the raw data and looks for patterns itself. Once it has found a pattern, a human can develop a model that includes these patterns. This can lead to models for specific tasks, like avoiding other vehicles on the road or dealing with traffic slowdowns.

Shown is a colour diagram of unsupervised machine learning with street signs.
Unsupervised machine learning (Let’s Talk Science using images from Pop_jop via iStockphoto and Infografx via iStockphoto).
Image - Text Version

Shown is a colour diagram of unsupervised machine learning with street signs. Starting on the left, a group of nine street signs is labelled “Raw Data.” An arrow points from here to the same signs, organized in a grid on a green rectangle. This is titled “Unknown output, No training images.” This green area is labelled “Interpretation.” An arrow points from here to a small flow chart labelled “Algorithm.” Three arrows point from the algorithm to three groups of signs on the right side of the image. This area is labelled “Output.” The top group contains a stop sign, a no entry sign, and a no u-turn sign. These are labelled “Signs with red.” The middle group contains a traffic light sign, a school zone sign, and a railway crossing sign. These are labelled “Signs with yellow.” The bottom group contains three different black and white speed limit signs. These are labelled “Signs with neither red nor yellow.”

Reinforcement or Self-supervised Machine Learning

The third type of machine learning is reinforcement or self-supervised machine learning. In this type of machine learning, the machine learns by trial and error. It creates large sets of data by running various scenarios. Then it evaluates which strategies produced the best results. This is similar to how you learn to play a video game. You try different things. Eventually you learn which strategies work best. Like a human, the machine adapts and improves its strategies based on its experiences. But it also gets some fine-tuning from actual humans.

Below is an example of self-supervised machine learning in action. This video shows how a robotic arm uses computer vision to toss different objects. The goal is for the robot to correctly throw the object in the bin as quickly as possible.

Robots learning to toss (2019) by Andy Zeng (3:05 min.).

Again, this might seem simple to us. But a robot needs to be able to consider many things to complete this task. First, it needs to locate and pick up an object. It needs to consider its gripping force, the force of the throw, and the weight and shape of the object. This requires understanding many physics principles. It would be pretty tricky to create a program that considers all these things. But this is a good task for self-supervised machine learning. Robots using self-supervised machine learning would be useful in places like recycling plants, where robots sort materials.

Another example of machine learning is when computers beat humans at games. Computers can use self-supervised machine learning to find the fastest way to win. Two computers can even play against each other using self-supervised machine learning. For example, in the video below, two machines discover a flaw in a game.

OpenAI Plays Hide and Seek…and Breaks The Game! (2019) by Two Minute Papers (10:00 min.).

There are many areas where self-supervised machine learning is used to improve systems. One area is computer security or cybersecurity. Keeping data safe is very important when the data is confidential. This includes data used by banks and the government. To test cybersecurity systems, self-supervised machine learning can pretend to be hackers. This lets people find the flaws in a system before an actual hacker does!

So how could self-supervised machine learning be used in our self-driving car example? Such a system could use virtual driving simulations to learn the safest action to take when the camera sees a red octagon.

Is there a best type of machine learning?

Choosing the right type of machine learning will depend on the type of problem that needs to be solved. For some problems, combining types can help get even better results. Remember the example above, about genes? We could use unsupervised machine learning to identify a gene that may play a role in a disease. We could then use this information to train a supervised machine learning model to detect that gene, based on the patterns identified in the unsupervised model. We could test its accuracy using input data from people with and without the disease.

Further Thoughts About Machine Learning

We know a lot about how our brains work, but some things are still a mystery. This is a lot like machine learning. It is great that the machines do what we want. But it is not enough. We also want to understand how they work.

Without knowing how machines make decisions, how can we know if their decisions are fair and ethical? This is especially true if people use machine learning with data about people. Being able to explain how machine learning works is called transparency or explainable artificial intelligence.

You may also be thinking, if machines can learn, will humans still be needed? The answer is yes! A machine learning model is only as good as its data. This is why we need many human experts to make sure it is accurate and appropriate. We also need qualified people to make sure these technologies are used wisely and fairly. Many people are working on this now, but even more will be needed in the future.

Let’s end on a great note. This is Abu’s story…

Abu's Story (2017) by Google (3:35 min.).

Let’s Talk Science appreciates the contributions of Melissa Valdez, Technology Consultant from AI & Quantum, for revisions to this backgrounder.

AI and Computer Vision
This backgrounder from Let’s Talk Science explains how computers see and learn to recognize objects and human faces.

How Machines Learn
This cartoon video illustrates in a fun way how supervised machine learning works.

AI and Human-Computer Communication
This backgrounder from Let’s Talk Science explains how artificial intelligence and machine learning help us communicate with computers.

AI and Personal Vehicles
This backgrounder from Let’s Talk Science explores how artificial intelligence systems are integrated in the vehicles we drive.

Exploring Machine Learning
In this lesson, from Let’s Talk Science, students will learn to explore how computers work by investigating how inputs get processed and appear as outputs.
 

References

Heller, M. (2020, March 9). Data Labeling: AI’s Human Bottleneck. Medium.

New Tech Dojo. (2018, March 6). List of Machine Learning Algorithms.

Shankar, S. (2020, May 30). Types of Machine Learning Algorithms. The Startup. 

Vas3k Blog. (n.d.). Machine Learning for Everyone.

Wilson, A. (2019, September 29). A Brief Introduction to Supervised Learning. Towards Data Science.