Intro To Artificial Intelligence

Aug 20, 2017 · 999 words · 5 minutes read artificial-intelligence machine-learning

Artificial Intelligence (AI) is a large section of computer science. It includes areas like knowledge representation and machine learning, which I’ll being doing a post on in a couple of weeks.

This post will be a very high level overview of some of the sections under the AI umbrella. It should give you a good intro to understanding what AI is and what to look into if you want to find out more.

Agent Types

It is often useful to look at intelligence, natural or artificial, using the idea of an agent. An agent is anything that interacts with its environment. So this could be a machine, an animal, or you and me. The important bit to remember is that an agent perceives it’s environment, with sensors, and then acts on the environment, with actuators.

We’ll only be looking at the three most basic agents, but there are many more we won’t touch on. A good place to start if you want to learn about other types is the Wikipedia page on Intelligent Agents

Reactive Agents

A reactive agent is very simple. First it perceives its environment, and then it acts on it. The action performed is based on a predefined set of simple rules and the perceptions of the agent right now. There is no memory state and so decisions aren’t based on observations.

An example, although a bit contrived, would be an artificially intelligent doorman. When you arrive at the door, it checks if you are a resident or on a guest list and if you are then it opens the door and allows you to enter the building. If you are not then the intelligence doesn’t let you in the building.

Model-Based Agent

Model-Based agents are a slight improvement on reactive agents. Instead of decision on an action from a set of rules, the agent updates a world model. The world model is a kind of memory of the environment that includes previous actions and their outcomes. The agent then uses this model, along with the immediate perceptions, to decide on an action from a set of rules.

These agents seem to perform well for simple exploration tasks. Although in cases where the agent has to look several moves ahead then they perform poorly, such as playing chess.

Planning Agent

The last agent we’ll look at is the Planning Agent. This agent adds one more improvement to the model-based agents by adding a planning stage. After updating the world model, it will use its world model to reason about the future.

Some of the techniques that have worked well are: logical inference; simulation; and state-based searching such as A* Search. These techniques are great for specific problems and make the agent seem intelligent. But in other cases the agent won’t adapt to new situations and so it won’t perform well.

Search Strategies

Many problems in AI are solved simply by searching. Consider a machine playing chess against a human. To win all the machine needs to do is:

  • Maximise its own score
  • Minimise its opponent’s score

To do this it sets up a tree of all the possible moves it can take. Then from each node of the tree it computes all the moves it’s opponent can take, and so on until the game is complete for each branch. Then it’s simply a matter of picking the best available move that achieves those two objectives.

More practically, this is a simple explanation of the Minimax algorithm. This algorithm has a major drawback in that the search tree can become enormous. Far too big to search through in a few seconds. Although there are known optimizations that drastically speed up searching, such as Alpha-Beta Pruning and make this search strategy good enough for real world scenarios.

Some other search strategies, which are better in specific scenarios, are classes as either Uninformed or Informed search algorithms. I won’t go into detail in this post but if you want to read some more I’ll add some useful links to some well known algorithms.

Machine Learning

I can’t do an intro to AI in today’s world without talking about Machine Learning. I’ll be doing a more in depth post about ML later on, so I won’t go into it too much here.

ML focuses on pattern recognition and computational learning. I like to look at it as the combination of some of the AI methods I’ve mentioned here and statistical methods. These combine to create many ML techniques like clustering, classification, and neural networks. There are lots techniques but most can be classes as either supervised learning or unsupervised learning.

A supervised learning model starts by taking the input data and the correct predictions in a process called training. Once it has been trained you give it the input data and it will give you back a prediction it believes to be correct.

An unsupervised learning model is similar but doesn’t need to be trained. You give it the input data and it’ll give you its prediction.

It is important to realise that like many things in AI, and in fact computer science, one is not better than the other. There are some cases where it doesn’t make sense to use an unsupervised learning model. Then there are cases where an unsupervised model will perform better than a supervised model. The decision of which to use is entirely dependent on your use case and the data you have.

There’s Way More

Artificial Intelligence is a huge field of computer science and has many more interesting areas. As computers get faster and more connected AI and ML are going to become even more important than are today. To give you an idea why take a look at my post on the Difficulties of Unstructured Data. And if you are keen to learn more about ML, keep an eye out for my introductory post in a couple of weeks.