Regressing Images

Regressing 24 Hours in New Orleans

Nov 7, 2015 · 3 min read

Regression is a widely applied technique in machine learning. An example of a regression problem would be the prediction of the length of a salmon as a function of its age and weight. Regression analysis is a statistical process for estimating the relationships among variables. Lets have some fun with it ;-)


A while back, Andrej Karpathy released convnetjs, a javascript based neural network library. It contains a demo which Andrej describes like this:

The demo treats the pixels of an image as a learning problem: it takes the (x,y) position on a grid and learns to predict the color at that point using regression to (r,g,b). It’s a bit like compression, since the image information is encoded in the weights of the network, but almost certainly not of practical kind :)

This experiment test a regression based approach for video stylisation. The following video was generated using Stylize by Alec Radford. Alec extends Andrej’s implementation and uses a Random Forest Regressor. This experiment extends it to work on video. The source video is by JacksGap.

If the youtube video is blocked, try vimeo

Heavy loading times, sorry!

With bottleneck layer / dropout for extra fun.

Final thoughts

Using machine learning techniques in unusual ways is fun, generating new image styles addictive. Realtime processing might be possible using GPUs (all CPU so far). A VR version could be fascinating ;-) All results in this experiment are reproducible with the linked open-source software. If setups are to cumbersome for you, try Mario Klingemann’s related “Lowpoly Bot”.

Get in touch here: |

Sign up for the Newsletter for more experiments like this!

Source Video

Special thanks to JackGap for the awesome source video! :-)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store