ocf.co.nz

Filtering input in a complex environment

March 2nd, 2010

In my last post I touched on the idea that to be successful in a complex environment, any AI system would need to filter its input, essentially throwing away irrelevant information at a very early stage in order to keep up with the rapid flow of incoming data. In this post, I will elaborate on this idea.

Input filtering, as I see it, is about the quick (and possibly dirty) extraction of information from incoming data. It’s about turning the rapid flow of data into a comparative trickle of high-quality information, which itself becomes a data stream for higher-level subsystems.1

Filtering input is not about simply ignoring data; if we wanted to do this we could simply use fewer sensors. Consider an agent connected to a high resolution digital camera. It is true that, to reduce the current of the incoming data stream, the agent could discard or ignore the values of certain pixels. For example, it could ignore the outer edge of the frame and consider only the center, or ignore every second pixel to achieve a full but lower-resolution view. But, discarding input is equivalent to simply using poorer sensors, so does not gain the agent any advantage over simply being fitted with these poorer sensors in the first place.2

What filtering input is about is taking what information we want from some data, and then discarding that data. With the data goes a lot of other information which we could have extracted, but which we can do without. To return to a vision example, consider my old 640×480 webcam, which provides 307,200 pixels per frame. Each pixels requires 16 bits to encode, and the camera can serve 15 frames per second. That means my camera provides 70.3Mb of data per second, which is a lot.

Now imagine this camera connected to a hypothetical AI security system for detecting intruders, the Securicam5000. Inside the Securicam5000 is a subsystem which detects the degree of change from one frame to the next. For every frame, this subsystem provides a 4b message to whichever other subsystems need it, to say how much the frame differs from the previous one on a scale of 0 to 15. (Let’s assume for now that the designers have established that the degree of change from frame to frame is relevant to the overall goal of detecting intruders.)

What our subsystem achieves here is to filter the input. If the Securicam5000 was fitted with a whole array of similar input filtering subsystems, then the actual incoming data (all 70.3Mb per second of it) could be discarded once the relevant information had been extracted. Even if there were one hundred input filtering subsystems in the Securicam5000, each contributing on average, say, 10b per frame, that’s still only gives a 14.6Kb/s trickle of information to be passed to the higher-level subsystems. That’s a rate of almost 5000 times less than the raw input stream, which is much more manageable for a processor of limited speed.

As Sherlock Holmes gathers data about a case, he often gets to a point where he has all but solved the case and starts looking for the final evidence against his number one suspect. Meanwhile, Dr. Watson (and the reader) has no idea how Holmes can be so sure he has found the best lead. To the non-detective, ruling out some of the other suspects seems foolish and dangerous. But it is Holmes’ power to identify and discard irrelevant information that frees up his mind to deduce who did it.

For example, say Holmes’ client said he saw the servant admiring the painting late one night, but Holmes observed that the servant lacked the intelligence to successfully sell the painting. Holmes can throw away the possibility that servant stole the painting and even remove from his consciousness the distracting anecdote about the servant’s suspicious activity. Meanwhile, Watson grows more confused with every new piece of information, and suffers from information overload.

I believe that the visual system and other systems in the brain must do something similar to what Holmes does in his detective work, but subconsciously. To cope with a stream of data even greater that that of my old webcam, or any modern digital camera for that matter, the raw video data must be converted into a slower stream of simple information: presence of a curve here, presence of some lines there, lots of blank space. This data is more manageable by the later stages of the visual system, which in turn can produce a simple internal model of what exists in the world: a hot cup of tea to my right, and a pen and paper in front of me, and blue skies above.

In turn, my highest-level subsystems can take this model and play with it, and forget about the raw visual data from which it was extracted. I reach for the teacup because my internal model tells me it is there, not because I have consciously and painfully processed screeds of visual data and deduced that a teacup must be there – no system on earth could actually process so much data so quickly.

As I said previously, filtering input is not about simply ignoring data. To blank-out every second pixel on a camera, or in the human case every second rod or cone on our retina, would be as foolish as Watson trying to combat information overload by ignoring every second fact of the case. Firstly, this would be harmful to Watson’s ability to solve the case. And furthermore, this butchering of the input only achieves a data reduction of 50 percent, where the kind of reduction needed is likely to be far greater than that. We cannot throw away data indiscriminately and expect to be better off.

The question arises then, how do we know what information to keep and what to throw away. The answer will, of course, depend on the particular problem you are trying to solve. In the domain of triaging patients complaining of chest pain, Lee Goldman was able drill down to to exactly four pieces of relevant information: whether the patients ECG is normal, whether the pain is unstable angina, whether there is fluid in the patients lungs, and whether the patients systolic blood pressure is below 100. He achieved this by applying statical methods to years worth of patient records.

In the case of human vision, one might argue that it is evolution which has equipped the visual system with knowledge of what information is relevant and what is not. In the hypothetical example of the Securicam5000, the designers decided, using their expert knowledge, that how much the input changes from one frame to the next is among the information relevant to the problem of detecting intruders. Judging which information is relevant is a matter of carefully thinking about and experimenting with the problem you are trying to solve.

1 It may appear I am equating data with information, but this is not exactly my intention. I am using the data/information distinction like a north/south distinction. Anywhere you stand, north is on one side of you and south on the other. For any AI subsystem you look at, data comes from one side and information goes out the other; so one subsystem’s information is another subsystem’s data.

2 However, one could imagine an optimization process where a high resolution device was used in a series of tests, ignoring different input in each test in order to find the minimal set of sensors needed for a particular agent in a particular environment to achieve a particular task.

Blink – Malcolm Gladwell

November 26th, 2009

blink-cover

This is a book about the first moments of any encounter. It explains the amazing ability of the subconscious mind to infer a wealth of information from even the thinest slice of experience. Experts can spot a fake statue within seconds of seeing it, predict the success of a marriage by watching a couple chat, or identify a bird after a sighting of only a few seconds at great distance. We can all tell if we like someone in the first few minutes of talking with them, and we can tell what a person is thinking by looking at their face.

Gladwell explains that our snap judgments are very powerful and surprisingly accurate – often more accurate than a reasoned decision. He then gets into they ways our subconscious can get it wrong, and the danger of acting on snap judgments of the wrong kind.

This was a very satisfying read. A lot of research has gone into the book, and it is presented in a compelling way which interweaves talk about different studies to get the point across most effectively. Whatever profession you’re in, this book has the potential to change your way of thinking about your work, and to get you using a better combination of reason and instinct.

This book relates very directly to my AI research. I believe that any AI system operating in a complex environment, being that it would have limited computing power, would need a subsystem which filtered the incoming sensations (data), essentially blanking out certain information. Only in this way could the system keep up with processing the data as it came in. I have wondered if the loss of such information would be damning to the systems ability to make good decisions. But I feel the conclusions put forward in this book give hope to the possibility that it would not.

This book also made me think about the vast difference, and occasional similarities, between conscious and subconscious thought. Currently the most successful AI tackles problems which humans would apply conscious thought to, like diagnosing a disease or playing chess. AI has had less success with problems humans use subconscious thought to solve, like identifying an object or walking across a room. The gap between the two areas is vast, with chess AI performing at super-human level and the most expensive mars explorer having less intelligence than an insect. But, though vastly different, the two areas also seem to have something in common.

In the book, Gladwell talks about an algorithm devised by a doctor for triaging patients complaining of chest pain. Just as I thought he was about to conclude that no simple algorithm could take the place of a subjective examination by a nurse, he concluded the exact opposite: that the algorithm could outperform the nurses even though it took only a handful of factors into account. It turns out that the intuition of the nurses was not required, and that (by analysing years’ of data) their entire decision making process could be distilled into a simple algorithm that takes four true or false inputs and produces an output of “high-risk”, “medium-risk” or “low-risk”.

We usually think of instinctive activities like walking and seeing as involving a very fast flow of incoming data (compared with conscious thoughts which deals with a few elements at a time). But I think the story about this algorithm reiterates that we don’t need most of this data and that we are best to carefully throw away the irrelevant information and let only the relevant information reach the “decision making machine”. This makes subconscious tasks seem a lot more like conscious ones.

My Office

August 20th, 2009

I’ve been working outside for the past few days. The fresh air is good for productivity!

The View

My desk on the deck

Avian Visitor

Installing Software Updates on an Ubuntu Server

March 9th, 2009

On a desktop version of Ubuntu it’s easy to download and install package updates and security patches using the Update Manager tool, which by default displays an alert at the top right of your desktop every time there are some new updates to install. But when it comes to installing these updates on an Ubuntu server, you have to run the underlying apt-get commands yourself. Here they are:

First, update your package database to get info about any available updates:

apt-get update

Then, install all the available updates by running:

apt-get upgrade

That’s all there is to it!

Automating the process

You may wish to set up your server to periodically install software updates automatically. You could achieve this by simply creating a cron job to periodically run the above commands, giving each command the -y switch to assume a ‘Yes’ response to all prompts. But Apt and Ubuntu have provided a more official method, which overcomes some of the security issues around updating automatically. I recommend the method which apt has provided, outlined below:

First you need to install a special package:

apt-get install unattended-upgrades

Then add configuration to apt to start the daily updates:

cd /etc/apt/apt.conf.d
echo 'APT::Periodic::Update-Package-Lists "1";' > 90myconfig
echo 'APT::Periodic::Download-Upgradeable-Packages "1";' >> 90myconfig
echo 'APT::Periodic::Unattended-Upgrade "1";' >> 90myconfig

Now, your server will be automatically updated once a day. The “1″ in the above config lines means “every day”. You could easily change it to “2″ for “every 2 days” or “7″ for “once a week”, etc.

Why use this method for automatic updates?

Because this method will only update your server from the trusted Ubuntu hardy-security repository. Automatic updating means having changes applied to your server without your knowledge or without you having the opportunity screen the updates and choose precisely which ones to install. This should scare most server administrators! But it is less scary so long as we limit automatic updates to those provided by Ubuntu, who, presumably, most administrators of Ubuntu servers trust.

The second benefit of only updating from the hardy-security repository is that your server will only receive security patches, not major updates to software packages like your web server or mail server. Imagine if you found one day that an automatic software update to the apache or php package had broken a feature of your website. You wouldn’t know how long it had been since the feature broke, and you would be forced to fix it straight away. As long as you limit automatic updates to security patches only, you will not find yourself in this position.

It does mean, of course, that you will have to update your server manually from time to time to install the updates to software packages and less trusted sources. This shouldn’t be too much of a problem for most administrators. After all, manually updating gives you the chance to screen the updates and possibly install them on a test server first to avoid messing up the services you provide with your server.