Overview
In this chapter, we will explore the broad range of capabilities of AI and look at some of the fields
that it is changing. We will cover four areas in which AI is used in detail: medicine, language
translation, subtitle generation, and forecasting. Then we will dive into a text classification
example where you will build your first AI system – a basic text classifier that can identify when a
news headline is regarded as "clickbait." We will look at optimization – an important topic for
most machine learning systems that need to operate on a large scale. Finally, we will examine
different kinds of hardware, including memory, processes, and storage, and will also see how we
can reduce costs when renting this hardware from a cloud vendor.
By the end of this chapter, you will understand what kind of tasks machine learning can be used
to perform. You will be able to build your own basic machine learning systems, using a popular
Python library, sklearn. You will also be able to optimize the hardware of large systems and
reduce costs while storing your data in a logical way.
Introduction
Machine learning, which is a subset of Artificial Intelligence (AI), has had a major influence on
nearly every field you can imagine and can solve a wide variety of problems and tasks. Do you
want to detect cancer better? You can train an image classifier to inspect mammograms. Do you
want to communicate with people in other languages? Machine translation will help you. From
ambitious projects such as self-driving cars and astronomical discoveries to fixing minor
annoyances such as email spam, machine learning has taken the world by storm, and those who
understand what it can do and how to build machine learning systems will be at the forefront of
human advancement.
At the heart of any machine learning project is data. Many people, on first coming across the
concept of machine learning, assume that it is possible to take mounds of data, shove it into a
machine, and have the machine autonomously learn. But it's not so simple. Instead, machines need
meticulously structured, organized, and clean data, often in huge quantities. The more data there
is, the more difficult it becomes to store, process, and analyze the data, and it is therefore vital to
optimize data storage at all stages of storage and usage.
This is a problem. How can we build efficient machine learning systems that do not waste our time
or resources?
This course will show you practical real-world examples of how to do exactly that. You will learn
how to make your data work for you as efficiently as possible, often by example.
We assume that you are no novice at working with data and that you understand and have used
various filesystems, file formats, databases, and storage solutions for digital data. In this book, we
,will focus specifically on data for machine learning and show how this differs from storing general-
purpose data.
Machine learning comes in many different forms, but concepts from linear algebra are core to
many of the most important machine learning algorithms. In classical computer science, the focus
is often on data structures such as arrays, linked lists, hash tables, and trees. In machine learning,
while these structures are still important, you will more often need to work with data in the form
of vectors, matrices, and tensors.
Because of this focus on data structures from linear algebra, other components of storage solutions
have nuances too. Some processors are optimized at the hardware level for vectorized operations.
Some file formats handle this kind of data better too, and there are specialized data structures to
store data in this form efficiently as well.
Problems Solved by Machine Learning
Before we get our hands too dirty with learning how to store and process machine learning data in
efficient ways, let's take a step back. What kinds of real-world problems can we solve using
machine learning?
Machine learning is not a new concept, but with new algorithms and better hardware, it has seen a
resurgence over the last few years. This means it has received significant attention from many
diverse fields. Although the applications of AI are almost uncountable, nearly all of these stem
from a far smaller number of subfields within machine learning.
With that in mind, we'll start by examining one problem that machine learning can solve in each
of the main subfields of image processing, text and language processing, audio processing, and
time series analysis. Some problems, such as navigation systems, need to combine many of these
fields, but the fundamental concepts remain very similar. We'll start by looking at image
processing: we do not fully understand all the complexities behind how humans see, so helping
computers 'see' is a particularly challenging task.
Image Processing – Detecting Cancer in Mammograms with
Computer Vision
For classification tasks, the goal is to look at some data and decide which class it belongs to. In
simple cases, there are only two classes: positive and negative. When a doctor looks at a
mammogram to assess whether a patient has cancer, the doctor is looking for specific patterns and
signs. The doctor then makes a diagnosis based on the patterns.
As a slight simplification, a doctor looks at a mammogram X-ray and classifies it into one of two
classes: 'cancer' (positive) or 'healthy' (negative). Using image processing and machine learning, a
computer can be trained to do the same thing. The computer is fed thousands or millions of X-rays
in the form of digital images. Interpreting these as a set of matrices with associated labels, the
, computer uses a machine-learning algorithm to learn which patterns are indicative of cancer and
which are not.
It's an emerging field, but a very promising-looking one. In January 2020, Google published a
paper titled International evaluation of an AI system for breast cancer screening, which showed
results that indicated their AI system was able to identify cancer in mammograms not only faster
but also more reliably than human doctors.
Although images and language may seem very different, many techniques from image processing
can be used to help machines better understand and learn human languages. Let's take a look at
how AI has advanced the field of Natural Language Processing (NLP).
Text and Language Processing – Google Translate
While computers are great at repetitive mechanical tasks such as solving well-defined equations,
and humans are better at more creative tasks such as drawing, it is likely that if computers and
humans could work better together, their complementary skills would be more valuable than they
are individually. How can we help machines and humans work better together? A desirable
approach is to allow computers to act more like humans, fostering closer collaboration.
To this end, we have tried to make computers take on traditionally 'human' characteristics, such as
the following:
Look like us: In 2016, David Hanson created a human-like 'social' robot named Sophia,
which, apart from having a transparent skull, looks like a human female, and is partially
modeled on Audrey Hepburn:
Figure 1.1: Sophia – The first robot citizen at the AI for Good Global Summit 2018 (ITU pictures)