Image of a computer. Image of a robot. Image of a blue piece. Image of a green piece.

Deep Image Prior with Tensorflow.js

2020-12-26

This post is copied from my old website with the original post dated some time in 2018, where I was playing around with Tensorflow.js.

Introduction

Neural networks are all the rage these days, and with techniques like batch normalization and residual connections that address the vanishing and exploding gradient problem, they are getting deeper and more effective ever.

However, one of the problems I keep running into is that it is not practical to expose these networks as services for personal projects, as the hardware required for reasonably speedy inference is too much. As a specific example, I tried hosting a convolutional neural network (CNN) for dog breed classification - the computation would timeout on both Heroku and AWS Lambda (API Gateway has a 30-second timeout), and I was only able to get it to work with a dedicated EC2 instance with 2+ vCPUs, which required a sizable chunk of change (for a student).

So, for the first interactive demo on my website, I thought it would be fun to implement Deep Image Prior by Ulyanov et all, which TL;DR, will de-noise an image of your choosing with a convolutional neural network in an encoder-decoder setup. (I will come back and expand this a bit more so people could attempt to understand what's going on here).

Demo Time

WARNING

If your laptop does not have a reasonable powerful dedicated GPU, the browser might freeze while this program is running!

Loading demo...