An aid to AID: SMS image xfer service

It is easy to pontificate on how images from people in developing countries could be sent by phone and aggregated into meaningful information to fix aid projects or democracy. What’s harder is actually implementing such concepts.

Today’s “aid for AID” is one attempt to solve this problem using SMS and twitter. The limitation is that only 140 characters can be used to encode the whole image. Conventional schemes for storing images would take thousands of characters. Here is what some people have tried as part of a StackOverFlow bounty (contest for 500 points of reputation):

http://stackoverflow.com/questions/891643/twitter-image-encoding-challenge

4

Note that all of these solutions employ a UNICODE character set (thousands of unique symbols, including all chinese characters) instead of an ASCII set (256 letters numbers and symbols).1 2

This next solution was written in python.3

This next example is what you get with conventional image compression methods (536 byte Mona Lisa). This poor quality image would still require 4 tweets to send, whereas the python abstract art approach requires only one and gets at the “essence” of Mona:

5 traditional image compression

And here is the original solution that people tried to beat. It uses vectors to geometically map her face :

7

My favorite approach: The Genetic Algorithm

This genetic algorithm that Roger Alsing wrote has a good compression ratio, at the expense of long compression times. (takes hours instead of seconds)  The resulting vector of vertices could be further compressed using a lossy or lossless algorithm, but what you see is an actual “code” for the information in the image itself, and not just a trick to approximate pixels in the image. This means that the content of this image (output from the genetic algorithm) can be used in many other ways, such as recreating the object with a 3D printer or being analyzed and aggregated with other objects encoded in this “DNA” style. It is like DNA in the sense that DNA encodes 3-dimensional proteins; and these vectors encode the edges in 2-dimensional images.

http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/

The image starts out random…

Genetic Programming- Evolution of Mona Lisa - 1

But each attempt is scored against the real image…
Genetic Programming- Evolution of Mona Lisa - 2

The iterative process yields incremental improvements, but sometimes great leaps in progress also appear…
Genetic Programming- Evolution of Mona Lisa - 3

…and viola! Evolution yields the Mona Lisa “code”.

Genetic Programming- Evolution of Mona Lisa - 4

This one clearly produces the best result, and copies the way nature solves problems. Too bad nobody is teaching this in science class yet. You should hire me to teach this at your university. 🙂
This related to Evolution.

Advertisements

7 thoughts on “An aid to AID: SMS image xfer service

  1. I’m busy applying a genetic algorithm to the London King’s Cross Western Concourse structure. Quite a jump in the deep end, having not much programming experience before (working with MATLAB) but it’s coming on. I will soon have some results. Maybe I could show you once I’ve got a result? I would have liked to apply more complex GAs to the structure (for instance NSGA-II, have you come across that?) but I’ve run out of time.

    It’s amazing to see the clarity of the Genetic Algorithm result!

  2. Great Cheesy Deano – please contact me when you make progress on it. I love GA!

    Is there a blog post you can refer me to that describes how genetic algorithms are written in MATLAB? I use python, which is compatible and MATLAB via scipy/numpy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s