Hey, y’all. Hope everyone is doing alright and life is treating you well!
So this last weekend I attended my first hackathon, HackTX. For those of y’all that don’t know what a hackathon is, it’s a 24 hr lock-in where you build (or “hack”) some kind of program, occasionally utilizing some kind of library or software that the various sponsors make available to participants; these events have tons of sponsors, who are eager to see what students can do with their products. Thus, these events also function as recruiting opportunities for students seeking internships at tech companies. There is a ton of free stuff to get, great food to eat, and fun to be had at hackathons, and I encourage everyone to try and attend one (even if you’re not a computer science student; I’m not!) if they’re able to.
HackTX is the largest hackathon in the state of Texas, and people from all over come to this event. This year there were ~500 participants checked in, and with sponsors and staff/volunteers, the number of people at this event came close to around 600!
My team consisted of me and two other people, plus a freshman who was mostly just shadowing us (but I considered him a part of the team as well); we worked entirely using the Wolfram Language to build our program. The idea was to take an image and generate a unique 2D cellular automaton structure based on your facial features. We ran into some issues, however: one of which was pattern recognition. We wanted to have a cellular automaton built that was specific to one image, that meant that if we iterated the image multiple times, we would want the same structure. Since the images would primarily be selfies (that was our hope!), that meant that the pattern recognition issues manifested as a facial recognition problem. To get around this, we used a built in function called EdgeDetect. This essentially inverts the image, and maps the contours of the face more easily, which gets rid of our pattern recognition issue.
Another issue we ran into was cloud deployment; the Wolfram Development Platform currently doesn’t support a lot of the image processing features available to the language, so our original idea of deploying it and creating an interactive microsite for everyone wasn’t possible. There was no way to work around this other than to do everything in the Mathematica front-end.
Anyway, I wanna go back to talking about the process in more detail: remember that EdgeDetect function I mentioned before? Well, the output of EdgeDetect is a 2D square matrix, which satisfies something called a characteristic equation. Thus, eigenvalues (which are unique to the particular image) can be extracted. My project partner did this, and once he received the eigenvalues, I reverse engineered them to get something called a minimal polynomial, which has a special algebraic relationship with the cyclic behavior of totalistic (additive) cellular automata; I spent several hours reading a couple of formal math papers on the subject (I still don’t understand totally what’s going on, there’s a lot of algebraic field concepts that I am really unfamiliar with) and then spent another several hours writing the code to exploit the relationship; turns out, turning formal math into something codeable is quite difficult!
This minimal polynomial was then evaluated with our indicator random variable (either x=0 or x=1), and since x=0 outputs a trivial solution, we’re only interested in the case when x=1. This output a numeric value, which lies outside of the range [1, 256] (256 is the highest decimal representation of a length 8 list of binary input, since 28 = 256. For some help understanding how binary can be represented as decimals, and vice versa, check out this page). Because of this, we needed to find a congruence between the numeric output and another number within [1, 256] so we could construct the automaton.
All of this was done to preserve uniqueness of the structure, so that the image you feed the program gives you an automaton that is is yours and yours alone. Once this was finished, the number is read in as the first argument in the CellularAutomaton function, and the structure is built!
As you can see, this was pretty math intensive (especially for a hackathon)! I couldn’t have done it without the help of my team, so shoutout to them for being a part of this project and my overall first hackathon experience! And for also being there for moral/emotional support!
If you’re interested in taking a look at the code or want a more succinct description of what we did and where the motivation came from, check out our devpost submission. And like always, thanks for reading!