Neural Networks

This Neural Networks library is written in C#. (Download)

In this version, only the multi-layers perceptron is available and two learning algorithms are implemented:

  • the gradian back spreading algorithm,
  • a genetic algorithm.

Several threshold functions:

  • Heaviside,
  • Hyperbolic tangent,
  • Sigmoid,
  • Gaussian.

The Pattern Recognition application is a basic program using my neural networks library that allows to create your network with the topology, the learning function, and the activation function you want and then apply it to learn and recognise.

I'll present here a basic (beginners level) introduction to the use of neural networks for pattern recognition using my application.

The main frame of the application:

Pattern Recognition main frame

Click on new to create a new network. You'll be able to save it before, during or after learning; and so to load it later.

The new network frame:

New network frame

Going on type->setup will let you create your topology (here 10-5-3-1). The topolgy is then displayed on the drawing window.

You can choose:

  1. the size of  your sample images,
  2. the random bounds of your initial weights,
  3. the value for matching and the one for not matching,
  4. the activation function (you can setup its parameters),
  5. the learning algorithm (you can setup its parameters too).

There is for the moment only one type of layers, which gives a multi-layers perceptron.

Now we can say "Ok" and go to the learning and recognition panel.

We'll use these exemples:

Matching Matching test 1 Matching test 2 Matching test 3
Matching test 4 Matching test 5
Not Matching Not  matching test 1 Not  matching test 2 Not  matching test 3 Not  matching test 4 Not  matching test 5

The objective is to learn these examples above, and then to present the two images below:

Expected to match: Expected to match
Expected not to match: Expected not to match

Of course, this is a very basic set of samples as the two sets are easy to split, and the not matching set should have a lot of other very diffrent samples. So, the learning is quite fast and easy, but it's just an example.

Initially, before learning, the network reacts randomly, depending on the initial weights. Here:

Initial state

Now we'll make the network learn:

Learning network

I just loaded the matching and not matching tests 1 to 5. We can see in the error window that the error is going down. We make the network learn until the error is the nearest possible to zero.

Matching exmaple

We learnt 2600 times, the error is the smallest possible, and we can now observe that the network recognised the unknown image as a matching example (96% matching).

Not matching example

Here, the other unknown image, supposed not to match is indeed rejected (5% matching).

This page presented a common application (pattern recognition) with a simple example. The application can however be used for much more.

Neural networks have loads of interesting applications. If you want to test neural networks possibilities in your own applications without writing your library, mine is here for that.


Downloads

  • Pattern Recognition binary with Neural Networks library: here.
  • Neural Networks source code: here.
  • Pattern Recognition application source code: here.