[Insight-users] optimizer

Luis Ibanez luis . ibanez at kitware . com
Tue, 04 Nov 2003 20:46:07 -0500


Hi Bing,

The Conjugate Gradient optimizer converges faster
than a gradient descent in cases where the cost
function has nice (almost ideal) shapes in its
basins.  In practice you need the cost function
to be nicely approximated with a second order
function in order for the Conjugate Gradient to
work at its best.

The image metrics that we usually encounter in
image registration are far from this nice condition.
For example, MutualInformation is so noisy that it is
probably better suited for genetic algorithms than
for gradient descent type of optimizers, much less for
the conjugate gradient.

It doesn't hurt however to give them a try to other
optimizers since they may indeed improve your registration
process. Just keep in mind that it depends a lot on the
characteristics of the image metrics (which is the cost
function to be optimized).

The reason why the VXL wrapped optimizer do not provide
the same interface is that it wasn't practical to duplicate
all their API in the ITK wrappers. It could have been done,
and probably is something that deserves further discussion.

In practice, when you use the VXL wrapped optimizer, you
simply call "get optimizer", and recover a pointer to the
actual vnl optimizer. After that you invoke its normal
methods. For example, for tracking the evolution of the
optimization, you could invoke "set_trace( true )" on
any optimizer deriving from the vnl_nonlinear_minimizer.



To summarize: You are encouraged to try the VXL wrapped
optimizers. Don't expect magic solutions though. The
characteristics of the optimizer should match the nature
of the cost function (image metric in this case).



BTW, when you says that the program crashes after
starting an optimization with the ConjugateGradient
class, could you please give us some details ?
It is possible that an exception is being thrown...
did you attempt to put the StartOptimization() method
inside a try/catch  block



Regards,


    Luis



-----------------------
Bing Jian wrote:
> Hi, Luis,
> 
>   I noticed that almost all of the registration examples
> are using gradientdescent optimizer. I tried to replace
> one by conjugategradient optimizer. To my surprise, there
> is even no GetValue() in ConjugateGradient class. And the
> program crashes soon after startOptimization is called
> while GradientDescent works fine. I heard that CG converges
> much faster than GradientDescent in some cases. Since in
> ITK's software guide onle very little about optimization
> techniques is mentioned, I am wondering if those other optimizer
> classes in ITKNumerics are still in developing stage? Or is
> it recommended to use optimizer functions in vnl/vxl directly?
> 
>   Thanks!
>