How would you have a machine recognize a cat?

Wednesday, May 16, 2018

I wrote my first computer program in college. It was, surprisingly, not “Hello World”, but typing the number “6” into a Scheme interpreter prompt. You can see how Scheme responded below.

> 6
6

This may seem uninspiring but it was the first time I spoke to a computer, using a language we both could commonly understand. In fact, even though I was dutifully copying examples from my textbook, I distinctly remember feeling like I was having a conversation with my computer. I believe this feeling belies the core of what programming is: communicating and delegating to a machine.

At the time, I thought what needed to be communicated was a precise set of instructions on how I wanted the machine to complete a task. And before I could write the instructions, I had to thoroughly understand how I would personally complete the task. It was only then that I could tell a machine how to complete it. After all, machines were drones, they didn’t have their own minds, they just followed orders. Machines were an extension of myself, just with greater calculating power over a shorter time frame.

Fast forward to today, some things are changing.

I still write plenty of programs that specifically codify exactly how I want a machine to complete a task. To be frank it’s quite belittling toward machines. Imagine you walked into work every morning to your boss handing you a many paged document describing exactly how they want your day to go.

You are to write up a presentation with exactly 12 slides, don’t use Google Docs use that new software we just bought that you hate, if Steve from Sales walks by your cubicle and wants to talk about fantasy football you are to ignore him, oh and make sure you clock out exactly at 5PM because the company doesn’t want to pay any more overtime.

It’d be a nightmare to work for such a boss, I’m certain I’d quit within the first week. We all want to work with a boss that’s better at delegating tasks, one that lets us exercise our creativity on how to best complete a task without assuming we are incompetent. Why don’t we give machines a similar courtesy?

Of course, we still need to provide clear and exact instructions to machines. But instead of telling them how to complete a task, we can tell them how to approach a task.

We need to reach our quarterly profit goals. Here is a manual describing the experiments we ran in past quarters and how our profit changed. Figure out what to do with the data from our current quarter. And I’ll be honest with you, I have no idea what need to do to reach this goal, but I know you are efficient and calculating, I believe in you.

This approach to programming is machine learning in a nutshell (specifically supervised learning). The programmer can push the responsibility of domain knowledge to the machine, and instead focus on providing tools (data) and instructions on how to use these tools. This is a powerful idea because it means we’ll be able to leverage machines to accomplish tasks we don’t have the resources/training to do ourselves.

My first machine learning program was a cat classifier (this is the “Hello World” equivalent for machine learning). Essentially the program receives possible cat images and, using nothing but the RGB values of each pixel of it image, the program decides whether the photo contains a cat. It ended up having an 80% success rate on a test data set I used. Now, while it’s true that I could probably get at least a 99% success rate in classifying cat photos (accounting for some misclicks), I’m certain any explicit program I might write would operate at much worse than 80% accuracy. I wouldn’t even know where to start. A cat has pointy ears, but what are pointy ears, in fact, how do I describe what an ear looks like? How are pointy cat ears different from pointy mouse ears? Imagine having to describe what a cat looks like to a baby. You’d probably end up pointing out cats in real life until the baby learned itself through recognizing the patterns, a remarkably similar strategy to how we implement machine learning :).

Now, you might be wondering how exactly a machine learns without a human explicitly teaching it how to do the task. Stick around, that’ll be the topic of an upcoming post :).

.

[machine-learning] [deep-learning]

Artificial Intelligence, Machine Learning, and Deep Learning - What's the difference?

Tuesday, May 08, 2018

This is the first question I had when I first started exploring these subjects a month ago. I have a better grasp on the terms now, so let's delve in.

Artificial Intelligence

I think generally when people think about Artificial Intelligence (AI), they think of Artificial General Intelligence (AGI), or the ability of a non-biological entity to be able to successfully perform a wide variety of tasks at a human level (or better) proficiency. This contrasts with narrow AI, which can perform specific tasks at human proficiency. We already have examples of narrow AI in everyday life, like in our personal phone or home assistants, self driving cars, or AlphaGo. We don’t, however, have any examples of AGI yet and there is no consensus as to when that might occur, but the holy grail of AI research is toward the development of human level AGI, with the possibility that super intelligent AI wouldn’t be very far behind.

Machine Learning

Machine learning is a field in which machines are trained to develop algorithms to perform a task. This field flies in the face of traditional programming, in which humans assemble the algorithms and program machines to compute them. In machine learning, humans provide the training data (inputs that lead to certain outcomes) and program machines to determine how certain inputs will lead to certain outcomes. This is a powerful paradigm because it frees humans from needing to know how to get to the outcomes themselves, they just need to provide enough training data for a machine to figure out how a certain combination of inputs can lead to an outcome. For instance, if the task at hand is to catch a fish, traditional programming would teach a machine how to use a fishing rod - how to hold the rod, how to release the spool, how to cast a line. Machine learning would give a machine a library of videos showing people succeeding or failing to catch fish, leaving it up to the machine to go through each video and determine/learn how to catch a fish . Perhaps certain casting techniques are better than others, or maybe the weather plays a big role, the machine might pick up on patterns a human doesn't even think consider.

Deep Learning

Deep learning is subset of machine learning in which the machine’s learning style is loosely based on the neural wirings of a biological brain. That is, the machine is programmed to replicate how brains learn, via an artificial neural network. I’ll talk about that further in a subsequent post, but these neural networks will have many layers of "neurons" that explore many possible pathways for a set of inputs to end up as a set of outcomes. What's fascinating is that it's very hard to analyze these neural nets since they are essentially a jumble of weights that calculate patterns in input data. Take an artificial neural net (ANN) that can recognize if a cat is in a photo. For humans, we identify cats via features we deem catlike (pointed ear, furry bodies, whiskers). An ANN might notice that some group of pixels relates to some other group of pixels in a way that suggests a cat is there, but to a human this just looks like a bunch of math and data. For all we know, the ANN may come up with a more precise way to recognize cats that no human has ever thought of, some subtle pattern that renders simple feature recognition (it has a cheezburger?) obsolete.

Anyways it's all pretty exciting stuff and I'm looking forward to breaking past my surface level knowledge of deep learning, machine learning, and AI. One question answered, many more to go.

Spelling Bee Tldr;

Deep learning is a technique in the field of machine learning that advances us closer to creating artificial general intelligence.

.

[machine-learning] [ai] [deep-learning]

Page 1 / 1