Articles / AI Application Programming

AI Application Programming

Books on Artificial Intelligence (AI) have to walk a line between being too scholarly and too fluffy. Some books are very academic, with lots of formulas and symbols and a dearth of practical applications. Others are high-level, with much visionary hand-waving but no code. M. Tim Jones' book manages to maintain a nice balance between these extremes.

Contents

  1. History of AI
  2. Simulated Annealing
  3. Introduction to Adaptive Resonance Theory (ART1)
  4. Ant Algorithms
  5. Introduction to Neural Networks and the BackPropagation Algorithm
  6. Introduction to Genetic Algorithms
  7. Artificial Life
  8. Introduction to Rules-Based Systems
  9. Introduction to Fuzzy Logic
  10. The Bigram Model
  11. Agent-Based Software
  12. AI Today

What I liked

A book on AI has to begin with a discussion of what AI is and where it has been. The first chapter does just that, giving an overview of the history of AI from 1940 onwards, including the contributions of several of the major figures in AI research (Alan Turing, Marvin Minsk, and so forth). He also makes the point that this book is going to be about weak AI, that is, "features that have been added to systems to give them intelligent qualities", as opposed to strong AI, which involves attempts at making computers think like humans. This sets up expectations for a discussion of pragmatic usages of AI techniques rather than a defense of AI as a field of study.

This book covers ten fields of AI research in 350 pages, and surprisingly, it does it well. For example, the chapter on simulated annealing is only twenty pages long, but it's twenty pages of good material. There's an application of the technique to the n-queens problem, some charts showing the decreasing energy and temperature as a simulated annealing solution progresses, and some illustrative code snippets from the sample programs.

Each chapter is concluded with a one- or two-page summary and a list of some applications of the topic. For example, the chapter on genetic algorithms (GAs) ends with a note about a symbolic problem (Towers of Hanoi) and an actual problem encountered by the author (star tracking), both of which have been addressed using GAs. This provides enough information to be useful for seeding a Google search without being overwhelming.

The chapter I liked the best was on fuzzy logic. It's a short chapter (only twenty pages) but it has some nice diagrams of membership functions, a nifty chart of the predator/prey example, and a good discussion of the sample code. Furthermore, the sample code provides several membership function profiles, so it's actually useful outside of the example; it could serve as the beginning of a fully-functional fuzzy logic library. After reading this chapter and working through the examples, I've been able to understand some discussions in other AI books on the topic with no problems. Just one minor nit: The Fuzzy Control Language (IEC 61131-7) could have been given a short mention in this chapter, but there's only so much space.

The sample programs are what really made this book valuable for me. At least one sample program is provided to illustrate how each topic can be applied to a problem. The programs are written in compact, well-commented C (make files are included), and they ran without a hitch on my Linux workstation. I found myself reading a section of the book, tweaking a #define or two in the sample program, and recompiling and rerunning to see the effects. It's especially nice that the code is not overly complicated. There are some structs and some pointers, but no gratuitously complex uses of macros or setjmp()/longjmp(). The CD contains all the sample programs, and it only holds about 400K of actual data, so it's easy to copy the information to your hard drive and to get the samples compiled and running.

Note that the fact that lots of actual code is provided doesn't mean that there are no theoretical underpinnings discussed. The "Ant Algorithms" chapter, for example, spends a few pages discussing Hamiltonian graphs (i.e., the Traveling Salesman problem) and shows how the ant movement algorithm is structured. The other chapters are the same, a bit of theory followed by the implementation of a sample application.

What I didn't like

There were a few typos in the book. In one place, it looked like a code sample had been copied and pasted accidentally. The author provided me with an errata file, though, and the problems should be corrected in the second printing of the book (which was due in October 2003).

Translating the sample code

In order to study the book, I began a little Open Source project to translate the examples from C to Ruby. The author has been very supportive of this effort, and it's been a good review of C and has helped me understand the sample programs much better. I chose Ruby as the translation target because it's compact and reasonably fast, and its dynamic nature seems to lend itself well to AI programming. It's also nice not to have to compile the examples, since Ruby is interpreted.

As part of the translation project, I've included some general notes on translating C code to Ruby. There's nothing spectacular there, but there are a few things which have bitten me that other folks may find interesting.

Conclusions

If you're getting a PhD in computer science, this book will not go deeply enough into each topic to make you happy. But if you're a programmer who's interested in getting an overview of artificial intelligence programming techniques for use in your work, or if you're writing a game and you want to provide some semi-intelligent behavior for your non-player characters, this is an excellent investment. You'll get a good overview of how things work, and you'll have some sample code to show you how to get started.

Recent comments

25 Oct 2005 17:55 Avatar Pfv2

good review
I own this book, and I must say it is a good introduction book and it provide an overview of some important subjects, that you can then dig by yourself if you want to.

Get this one!

10 Aug 2005 10:04 Avatar jimmyjim

Great Book
i loved reading this and your right it kept a great line of understanding. What i liked best about it was its easy ot understand writings.

31 Jul 2005 04:37 Avatar jessicajessica

tshirt famers
Never got a reply sent an email months ago. I am webmaster for a non profit organization http://www.liversociety.org and can write and have thousands of pages I would like to publish.

09 Dec 2004 08:59 Avatar modbot

Re: Wiki for AI


> There are two wiki I know of for AI

> work: the AI wiki, and the AI Algorithms

> Wiki.

>

> So, if you want to keep and share some

> notes with people as you learn about AI,

> check out those wiki! {:)}=

Wow, I did not know about AI Wiki. Pretty Cool!

07 Sep 2004 08:13 Avatar GulDukat

German translations?
Anybody knows of a good german book or site about this topic ?

My english isnt that good to really understand such a complex thing when it is written in english.
Maybe this book also has a translation into german?
Thanx a lot

GulDukat

--

My little Site :) (http://www.hau-rein.org)

Screenshot

Project Spotlight

Kigo Video Converter Ultimate for Mac

A tool for converting and editing videos.

Screenshot

Project Spotlight

Kid3

An efficient tagger for MP3, Ogg/Vorbis, and FLAC files.