Artificial Intelligence

Several years ago I read that computer researchers had given up on developing human-level artificial intelligence. “That’s pretty pathetic”, I thought. We’ve got 6 billion working examples, and the cost/performance of computers is getting low enough to make it feasible. How hard can it be?

So I decided to give it a shot. I read some textbooks explaining how human memories are formed and implemented the process in software.

The software seemed to work, but testing was a problem. Like a human brain it learns from sensory input, but your average desktop computer back then didn’t have much more than a keyboard and mouse for input. I could have coded up a virtual world to provide fake sensory input, but it didn’t seem worth the effort. The virtual world would have required several times more work than the AI software itself. So I put it on hold.

Now I’m dusting off the code and porting it to Android. I’m not sure what inputs and outputs to use just yet, but my Android smart phone has a microphone, camera, touch screen, accelerometer, and magnetic sensor as inputs, and a speaker, vibrator, and screen for output. I’m spoiled for choice.

It’s tempting to try to reproduce Pavlov’s experiment. Ring a bell, and the phone vibrates. Not quite human-level intelligence, but sound recognition is a difficult problem, so it’s a worthwhile challenge.

The learning algorithms might also be useful in the Heritage Health Prize. I didn’t get around to entering the Netflix Challenge a few years ago, but with $3 million up for grabs this time it might be worth a try.

Platinum iridium

My 20 percent research time isn’t just spent on new technologies. Occasionally I’ll crunch the numbers on a interesting business model and see if it holds up. Here’s one I came up with recently …

Gold is the traditional asset of last resort. It’s portable and holds its value when economies collapse. Unfortunately gold is currently experiencing a speculation-driven price bubble, and since industrial demand is limited, investors will take a big hit when the bubble bursts. So I wondered, what other metals could you invest in? And could I launch a business selling (and buying back) coins and ingots made from those metals?

The metals have to satisfy a few criteria.

  1. They must be valuable, at least $10/gram ($300/ounce). Low-value metals are useless – just try fleeing the country with 100kg of copper in your carry-on!
  2. They must be tough, non-toxic, not radioactive, and not corrode easily. So no mercury, arsenic, sodium, or plutonium.
  3. Their value must be primarily driven by industrial demand.

A few metals made the cut, in particular platinum, iridium, and palladium. Osmium is a possibility, but might be too brittle. The rare earths got a lot of publicity recently, but their price was driven by an artificial supply shock, and don’t look like good long-term investments.

Platinum is actually ideal, especially given its industrial demand as a catalyst, but doesn’t seem very original. After all, platinum jewellery has been around for centuries.

But iridiun is the one I like. It’s the second densest element known to man and the most corrosion-resistant. It’s also relatively abundant in meteorites. How cool is that. But, as I discovered after chatting to a metallurgist I met at a pub, making coins is hard. You can’t just stamp them out of cold metal, you’d have to heat them to 2000 degrees first. To cast them you’d have to heat the metal to 2500. In theory you could mill them, but it’s one of the hardest materials out there, so you’d chew through a lot of tools.

Details, details. The basic idea looks sound, but probably won’t scale beyond a small business. I might write it up for a business plan competition.

ASCII character brightness

I’m currently developing an Android application called ASCII cam. It allows you to view the world as ASCII art and take pictures of it.

I’ve played around with this technology in the past, and have used rough guesses about which characters should be used for different brightnesses. But this time I thought I’d do it properly, and empirically determine the optimal 16 characters in Android’s default fixed width font.

Calculating the brightness of each character was fairly simple. Draw it into an empty bitmap and count the number of non-zero pixels. The main surprise was that the brightest character – by a long way – was the letter M. I would have guessed @, so it’s a good thing I did this experimentally.

Now, the least bright character is obviously a space, so it gets position 0. The brightest character is M, so it gets position 15. All the other characters are then normalized against the brightness of M and assigned a position between 1 and 14.

Obviously, for a given position there are a few characters to choose from. I wanted characters that take up as much of their bounding box as possible, so I needed some kind to metric to calculate “spread”. This should be maximized when pixels are evenly spread throughout their bounding box.

My first thought was to use variance, the average of the squares of the distances from the mean position. This is easy to calculate and, at first glance, should give decent results. But it’s not perfect. A character with maximum variance would indeed be spread out, but it would have all its pixels clustered in the corners of the bounding box.

The solution I went with was to calculate the equivalent of the gravitational potential between all the pixels. Essentially the average of negative one over the distance between each pair of pixels. On paper it has the right characteristics, and in practice it looks pretty good too.

Problem solved.