views:

968

answers:

8

Is there a rule of thumb or set of examples to determine when to use Genetic Algorithms versus when to use Neural Networks to solve a problem?

I know there are cases in which you can have both methods mixed, but I am looking for a high level reasoning between the two methods.

+2  A: 

GAs generate new patterns in a structure that you define

NNs classify/recognize existing patterns based on training that you provide

GAs perform well at efficiently searching a large state-space of solutions, and converging on one or more good solutions, but not necessarily the 'best' solution

NNs can learn to recognize patterns (via training), but it is notoriously difficult to figure out what they have learned, i.e. to extract the knowledge from them once trained, and reuse the knowledge in some other (non-NN)

Steven A. Lowe
can't really figure out why this was downvoted...
Steven A. Lowe
+4  A: 

There are many similarities between them, so I will only try to outline their differences.

Neural networks

Are able to analyze online patterns (those that change over time). Generally this is a time varying sample that needs to be matched and predicted.

Examples: Graph extrapolation. Facial recognition.

Genetic algorithms

Used when you can code attributes that you think may contribute to a specific, non-changing problem. The emphasis is on being able to code these attributes (sometimes you know what they are) and that the problem is to a large degree unchanging (otherwise evolutions don't converge).

Examples: Scheduling airplanes/shipping. Timetables. Finding the best characteristics for a simple agent in an artificial environment. Rendering an approximation of a picture with random polygons.

Unknown
+25  A: 

From wikipedia:

A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems.

and:

Neural networks are non-linear statistical data modeling tools. They can be used to model complex relationships between inputs and outputs or to find patterns in data.

If you have a problem where you can quantify the worth of a solution, a genetic algorithm can perform a directed search of the solution space. (E.g. find the shortest route between two points)

When you have a number of items in different classes, a neural network can "learn" to classify items it has not "seen" before. (E.g. face recognition, voice recognition)

Execution times must also be considered. A genetic algorithm takes a long time to find an acceptable solution. A neural network takes a long time to "learn", but then it can almost instantly classify new inputs.

Dawie Strauss
+5  A: 

A genetic algorithm, despite its sexy name, is for most purposes just an optimisation technique. It primarily boils down to you having a number of variables and wanting to find the best combination of values for these variables. It just borrows techniques from natural evolution to get there.

Neural networks are useful for recognising patterns. They follow a simplistic model of the brain, and by changing a number of weights between them, attempt to predict outputs based on inputs.

They are two fundamentally different entities but sometimes the problems they are capable of solving overlap.

zenna
.."just an optimization technique".. That is it?
Amit
'just an optimisation technique' was not intended to belittle the power of optimisation. The point was to show that GAs perform the same function as many other optimisation techniques such as hill-climbing.
zenna
+2  A: 
LumpN
A: 

In fact, you can use Genetic Algorithms as an alternative to the Backpropagation algorithm to update weights in Neural Nets. For an example of this refer to:
http://www.ai-junkie.com/ann/evolved/nnt1.html

Amro
And also NEAT (http://www.cs.ucf.edu/~kstanley/neat.html). With a C# Implementation at (http://sharpneat.sourceforge.net)
locster
+4  A: 

You are comparing two totally different things here.

Neural Networks are used for regression/classification - given a set of (x, y) examples, you want regress the unknown y for some given x.

Genetic algorithms are an optimization technique. Given a function f(x), you want to determine the x which minimizes/maximizes f(x).

bayer
Indeed. They are really 'orthogonal' techniques. You can use a GA to find neural net weights and/or architecture.
locster
+1  A: 

What is your data? What are its properties? What are you interested in finding out from the data?

Neural networks (NN) fall into the category of Supervised Models. That is, your data will be a set of rows, where each row contains an input and a corresponding output for that input. Your NN learns by seeing the difference between the correct output and one it predicted, and then adjusting its parameters. So you can't use NN if you don't have input-ouput data (generally speaking).

Genetic algorithms (GA) are basically optimizers. Here you will have some set of parameters that you want to optimize for something. You will need an evaluation function that takes these parameters and tells you how good these parameters are. So you keep changing these parameters somehow until you get an acceptable value from your evaluation function, or until you see that things are not improving any more.

To wrap up, if you have data that is suitable for supervising a model, then you can use a NN. If you want to optimize some parameters, then use a GA. But most importantly, it is the nature of your data and what you want out of it that should decide what model to use.

tilish