Wednesday, September 4, 2013

Really simple Artificial Intelligence

Artificial Intelligence (AI) is a very broad field.  I could not possible do the entire topic justice in a blog post but at least I can give a brief introduction to the field and break down what I see as the most common misconception.  

The field of AI seeks to create systems that find solutions were previously unknown to the program creator (not take over the world and use us as batteries).  One branch of AI is machine learning, where programs learn based on inputs and then can act on future inputs to achieve a goal.  

Today, we are going to break down the misconception that artificial intelligence programming has to be very complex.  The diagram below illustrates a conceptual goal based navigation for Boe-bot that I created.  The goal we've given Boe-bot is to go forward.  That is it!  

This wouldn't be much of a goal if Boe-bot were in an environment with no walls, like on a treadmill or an infinitely large surface.   Since there are walls in Boe-bot's actual environment, it needs to know it has driven into a wall and take a corrective action in order to meet its goal (of driving forward).  To help with this, Boe-bot has two inputs -whiskers that are attached to switches.  When a switch is closed, we know Boe-bot is touching a wall or obstacle.  

In this first code iteration, Boe-bot has been armed with three action choices, turn left, turn right or backup and turn right.  We want Boe-bot to learn which action will allow Boe-bot to accomplish the goal of driving forward.  Initially, Boe-bot gives each action an equal likelihood of success for the three combinations of input stimuli (left whisker touching, right whisker touching or both).  Through trial and error Boe-bot will learn which actions are more success at responding to certain input stimuli.

For example, if the left whisker is touching a wall, it is unlikely that turning left will free Boe-bot from the wall.  Using the algorithm outlined in the diagram, if Boe-bot initially did select turn left in this example, the result would be to reduce the success rating for this action choice.  When Boe-bot chooses an action the second time, it will choose a different action.  Assuming that action is successful, Boe-bot will increase the success factor for this action stimuli pair.   


In part two of this article, I'll share my code that implements the above algorithm and perhaps also share a video of Boe-bot learning in action!  

In future articles, I'll explore how we can make this more interesting, through a richer selection algorithm and have Boe-bot generate actions.

No comments:

Post a Comment