Friday, March 18, 2016

AI is Just A, Corn Mazes and Training Your Model

AI

Artificial Intelligence seems to be pretty popular these days. We see it in movies, we hear about it in popular culture (Watson, the computer that kicked butt in Jeopardy) and we read about it in books.

For decades, people have been prophesying that artificial intelligence will rise up. Machines will become self aware (2001: A Space Odyssey, War Games, Terminator, etc.). This makes for a great story and movies with a lot of explosions and Schwarzenegger's, but the concept is not really grounded in fact.

The truth is, artificial intelligence really has little intelligence - insofar as actually being able to reason. Computer Scientists say that computers "learn" (a topic I hope to cover in depth later), and this is true to an extent - I suppose it depends on your definition of "learn". But Computer Scientists pretty much agree that "reasoning" is substantially harder for a computer.

Learning

When a computer "learns", the computer is looking for patterns and correlations within a set of data. If your memory was super fast and your recall was immediate, you could easily processes thousands of images and draw some conclusions about the images. Consider a case where all the images have some sort of plant in them. If you come across an image of a plant which you have never seen, you likely will be able to recognize the image as an image of a plant. How your brain stores, processes and predicts what is likely to be a plant is extraordinarily complicated.

Yet, we can "train" a computer to recognize a plant, too. It is important to understand that the computer "learns" what a plant is in a very different way. One approach might be to tell the computer that it is about to look at images of plants. For each image, the computer might evaluate the colors in the image, the shapes within the image, identify contours to better understand the relationships of the shapes and so on. After looking at thousands of images, the computer can then generate a "model" which roughly estimates what features are common across most of the images. For example, most of the images are likely to be rich in green and have somewhat rounded shapes (leaves) with some straight lines connecting the round shapes (branches).

But wait! What if we trick the computer and show it a black and white image? Based on the model that the computer has previously generated, it is very unlikely that the computer will be able to recognize the image as a plant. The failure in this case represents a fault in the model: perhaps we depended too much on color images. An improvement may be to train the computer with both color and black and white images in order to build some variation into the model.

The "how" portion of finding correlations in this example is somewhat complex, but you can conceptually think of the computer looking for "things that are the same" and assigning percentage values to these features - when presented with a new image, the features are identified and the percentages are processed. Most plants have roundish leaves, so "round things" should have a very high percentage associated with it. On the other hand, "spots" probably ranks low because a good number of plants are not spotted. And so it goes with other interesting features that the computer is programmed to look for. The key is programmed. Without instructions of what to look for, the computer simply will not be able to recognize a plant.

Fortunately, we do not have to be terribly specific when we tell the computer what to look for. By way of example, we can simply tell the computer what "shapes" are and how to identify them. Then we can instruct the computer to identify all  the shapes in the images and figure out what the most common shape is. So as long as the computer knows how to identify a rectangle or circle, the computer should be able to figure out how common these shapes are in the image.

The Vroomin Koomen And Corn Mazes (Spoiler Alert)

When I was doing my undergraduate work, I was involved with a team project that involved building and programming a robot to navigate a maze. At first, this seemed like a pretty hard task - but once we researched maze theory and built a proof-of-concept robot, we found that it is not hard at all - there is little "intelligence" when navigating a maze. At least, some mazes. You see, if the maze has no moving parts (unlike like Maze Runner) and no cycles (endless loops), then one simply applies the "right hand rule" (or "left hand rule" if one is a southpaw). The "rule" is just a simple algorithm:
  1. If you can go right, go right
  2. If you cannot go right, go straight
  3. If you cannot go straight, go left
That is it - I have given you the solution to every corn maze in the nation! While this approach is guaranteed to generate a correct result (caveat - the maze entrance and exit must be on an edge of the maze), the result may not be optimal. Moreover, corn mazes tend to have "checkpoints" within the maze. These checkpoints add some level of adventure to the maze, but also serve to draw players in from the edges - rendering the "rule" useless. A number of corn mazes also have high bridges that allow players to climb up and see the maze from a higher perspective. This may help players see parts of the maze from an advantageous position, but often times the bridges introduce "cycles" in the maze; essentially allowing for infinite loops. Think of it as trying to find your way out of a maze when you are next to a tree - if you apply the right hand rule to the tree, you will circle the tree forever.

Because bridges can introduce infinite loops, I think a good idea for a corn maze would be to have a bridge connected to a edge which must be traversed - this would introduce the possibility of an endless loop which cannot be avoided.

Once we established the algorithm, all that needed to be done was create software to drive the robot while following the "rule". This introduced some real-world programs (such as over-steering, processing real time inputs and accounting for terrain imperfections), but overall was an achievable goal. We named the robot "Vroomin Koomen" in honor of one of the university's professors whom we all held in high regard.

Reasoning

What is the difference between reasoning and learning? I like to think of reasoning as "the next level" of learning. When we reason, we recall all of the pieces of information (evidence) we have which may be relevant to the topic at hand. The sources are varied and may not be tangible, like memories or past experiences. We consider what conclusions are possible, as well as the likelihood that each conclusion is possible based on the evidence. We assimilate several classifications of data, filter out non-relevant data maybe make some seemingly complex connections based on intuition or "gut instinct". We put all this together and then we draw higher level conclusions about the data.

Takeaway

Despite going off topic a bit, the most important point I am trying to make is that we need not fear artificial intelligence. The machine apocalypse is a long time from now. Think about this: we can't even get machines to predict the weather any better than by flipping a coin. But we are finding ways to use machine learning to process large amounts of data and drive decisions a number of industries - marketing, manufacturing, banking, pharmaceutical and pretty much everywhere else.

No comments:

Post a Comment