Sunday, 31 May 2009

A neural network on the GPU - Concluded



OK, it's "finished". Here's a summary of the features:

- Two-layer, feed-forward neural network for supervised
land cover/land use classification of multispectral imagery,
fully integrated into ENVI.

- Makes use of the cross entropy cost function and softmax
outputs to model posterior class membership probabilities.

- Trained with the scaled conjugate gradient algorithm,
guaranteed to converge monotonically to a (local) minimum
in the cost function, see the Figure. The algorithm is
described in detail in Appendix B of my book.

- Apart from the number of neurons in the first (hidden) layer,
there are no adjustable parameters whatsoever.

- Uses the R-operator method (Bishop 1995, Neural
Networks for Pattern Recognition
) to evaluate the Hessian
(matrix of second derivatives of the cost function) efficiently.

- All matrix operations are carried out on the GPU using
GPULib IDL bindings to CUDA. CUDA is giving me a speedup
factor of around 3-4 on my system (see earlier blogs)
relative to the CPU version.

- One heck of a lot faster than ENVI's built-in network
classifier. Also much faster that ENVI's support vector machine,
with comparable accuracy.

- You can get the code here.

2 comments:

chris said...

Hi Mort,
do you think that a gpurebin will be included in the next gpulib version?
What do you think about a routine related number of elements threshold to decide either to use native idl or gpu idl? BTW, I'm very impressed by the speed enhancement caused by using gpulib for a large number of elements in which routinew wherever...

Thanks and best regards

Mort Canty said...

Hello Chris,

Can't say, but Tech-X have been very open to suggestions till now. I (and presumably others) asked for and received the LEFTSUBSCRIPT keyord in GPUSUBSCRIPT, a GPUTRANSPOSE and the dimension parameter/keyword in GPUTOTAL and GPUMIN/MAX. The routine-related threshold would be nice, although maybe too hardware-dependent?

Cheers

Mort