[Insight-users] Implementing the Neural Network classes

Johnson, Hans J hans-johnson at uiowa.edu
Thu Apr 26 09:36:19 EDT 2012


Nikhil,

I have never had much luck with the ITK neural network implementation.  After much effort, I ended up moving to using OpenCV.

The read/write capabilities of the ITK neural network are particularly problematic.

Sorry that I can not be more helpful.

Hans

--
Hans J. Johnson, Ph.D.
hans-johnson at uiowa.edu<mailto:hans-johnson at uiowa.edu>
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587

From: Nikhil Chandwadkar <nikhil.chandwadkar at gmail.com<mailto:nikhil.chandwadkar at gmail.com>>
Date: Thursday, April 26, 2012 7:59 AM
To: "insight-users at itk.org<mailto:insight-users at itk.org>" <insight-users at itk.org<mailto:insight-users at itk.org>>
Subject: [Insight-users] Implementing the Neural Network classes

Hi,

I have been trying to use the ITK neural network classes and I'm having problems with both the classes in the Statistics namespace as well as the I/O classes in the itk namespace. All classes in the neural networks module seem to be lacking a good amount of documentation. Going by the fact that, there haven't been any issues at all on the mailing list, I'm assuming that people haven't used them much (or I'm dumb :) ). So, any solutions or guidance is most welcome.

I have tried out two things:

1. Train the network from measurement vectors and target vectors read from a file (a subset of  the available measurement vectors) and simulate the network on the entire set of measurement vectors available immediately using network->GenerateOutput(mv), writing the outputs into another file.

2. Train the network as above in a TrainNetwork() function and using the NeuralNetworkFileWriter class and write a neural network file FileWriter->SetInput(network). Then read the file using the NeuralNetworkFileReader class and simulate the network in a separate SimulateNetwork() function.

Case 1:
I'm using a one hidden layer network, following the example in Modules/Numerics/NeuralNetworks/NNetClassifierTest1.cxx. Just like in the example, I'm reading measurement vectors and target vectors from a file and using a BatchSupervisedTrainingFunction to train the samples. In addition I'm also using the Tan Sigmoid transfer function for the hidden layer and the output layer and ErrorBackPropagationLearningWithMomentum as the learning function. After training the network (And this takes too long. Much longer than Matlab at least) when I generate the output vector, most outputs have the same value, say 0.35467, all to the same precision. There are one or two values that are negative too. I've no idea how to make sense from this. Plus, when the training sample is large, around 3000 measurement vectors, I get all outputs as -1 from the trained network.

Case 2:
On writing the network to a file, reading it and simulating it, I get all output values as -0.414.. always, irrespective of whatever network I've trained (majority of weight values as written in the file are zeroes).

I'm guessing that I'm missing something quite fundamental or there is something wrong with the classes. Have these classes been tested enough? Any help whatsoever is most welcome.

Regards,
Nikhil Chandwadkar,
Indian Institute of Technology Madras,
Chennai,
India


________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120426/2a7c72bd/attachment-0001.htm>


More information about the Insight-users mailing list