[Insight-developers] Classifier woes

Miller, James V (Research) millerjv at crd.ge.com
Fri Oct 21 14:53:56 EDT 2005


John,

Thanks for the explanation.  With the smoothing of the posteriors, I now 
understand why you calculate the vector image.  The sandbox implementation
does not have the spatial smoothing yet, does it?

Jim



-----Original Message-----
From: John Melonakos [mailto:jmelonak at ece.gatech.edu]
Sent: Friday, October 21, 2005 1:53 PM
To: Miller, James V (Research); 'Karthik Krishnan'
Cc: 'Insight-developers (E-mail)'
Subject: RE: [Insight-developers] Classifier woes


Jim,

I believe that the Bayesian Plug-In Classifier does what you are suggesting
here, basically using the MaxRatioDecisionRule to apply Bayes' Rule.

This will not work for me in my application.  If I recall correctly, the
Bayesian Plug-In Classifier jumps from the prior/membership probabilities to
the resulting labelmap without explicitly producing a vector image of the
posterior probabilities.  In my application, I desire to apply a smoothing
filter to those posterior probabilities prior to applying the decision rule.

Therefore, we are in the process of creating the
itkBayesianClassifierImageFilter which will provide the user with the option
to smooth the posteriors prior to executing the decision rule.  The general
flowchart that we (Luis, Karthik, and myself) have designed for this project
can be found in the attached flowchart.png.  Note that when the filter
complete, the user will not be constrained to using uniform priors or
Gaussian distributions.  Any arbitrary vector image of prior probabilities
and vector image of membership probabilities will work as inputs to the
itkBayesianClassifierImageFilter.  The code in the SandBox is about halfway
complete, but we are hoping to have the full flowchart implemented in the
next few months.

Hope this helps.  Let me know if you have any suggestions.

Thanks,

John

----
John Melonakos, ECE PhD Student
Laboratory for Computational Computer Vision
Advisor Dr. Allen Tannenbaum
Georgia Institute of Technology, Atlanta, GA
<lab> 404.385.5062
<cell> 801.885.3024
<email> jmelonak at ece.gatech.edu





-----Original Message-----
From: Miller, James V (Research) [mailto:millerjv at crd.ge.com] 
Sent: Friday, October 21, 2005 1:03 PM
To: Karthik Krishnan
Cc: Insight-developers (E-mail); John Melonakos
Subject: RE: [Insight-developers] Classifier woes

It seems like ImageClassifierBase with a MaxRatioDecisionRule
would be more efficient than the Bayesian filter in the sandbox.

If I understand the code in the sandbox (I just looked briefly at it),
it generates a posteriorPixel image which holds for posterior probabilities
of each pixel for every class.  Then the decision rule is applied 
to this vector image.

ImageClassifierBase runs through each pixel, calculates a vector of 
probabilities for the pixel, and applies the decision rule, then moves
onto the next pixel.  So no vector image of posterior probabilities is 
needed.

The handling of the priors is also not quite what I want.  The
MaxRatioDecisionRule allows the for a single prior per class
to be specified.

Jim


-----Original Message-----
From: Karthik Krishnan [mailto:Karthik.Krishnan at kitware.com]
Sent: Friday, October 21, 2005 12:48 PM
To: Miller, James V (Research)
Cc: Insight-developers (E-mail); John Melonakos
Subject: Re: [Insight-developers] Classifier woes



Miller, James V (Research) wrote:

> I was just experimenting with some pixel classifiers in ITK.
>
> I had a program that I had written a few years ago that built up a 
> decision rule and set it on an ImageClassifierBase and passed that 
> ImageClassifierBase to the MRF filter.  This works fine.
>
> Now I just wanted to run a pixel classifier without running the MRF 
> filter.  So I was looking for a filter that would just run through all
>
> the pixels in an image and apply a decision rule to each pixel.
>
> The first filter I found was BayesianClassifierImageFilter.  This 
> sounded perfect.  However, this filter assumes the membership 
> functions are Gaussian and has no means to set a prior.  The filter 
> takes membership functions as opposed to a decision rule.  Most 
> troubling, however, is that this filter doesn't actuall do anything.  
> The GenerateData() method simply iterates over the input pixels.  It 
> doesn't evaluate anything or set any output pixels.
>
The BayesianClassifierImageFilter was a premature addition to the 
toolkit... The actual class itself is in the NAMIC sandbox. and does 
pretty much what you want.

http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=
%2FBayesianSegmentationModule%2FitkBayesianClassifierImageFilter.txx&rev=0&s
c=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=
%2FBayesianSegmentationModule%2FitkBayesianClassifierImageFilter.h&rev=0&sc=
0

It allows you to set your own membership functions (they are not 
restricted to be Gaussian).
The class assumes a prior image with a uniform distribution, but again 
this is not a requirement. I think John's intention is to allow you to 
specify a prior image, with the default being a uniform one.
The membership functions using information from the prior generate the 
posteriors.

The decision rule is hardcoded to be a maximum decision rule, but it is 
not a requirement (although it generally makes sense, given that you 
want a MAP decision rule).  It could probably be set by the user, 
defaulting to MAP.

John's put in a test for it and the filter seems to classify just fine.

The goal might be to have a very generic BayesianClassifierFilter and 
subclass it for specific needs... ??

Regards
Karthik

> So I looked at ImageClassifierBase.  I was already giving one of these 
> to the MRF filter.  ImageClassifierBase has a GenerateData() method.  
> ImageClassifierBase, however, does not have the standard 
> SetInput()/GetOutput() methods.  Instead, it uses 
> SetInputImage()/GetClassifiedImage().  So it unclear to the user that 
> they could use ImageClassifierBase as an ImageToImageFilter.  Along 
> those line, ImageClassifierBase is not named like an 
> ImageToImageFilter (in particular, it does not end in ImageFilter).
>
> Do we have any ImageToImageFilters that you can give a decision rule 
> to and it will classify each pixel?
>
> *Jim Miller*
> */_____________________________________/*
> /Visualization & Computer Vision
> GE Research
> Bldg. KW, Room C223
> 1 Research Circle, Schenectady NY 12309-1027
>
> _millerjv at research.ge.com <mailto:millerjv at research.ge.com>_/
> /(518) 387-4005, Dial Comm: 8*833-4005/
> /Cell: (518) 505-7065, Fax: (518) 387-6981/
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>  
>


More information about the Insight-developers mailing list