I'm looking for a supervised learning algorithm that can take 2d data for input and output. As an example of something similar to my data, consider a black image with some sparse white dots. Blur that image using a full range of grayscale. Then create a machine that can take the blurred image as input and produce the original sharp image as output.

I could make some sample 1D data by taking a region/radius around the original sharp point, but I don't know the exact radius. It would be significant data duplication and a lot of guessing.

Any good algorithm suggestions for this problem? Thanks for your time.

  • 1
    $\begingroup$ Does it have to be a supervised approach? A convolutional denoising autoencoder seems like exactly what you're looking for, but it's unsupervised. $\endgroup$
    – brentlance
    Commented Oct 5, 2014 at 12:18
  • 2
    $\begingroup$ Supervised is the wrong term here, I believe. The OP essentialy wants to denoise, which is what you typically do with unsupervised methods. $\endgroup$
    – bayer
    Commented Oct 8, 2014 at 19:32

2 Answers 2


You can simply convert a MxN matrix (your image) into a MN dimensional vector. For instance if you have 10 images each of which 10x10 pixels, you can convert them to 10 vectors each of them containing 100 element (you can do it row-wise or column-wise, does not matter). Then putting all these vectors on each other constructs a nxd matrix where n is the number of images and d is the number of pixels in each image.

So far we just prepared data for analysis. Now let's go to the question:

  • I'm looking for a supervised learning algorithm that can take 2d data for input and output.

What does that mean?

First- The dimension of input-output is not a property of a machine learning algorithm.

Second- By 2d, you mean a matrix? I'm afraid your data is not really 2d! If you mean a matrix, a MxN matrix is a data of M samples in N dimensional space. also those vectors you may produce from your images are in MN dimensional space.

Third- A supervised algorithm takes some teaching samples (called training) to learn a task. What are those teachers here? If you have a training data which contains some blurred and corresponding original images then you can try to learn the place of white pixels by exploring blurred area. My suggestion:

  1. If a smoothing filter has been applied to your image, the blurred pixels most probably look like a gaussian. So first extract the gaussians.
  2. As you already have the place of sharp whites correspond to those gaussians you can use the mean, location of the mean and also variance as features (inputs) and the place of sharp white pixels as the target (output).

The classifier could be a simple neural network (a MLP should work here) or a simple SVM.

The answer above can not be evaluated without more information about your data and a more specific description of the question (e.g. What are your images exactly? if you can post one of them here I can probably help more)

  • $\begingroup$ Thx @NeilSlater :) Correction done! $\endgroup$ Commented May 12, 2015 at 11:54

Depending on how much data you have, a good approach should be some form of a neural network based encoder-decoder.

The are plenty of results for "neural network image denoising" on google but a common approach will be:

  • Start with your input image
  • Pass it through smaller and smaller convolutional layers
  • Upscale it back through bigger and bigger deconvolutional layers (usually this part is a mirroring of the first, convolutional, phase)
  • Compare the output to your expected results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.