[Insight-users] Gradient Descent?

motes motes mort.motes at gmail.com
Tue Jun 30 18:21:19 EDT 2009


Thank you very much for the info and the literature recommendations which I
will look into! Regarding your question:

         What kind of image analysis problem
         are you trying to solve ?

I tried the first very basic translation image registration example from the
ITK example folder. I understand the overall idea of the process but how the
final transform parameters are estimated is still something I would like to
understand completely.

Therefore my idea was to make a basic step-by-step example where I for 2-3
iterations compute the cost function and the gradient by hand to see how the
alignment is gradually improved.

As you described its the ImageMetric/cost function which we are trying to
optimize (minimize) based on a "guessed" set of transform parameters.

We now try to improve our next guess by taking the gradient of the
ImageMetric. In this step it could be nice if it was possible to see the
candidates (if such exists) and how they are choosen and what the resulting
transform parameters are.

Its this kind of test example that I am currently trying to create and I am
sure the references you provided will get me in the right direction :-)





On Tue, Jun 30, 2009 at 11:58 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

>
> Hi Motes,
>
>
>                  Thanks for the clarification.
>
>
> This explains the confusion.
>
> The ITK Optimizer are commonly used for Image Registration.
>
> When used in that context they are not looking for extrema
> in the values of intensities of the images.    Instead, they
> are looking for extrema in the values of "ImageMetric"
> classes that evaluate the similarity between two given images
>
> Every time that the Optimizer calls "GetValue()" in the
> Cost Function (the ImageMetric) this triggers an evaluation
> in the entire image. (e.g. as you pointed out, for example,
> in the mean square metric, this triggers a computation
> of differences of intensities between all the pixels in the
> fixed image and the corresponding pixels in the moving
> image.).
>
> This is evaluated for a given set of values of the Transform.
>
> So, the point at which the Gradient is computed is in the
> parametric space of the transform, not in the space of
> the image. And the Function whose gradient is computed
> is the CostFunction (the ImageMetric), not the intensities
> of the image.
>
> If you want to learn more about Image Registration  you
> could look at:
>
> a) The "Image Registration" chapter of the ITK Software Guide
>     http://www.itk.org/ItkSoftwareGuide.pdf
>
> http://www.amazon.com/ITK-Software-Guide-2-4/dp/1930934157/ref=pd_bxgy_b_img_c
>
>
> b) The "Image Registration" chapter of the book
>     "Insight into Images"
>
> http://www.amazon.com/Insight-into-Images-Segmentation-Registration/dp/1568812175/ref=pd_bxgy_b_img_b
>
>
> c) The book "Medical Image Registration"
>
> http://www.amazon.com/Medical-Image-Registration-Biomedical-Engineering/dp/0849300649/ref=sr_1_5?ie=UTF8&s=books&qid=1246398949&sr=8-5
>
>
>
> Note that, "Image Registration" is not the only use
> of Gradient Descent methods... so.... we probably
> should go back to the original motivation of your
> question:
>
>
>
>          What kind of image analysis problem
>          are you trying to solve ?
>
>
>
>    Regards,
>
>
>          Luis
>
>
> --------------------------------------------------------------------------
>
> On Tue, Jun 30, 2009 at 5:45 PM, motes motes <mort.motes at gmail.com> wrote:
>
>> Forgot to press reply to all :-)
>>
>>
>> On Tue, Jun 30, 2009 at 11:43 PM, motes motes <mort.motes at gmail.com>wrote:
>>
>>>
>>>
>>> On Tue, Jun 30, 2009 at 11:34 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
>>>
>>>>
>>>> Hi Motes,
>>>>
>>>>
>>>>
>>>>      This is going to be a long conversation...   :-)
>>>>
>>>>
>>>> It seems that you are thinking of the image as the parametric
>>>> space itself.
>>>>
>>>> If you are considering the image intensities to be the values
>>>> of a cost function, and you are assuming that the space of
>>>> image indexes is the parametric space, then,... yes... you
>>>> could perform a walk over this space using a gradient descent
>>>> approach.
>>>>
>>>>
>>>> This is done, for example, as part of the computation of
>>>> Watersheds...
>>>>
>>>>
>>>> Is that what you have in mind ?
>>>>
>>>>
>>>> Are you looking for a method for walking toward extrema
>>>> of intensities in an image ?
>>>>
>>>>
>>>
>>> Well that was actually what I thought the optimization part of ITK was
>>> doing - finding extrema in the image.
>>>
>>> As I understand the cost function could be defined as eg.
>>> sum-of-squared-intensities. In each iteration this function is evaluated and
>>> we choose that "path" which minimizes this cost function.
>>>
>>> But is the cost function evaluated for the whole image or just for a
>>> local region?
>>>
>>> Maybe you can recommend some literature that covers this subject so I
>>> don't waste to much of your time :-) I have bought Digital Image Processing,
>>> Third Edition, Gonzalez et. al, but I could not find anything on gradient
>>> descent or cost functions/optimization.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>
>>>>
>>>>    Luis
>>>>
>>>>
>>>>
>>>> ---------------------
>>>> motes motes wrote:
>>>>
>>>>> Ok it seems I need to find some resources concerning this kind of
>>>>> optimization. But assume that I have a grayscale image when using the
>>>>> gradient descent method are the gradient then calculated for a pixel and the
>>>>> next pixel choosen is the one where the gradient has a negative growth?
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 30, 2009 at 10:26 PM, Luis Ibanez <luis.ibanez at kitware.com<mailto:
>>>>> luis.ibanez at kitware.com>> wrote:
>>>>>
>>>>>
>>>>>    Hi Motes,
>>>>>
>>>>>
>>>>>    The fact that this optimizer is applied to registration
>>>>>    of digital images is irrelevant.
>>>>>
>>>>>
>>>>>    All ITK optimizers are general purpose optimizers.
>>>>>
>>>>>
>>>>>    These Optimizers explore a parametric space looking
>>>>>    for good values of a cost function.
>>>>>
>>>>>    When applied to image registration the Cost function
>>>>>    happens to be an ImageMetric, and the parametric
>>>>>    space happens to be the set of parameters of a
>>>>>    Transform.
>>>>>
>>>>>
>>>>>    The Image Registration chapter of the ITK Software Guide
>>>>>    http://www.itk.org/ItkSoftwareGuide.pdf shows many plots
>>>>>    of the Metric with respect to the optimizer iterations, as
>>>>>    well as many plots of the Transform parameters for multiple
>>>>>    iterations of the optimizer.
>>>>>
>>>>>    Have you seen these figures ?
>>>>>
>>>>>
>>>>>
>>>>>    Could you please clarify what kind of step-by-step
>>>>>    example are you looking for ?
>>>>>
>>>>>
>>>>>
>>>>>    Simply "applying an optimizer to a digital image"
>>>>>    doesn't quite makes sense...
>>>>>
>>>>>
>>>>>
>>>>>    Are you looking for image enhancement filters ?
>>>>>    maybe ?
>>>>>
>>>>>
>>>>>        Please elaborate on the context of your question,
>>>>>
>>>>>
>>>>>              Thanks
>>>>>
>>>>>
>>>>>                    Luis
>>>>>
>>>>>
>>>>>
>>>>>    ----------------------------------------------------------------
>>>>>    On Tue, Jun 30, 2009 at 4:13 PM, motes motes <mort.motes at gmail.com
>>>>>    <mailto:mort.motes at gmail.com>> wrote:
>>>>>
>>>>>        A lot of the examples in the itkSoftwareGuide uses the optimizer
>>>>>        defined in itkRegularStepGradientDescentOptimizer.h.
>>>>>
>>>>>        As I understand this i a gradient descent optimzer. There is not
>>>>>        much details about this method in the guide (I assume its rather
>>>>>        basic)  but it could be very nice to read some examples showing
>>>>>        how this optimizer works for a few iterations.
>>>>>
>>>>>        I have tried googling articles and websites that show how
>>>>>        gradient descent is applied in the context of digital image
>>>>>        processing but cannot seem to find anything. Does anyone on this
>>>>>        mailing list know of any good resources to a step-by-step
>>>>>        example using the gradient descent method on a digital image?
>>>>>
>>>>>        _____________________________________
>>>>>        Powered by www.kitware.com <http://www.kitware.com>
>>>>>
>>>>>        Visit other Kitware open-source projects at
>>>>>        http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>>        Please keep messages on-topic and check the ITK FAQ at:
>>>>>        http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>>        Follow this link to subscribe/unsubscribe:
>>>>>        http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090701/d6497dc2/attachment.htm>


More information about the Insight-users mailing list