Google Image Search Series
Alright. I’m really excited about this new series, which I’m calling the “Google Image Search Series”. Below you’ll see some examples from this series and a brief explanation of how these are created.
How are these images made?
First, I choose a word or phrase such as “celebrity” or “famous person”, and I do an Google image search for that word. I then take screen shots of the top 20 or so results. This set of images becomes my training data.
The images are then converted from an image array to a vector with the first third of this vector representing the intensities of the red channel, the second third corresponding to the green channel, and the last third the blue channel. So if the image was, for instance, 400 pixels x 400 pixels, the vector would be of length 400*400*3 = 480000 (because there are three color channels).
I then build one model for each element of this vector. Every element in the vector is the response variables once, and everything else acts as predictor variables in a model. Because of the n <<< p nature of this penalized regression models such as LASSO, Ridge, and elastic net were my first choice. Once I have all of the models, I then use them to predict the red, green, and blue intensities at each pixel with initialized values of all intensities being 0. Essentially this means starting with a solid black square and then letting the models modify each pixel accordingly. Some of the results can be seen below:
I think the images above are amazing. But others weren’t that interesting. A lot of these ended up just looking like blurry messes. So I kept experimenting with different models.
What I realized is that I wanted a model that would do a BAD job recreating these images, because that would look more interesting. So I turned to CART models. CART models aren’t necessarily bad, but they certainly will not be complex enough to accurately capture all of the complexities of an image. Also, as an additional way to further obscure the images, rather than working with the raw data as predictors, I’m using only the principle components as predictors. This produces some really stunning images:
And here is the exciting part! I’ve just recently added these to my store and they can be purchased here and here (I needed to create two separate listings because I ran out of variants in the first). Let me know if there are words or phrases you want to see. Just send me a message on twitter @statsinthewild.