Monthly Archives: September 2012

Ants Secret Code – Reveal

Earlier, I posted a video of leafcutter ants claiming that it contained a secret code. Well it’s true! Here’s how to crack the code, and how I encoded my messages in the first place.



The astute observer may take note that the ants carrying leaves only travel in one direction (towards the nest). In fact, this is the entire underpinning to the code. When I presented the puzzle to my lab, the response I got that was closest to correct was from Prof. Tucker Balch who stated that the first thing he would do is “chart the number of leaf carriers visible in each frame over time and look for patterns in that time series.”  Good thinking Tucker!

The first step is to create a signal out of the leaf-carrying ants. To do this, one can simply take the green channel of the image and adjust a threshold until just the leaves are selected. To get more exacting data you could try to apply additional filters like blurs, dilations, etc on top of this thresholding. You can even use professional video compositing software like After Effects and “key-out” the green color. These additional improvements are not really necessary however, you can stay pretty crude.

Next, because there might be some extra foliage around the edges, you will want to crop to a region of interested just around the ants.

Example image targeting just the green leaves from the video.

The video should now be entirely white (255) in areas where the leaves are present, and entirely black everywhere else. I then made a simple script that tallies up all the white pixels (detections) present in every frame, and it saves all this data as a CSV. When I pop open this CSV file in an open-source equivalent to Microsoft Excel, and chart the results, I get something that looks like this:

Ahh, that looks like it might contain some sort of signal. Now’s the time for the cryptographic skills. Your first intuition should be that Andy isn’t that big on cryptography, and will probably just use the first temporal coding sequence that comes to his mind, Morse Code. If one takes the slightly wider pulses to be dashes and the slightly narrower ones to be dots, you can pull out this pattern:

— .  –   -.-.  .–.  .-..

Or translated from Morse->English: GT CPL

The Georgia Tech Computational Perception Laboratory (where I work).

Yay! I also have some additional videos where the ants say a couple other messages like “Digital Media” and, of course, “Hello World.” I even made a special message to the class of my cool Biology teacher sister.  I will post them here when they are ready.

Both videos from this puzzle say exactly the same message, it is just that one, the first video, was recorded further down the stream which gave lossier data, so more human, visual intuition was required.  The reason this data was lossier will be explained below. Additional props go to DM student Rebecca Rolfe who uncovered the unintentional Rebus of the video, “Soon there will be no leaves left” (Get it? Get it? Ants are carrying all the leaves to the right….)


How did the ants know how to communicate this message? Well they probably didn’t.

Earlier in the summer, I wanted to test Leafcutter responses to temporary barriers. It turns out that if the barrier is only there for a short amount of time (<1 minute), the ants will just sort of pool-up behind it instead of walking around (note, this is not true of other ants, like Army Ants).

To get more precise results, I built a simple servo-device controlled by an arduino which was attached to a fluon coated plate. While I was cutting-off, and re-enabling the flow of ants, I realized I could also program this device to send ant-based messages in this fashion. Thus after lots of experimentation, and a long hot day sitting in the jungle with my ant tollbooth, I found a workable formula for sending dashes and dots, and made the servo go up-and-down correspondingly to whichever message I wanted to send.

Of course, I wasn’t 100% certain that it worked until I got back home and analyzed it myself!

Leafcutter Ants Secret Code

The video below contains a secret message:

I’ll reveal the secret and how to figure it out on Tuesday, so you’ll have all of Labor day weekend to ponder.

First one to email me with the correct answer gets a prize (don’t email the whole list- serve and ruin the fun!).

First one to email me with how to arrive at the correct answer gets mild applause 🙂

Hint 1: To work with the video, it may be easier to download it all at once. Just pop the link into

Hint 2: (don’t use the hint unless you have to!): This video is slightly easier to decipher: