I am implementing an autoencoder neural network in matlab, the weights of which are being optimised by a genetic algorithm.

At the moment I am working on the first layer, trying to get an improved reconstruction from it by using the genetic algorithm.

Using the genetic algorithm, I am able to get about a 30% improvement in fitness before the population converges, compared with the random data that it starts with; which is a reasonable improvement I thought, however it doesn't seem to make a difference with the actual reconstruction.

I will illustrate with a screenshot of my data: data screenshot

At the top is shown the original data (using MNIST data), followed by the reconstruction of the data by the fittest, median and least fit individuals (at this stage the population had converged, so there is no difference between the three)

Below that is a plot of the fitness function on the y-axis (it is a minimising problem) against epochs on the x-axis for those three data points, as you can see, the fittest individual starts with a value of about 120 and finishes around 80 without improving much on the reconstruction.

My problem is with my fitness function I think. I am using the sum of the squared differences between the (normalised from 0 to 1) pixel intensity values of the original and reconstructed data - but the more I think about it, the more it seems that it will probably favour offspring that reconstruct a purely black image, as that will have a pretty low value using that heuristic; and indeed it appears to tend toward that as I watch the reconstructions evolve.

So my question is: what can i use as an additional fitness metric to try and make my algorithm favour offspring that produce less noisy reconstructions?

some I have thought of are:

  • proportion of light pixels to dark pixels;
  • difference between histograms of original and reconstruction;
  • putting additional weight for very light pixels or very dark ones.

And that's about it. Would any of those be useful? can someone suggest anything better? I don't have much of a background in image processing, so any help would be greatly appreciated.

EDIT: In response to deong's replies;

My network goes 784 -> 500 -> 250 -> 100, training each layer one at a time as in the geoff hinton code before moving on to the next layer.

I have tried population sizes of 10-200, with many in between, i am using tournament selection and have tried k values of 2 to around 40, with a mutation rate of 0.01 - which selects a random block of 10000 values and replaces it with another 10000 random values.

As far as crossover goes; i have tried 1, 2, 3 and 4 point, uniform crossover with blocks from 100 values to 100000 values - and many variations of all of those methods, but none really seemed to make any difference, it just changes the speed at which it converges to the same thing.

I have also tried using particle swarm optimisation, and that gives me pretty much the same results - the overall mean squared error goes down over time, but the reconstruction just tends to a uniform black image, which makes sense that the mean squared error would be lower for an all black image than a random noise image because the original image is predominantly black itself.

do you have any suggestions as to what i should try next? I have started working more on the PSO algorithm lately, as it is much simpler to implement than the GA and has less variables that i need to try.

  • $\begingroup$ This seems like a strange question. Why do you want to improve the quality of the reconstruction? Normally neural networks are used for some task, such as classification; the quality of the reconstruction is not necessarily an indicator of the accuracy of the classifier. What are you trying to achieve, exactly? Also, you are mixing neural networks and genetic algorithms -- that strikes me as just weird, and unlikely to be the best approach. $\endgroup$ – D.W. Aug 17 '14 at 21:06
  • $\begingroup$ There has been research into using evolutionary techniques for optimising deep learning networks that has shown that it can be an effective way of pre-training a large network in an unsupervised way, before either fine tuning using backpropogation (significantly reducing that task) or by supervised learning. I am just doing some investigation into that area and trying to reproduce some of the results that i have seen in the area of unsupervised feature extraction and i thought that there should be some link between the features a network is able to extract, and those it can reconstruct. $\endgroup$ – guskenny83 Aug 18 '14 at 3:33
  • $\begingroup$ ..but I could be wrong $\endgroup$ – guskenny83 Aug 18 '14 at 3:52
  • 1
    $\begingroup$ @D.W., he's trying to train an autoencoding network, not a classifier. The goal is to learn a lower dimensional representation of the input data that can be reconstructed with as little error as possible. $\endgroup$ – deong Aug 29 '14 at 10:36
  • 1
    $\begingroup$ Assuming you have enough hidden units to learn a better representation, then the problem looks like it's that your GA is just converging prematurely. You could try larger populations, more aggressive search operators, restarts, etc. There are a bunch of techniques to try and deal with this, but it really depends on exactly what the current algorithm is and what it's doing. For instance, if you're using fitness proportional ("roulette wheel") selection, switch to tournament selection. Increase the mutation rate. But again, it's hard to make blind recommendations without seeing your algorithm. $\endgroup$ – deong Aug 31 '14 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.