Testing the model flexibility (from an analytical kernel)

133 views
Skip to first unread message

Maia R.

unread,
Oct 7, 2021, 4:40:11 PM10/7/21
to scalismo
Dear community,
Back to 2017, I found this post about the way on how to determine if a model is flexible enough.
=======
"The easiest way to determine whether your model is flexible enough or not is to click a few landmark correpondences between the model and the target in the difficult regions and perform Gaussian Process regression (i.e. compute the mean of the posterior based on these correspondences). 
If your model is able to satisfy these constraints within a reasonable lanmark uncertainty, then it should be flexible enough and your focus should be more on improving the fitting method (different regularization levels and numbers of iterations in the case of gradient based fitting .. or better candidate correspondences in the case of ICP)."
=======
My steps to establish point correspondence are as follow:
1) create a model by means of an analytical kernel (ex: a multiscale kernel) with a reference mesh. This reference and the target meshes have already some common anatomical landmarks.
2) compute a posterior model with the training data (i.e. corresponding landmarks between the reference mesh and the target mesh) by:
posteriorModel = model.posterior(regressionData, noiseVariance)

My question is how to use the mean, i.e. posterior.mean (without iteration) to test this flexibility as explained in this previous old post ;-). In my case, maybe the landmarks are not enough to get a good registration as I got low quality registration in some regions (green is the mean mesh from posteriorPDM.mean and magenta is the target mesh).

image.png

Thank you for all help,
Best regards
Maia


Marcel Luethi

unread,
Oct 8, 2021, 1:05:39 PM10/8/21
to Maia R., scalismo
Dear Maia

This method should only bring the clicked landmarks into correspondence and not the other parts of the surface. If already these landmarks are not within a reasonable error margin, then you should increase the flexibility. As I cannot see the landmarks in the image you provided, it is difficult to make a statement about your result.

Best regards
Marcel

--
You received this message because you are subscribed to the Google Groups "scalismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/48a45230-1da3-40ba-ba59-79f4c77a2e5an%40googlegroups.com.

V R

unread,
Oct 8, 2021, 1:25:12 PM10/8/21
to Marcel Luethi, scalismo
Dear Marcel,
Thank you for the response.
As far as I understand, I need to manually select extra corresponding landmarks on the reference mesh (saved as original) and target mesh at problematic regions.
Once I get those landmarks, I compute the posterior gp/model from those regressing data and I can get the mean of this "improved" posterior model.
My question is how can I assess visually (or whatever method) the good correspondence of those landmarks between this mean shape (posteriorPDM.mean) and target mesh since I only have the landmarks from the reference and target meshes ?
Sorry if I missed something ...
Best regards,
Maia

Marcel Luethi

unread,
Oct 8, 2021, 2:07:54 PM10/8/21
to V R, scalismo
HI Maia

The posterior mean is a deformation field defined on the reference. The fitted shape is obtained by warping the reference shape with this deformation field. In the same way, you can use the deformation field to displace the reference landmarks.

This is done automatically in the ui. If you visualize the posterior model using scalismo's show method, it creates a transformation. Any object you show in the same group will be transformed with this transformation. So you only need to visualize the posterior model along with the reference landmarks.

Best regards,
Marcel

Maia R.

unread,
Oct 12, 2021, 4:41:27 PM10/12/21
to scalismo
Dear Marcel,
Thank you for the the advice. 
I manually selected some landmarks, and computed the posterior model and I got this (with some screen shots).
As you can see, some points do not correspond: does that mean that my analytical kernel is not flexile enough ?
Best regards
Maia


Image5.JPG
Image4.JPG
Image3.JPG
Image1.JPG
Image2.JPG

Behzad Vafaeian

unread,
Oct 13, 2021, 1:20:08 AM10/13/21
to Maia R., scalismo
Hi Maria 
This is one of the concerns that I had when using a posterior model. You should note that a posterior model is a regression model established based on given or observed data.  Therefore,  it doesn't have to exactly pass through the observed data (here satisfying the correspondence of the manually given landmarks) unless the model is flexible enough. 
An analogy is passing a line or  higher order polynomials through a set of points in 2d or 3d (this is a linear regression). Obviously, the fitted line or the polynomials do not pass through all the points as they miss some points. However, they would touch more points as the order of the polynomial increases. Increasing the order of a polynomial means making it more flexible. 
I hope this helps.
Marcel, please correct me if I am wrong. 

Best,

Maia R.

unread,
Oct 13, 2021, 7:42:58 AM10/13/21
to scalismo
Dear Behzad,
Your point is a very good one otherwise it wouldn't be a regression.
After creating a more flexible model (from 100 to 400 coefficients), I am able to really improve the model fitting (from Hausdorff distance of 4mm to 1.5mm !). 
Thank you very much,
Best regards,
Maia

Maia R.

unread,
Oct 13, 2021, 4:22:50 PM10/13/21
to scalismo
Dear Marcel and Behzad,

In fact, I used a model from an analytic multiscale kernel (combine large and local deformations) for point-to-point registration.
When sampling from this model however, I got very weird shapes far from my desired shapes, for example here is one which is supposed to be a distal femur. But when I use this model for registration, I got much better results than when using a less flexible (and maybe more plausible shapes samples) model. I'd like to know if  it is correct for the registration step to use such a very flexible multiscale model ?
Thank you very much,

Best regards
Maia


image.png

Max

unread,
Oct 22, 2021, 11:38:20 AM10/22/21
to scalismo
Hi Maia,

I would agree on the fact that a model intended to be used for registration should be pretty flexible. And, in particular, I guess it is ok if the model produces some unrealistic (but not too "weird") deformations when randomly sampling. This is because you usually apply some form of regularization during registration. For instance, if you penalize the L2 norm of the shape parameter alpha (as in Tutorial 12), you force generated shapes not to be too far away from the mean shape (at which alpha equals zero). If the regularization weight becomes not too small, this prevents unrealistic shapes from being generated and also explains why an extremely flexible model can lead to a good registration.

All in all, however, I would not say that this is always the "correct" way. I think there is a lot of trial and error when choosing the correct kernels and kernel parameters.

Best
Max

V R

unread,
Oct 22, 2021, 12:10:00 PM10/22/21
to Max, scalismo
Thank you very much for your advice.
Does the choice of having a very flexible kernel have an impact on reconstruction ?
I have folded samples with the multiscale kernel.
After building the model (pca model + bias from the registered meshes), I got a folded reconstructed mesh as well ... or maybe it comes from the bias model ?
Best  regards
Maia


Andreas Morel-Forster

unread,
Oct 22, 2021, 4:15:24 PM10/22/21
to scal...@googlegroups.com

Hi Maia

Yes the kernel has some influence on the reconstruction. The reconstuction also depends also on the registration algorithm. Most registration algorithms are iterative algorithms, as the final correspondence can not be determined in a single step. For iterative approaches it makes a difference how you regularize. And to regularize you have two "knobs" to turn: the kernel, and a regularization parameter. So this clearly influences your result.

As said: Samples from you kernel should reflect your prior knowledge what deformations you expect. They might look weired, because the kernel might encode some local smoothness assumptions, but never the full correlation that you expect. Often it is a little bit more flexible than what you would expect from a empirical kernel, which does not harm as you have observed data, when you register.

The key to not get folds are:
- do not use a too flexible kernel.
- if you start far away with the registration, start with strong regularization and only decrease the regularization slowly from time to time.

Best, Andreas

Maia R.

unread,
Oct 26, 2021, 4:22:08 PM10/26/21
to scalismo

Hi  Andreas,
Thank you very much for the advice.
Best regards
Maia
Reply all
Reply to author
Forward
0 new messages