【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?

No. Content
1 【ShapeWorks】1. 软件介绍及安装
2 【ShapeWorks】2. 工作流的三板斧 - How to Groom Your Dataset?
3 【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?
4 【ShapeWorks】4. 工作流的三板斧 - How to Analyze Your Shape Model?
5 【ShapeWorks】5. 典型例子 Ellipsoid 的运行及解析

文章目录

  • 1. Particle-based Shape Modeling
  • 2. Particle-based Representation
  • 3. Shape vs. Configuration Spaces
  • 4. World vs. Local Coordinates
  • 5. Optimization Cost Function
  • 6. Particles Initialization & Optimization
  • 7. On Algorithmic Parameters
    • 1. Correspondence Relative Weighting
    • 2. Shape Statistics in Initialization and Optimization Steps
    • 3. Starting and Ending Regularization
  • 8. Optimizing Correspondences
  • 9. Parameter Tuning
    • 1. General Process
    • 2. Qualitative Assessment
    • 3. Tips and Tricks
  • 10. Correspondences on New Samples
  • 11. XML Parameter File
  • 12. Parameter Dictionary in Python
  • 13. Project Excel File
    • 1. Python API for Generation
    • 2. Project Sheet
  • Ref

1. Particle-based Shape Modeling

ShapeWorks constructs statistically optimal anatomical mapping across different shape samples by automatically computing a dense set of corresponding landmark positions that are geometrically consistent on a set of anatomy segmentations or surface meshes and does not rely on any specific surface parameterization.

ShapeWorks uses a set of interacting particle systems, one for each shape, to produce optimal sets of surface correspondences in an ensemble. Particles interact with one another via mutually repelling forces to cover optimally and, therefore, describe surface geometry. Particles are positioned on surfaces automatically by optimizing the model’s information content via an entropy optimization scheme.

ShapeWorks optimizes landmark positions to minimize the overall information content of the model (first term) while maintaining a good sampling of surface geometry (second term).

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第1张图片


2. Particle-based Representation

More formally, consider a cohort of shapes S = { z 1 , z 2 , ⋯   , z N } \red{S} = \{ z_1, z_2, \cdots, z_N \} S={z1,z2,,zN} of N N N surfaces, each with its own set of M M M corresponding particles z n = [ z n 1 , z n 2 , ⋯   , z n M ] ∈ R d M z_n = [z_n^1, z_n^2, \cdots, z_n^M] \in \R^{dM} zn=[zn1,zn2,,znM]RdM where each particle z n m ∈ R d z_n^m \in \R^d znmRd lives in a d − d- ddimensional Cartesian space (typically d = 3 d=3 d=3 for anatomies), and whose ordering implies correspondence among shapes. Each of the particles is called a correspondence point, and is constrained to lie on the shape’s surface. Collectively, the set of M M M particles is known as the configuration.


3. Shape vs. Configuration Spaces

This particle-based representation incorporates two types of random variables: a shape space variable Z ∈ R d M \red{Z} \in \R^{dM} ZRdM and a particle position variable X ∈ R d \red{X} \in \R^{d} XRd that encodes the distribution of particles on the n − n- nth shape (configuration space). This particle-based representation avoids many of the problems inherent in parametric representations such as the limitation to specific topologies, processing steps necessary to construct parameterizations, anb bias toward model initialization.

4. World vs. Local Coordinates

For groupwise modeling, shapes in the shape space should share the same world coordinate system. Hence, we use generalized Procrustes alignment to estimate a rigid transformation matrix T n T_n Tn that can transform the particles in the n − n- nth shape local coordinate x n m x_n^m xnm in the configuration space to the world common coordinate z n m z_n^m znm in the shape space such that z n m = T n x n m z_n^m = T_n x_n^m znm=Tnxnm.

5. Optimization Cost Function

Correspondences are established by minimizing a combined shape correspondence and surface sampling cost function Q = α H ( Z ) − ∑ n = 1 N H ( X n ) \red{Q} = \alpha H(Z) - \sum_{n=1}^{N} H(X_n) Q=αH(Z)n=1NH(Xn), where H \red{H} H is an entropy estimation of the shape distribution in the shape space, and α \red{\alpha} α is the relative weighting of the correspondence term.

In particular, ShapeWorks explicitly models the inherent trade-off between
the statistical simplicity of the model (i.e., compactness or lowest entropy) in the shape space (i.e., inter-surface) and
the accuracy of the shape representations (i.e., good surface samplings or highest entropy) in the configuration space (i.e., intra-surface).
The cost function Q \red{Q} Q is minimized using gradient descent with an adaptive time step.

Because correspondence points (or particles) in this formulation are not tied to a specific surface parameterization, the method operates directly on both volumetric data and triangular surface meshes. It can also be easily extended to arbitrary shapes, even nonmanifold surfaces.

6. Particles Initialization & Optimization

ShapeWorks entails a nonconvex optimization problem. Hence, it is not practical to perform the optimization of the configuration space (intra-surface) and the shape space (inter-surface) with a full set of correspondence points (or particles) in one step.

We address this using a coarse-to-fine optimization scheme to speed up convergence to an acceptable local minimum. In particular, the optimization is performed as a multi-step process where particles are added via spitting each particle to produce a new, nearby particle at each step until the desired number of particles is reached.

ShapeWorks uses a particle splitting strategy, in which the full set of particles is optimized in a multi-scale (i.e., coarse-to-fine) fashion.

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第2张图片

The URL of the image is: https://sci.utah.edu/~shapeworks/doc-resources/mp4s/studio_ellipsoid_optimize.mp4

For these steps, the optimization of the configuration space (intra-surface) and the shape space (inter-surface) is weighted to downplay the effect of the correspondence term (default α = 0.05 \alpha = 0.05 α=0.05), which results in an evenly spaced distribution of particles on each surface. These steps are collectively called the initialization steps.

At each scale, the initialization step is followed by an optimization step. For this step, the optimization of the configuration space (intra-surface) and the shape space (inter-surface) are weighted (equally or sometimes using α > 1 \alpha > 1 α>1 to emphasize the correspondence term).

Thus, the initialization proceeds simultaneously with the optimization in a multi-scale fashion, generating progressively more detailed correspondence models with each split.

For both, the initialization and optimization steps, the weighting to the shape space may be set by the user. Further, as each step of the optimization is an iterative process, the number of iterations may be set by the user.

At each scale, the number of iterations could impact the quality of the optimized model.

https://sci.utah.edu/~shapeworks/doc-resources/mp4s/studio_torus_optimize.mp4

The first particle: The particle system is initialized with a single particle on each shape. The first particle is found by raster-scanning the signed distance map and finding the first zero crossing. The particle system can also be initialized using user-defined sparse corresponding landmarks across all shapes.

7. On Algorithmic Parameters

Optimizing the shape models entails several algorithmic parameters. Below, we highlight the most important ones that might need tuning depending on the dataset at hand.

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第3张图片

1. Correspondence Relative Weighting

One difference between initialization and optimization steps is how important the correspondence (inter-surface) objective is compared to the surface sampling (intra-surface) term using a relative weighting factor for the correspondence term (i.e., α \alpha α in Q Q Q). Hence initial_relative_weighting is the weight (or α \alpha α) used in initialization steps and the relative_weighting is the weight (or α \alpha α) used for optimization steps.

  • initial_relative_weighting is the weight (or α \alpha α) used in initialization steps
  • relative_weighting is the weight (or α \alpha α) used for optimization steps

Typically initial_relative_weighting is selected to be small (in the order of 0.01) to enable particles to be uniformly disrtibuted (i.e., evenly spaced) over each shape, and hence optimization starts with a good surface sampling.

It can e noted that by allowing correspondence to dominate the optimization process (using higher relative weighting), particles tend to be distributed in regions with relatively small variability across the given population. As the relative weighting tends to infinity, particles will be cluttered in one spot on each surface, which means that all shapes will be represented as a point at the shape space origin. Also, using lower relative weighting, i.e., allowing surface sampling to dominate the optimization process, results in particles becoming out-of-correspondence.

As we increase the relative_weighting, i.e., the correspondence term weight, particles tend to be distributed over surface regions that have less variability across shape samples; hence the shape distribution in the shape space tends to collapse to a single point (i.e., shape).

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第4张图片

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第5张图片

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第6张图片

2. Shape Statistics in Initialization and Optimization Steps

At earlier scales, we do not have enough particles to describe the geometry of each surfaces. Hence, to quantify the notion of correspondence (inter-surface), we use mean energy (i.e., pushing all shapes in the shape space to the mean shape or, in other words, the covariance marix is ssumed to be identity).

As more particles are added to the correspondence model, we use the entropy of the distribution of the shapes (assumed to be Gaussian distributed), where we have more particles that can reveal the covariance structure of the shape space.

This behavior is controlled by the use_shape_statistics_after parameter, which specifies the number of particles, after which shape statistics can be used in the initialization and optimization steps.

Using shape statistics (i.e., covariance structure) results in a better correspondence over iterations, below we use use_shape_statistics_after after 1024 particles.

https://sci.utah.edu/~shapeworks/doc-resources/mp4s/femur_mesh_live.mp4

3. Starting and Ending Regularization

Particle movement during optimization (due to the correspondence term) entails computing the covariance matrix’s inverse. We regularize the covariance matrix to handle degenerate covariances.

starting_regularization and ending_regularization parameters determine the covariance matrix’s regularization for the shape-space entropy estimation. This regularization exponentially decays along with optimization iterations where better covariance structure can be estimated with a better correspondence model.

  • starting_regularization and ending_regularization parameters determine the covariance matrix’s regularization for the shape-space entropy estimation.

Higher regularization values would undermine the ensemble’s underlying covariance structure and favors all shapes to converge to the mean shape. Hence, it is recommended to use starting regularization value as ~5% of the covariance matrix’s expected highest eigenvalue while ending regularization can be taken as ten times less than the starting value.

This regularization can be considered as having a Gaussian ball in the shape space. Starting regularization pushes all samples to the mean and hides the underlying “unoptimized” covariance structure. Ending regularization should be small enough to reveal the optimized covariance structure.

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第7张图片

8. Optimizing Correspondences

You can use either ShapWorks Studio or shapeworks optimize or shapeworks optimize command to optimize your shape model. Both use a set of algorithmic parameters to control the optimization process.

9. Parameter Tuning

1. General Process

【ShapeWorks】3. 工作流的三板斧 - How to Optimize Your Shape Model?_第8张图片

The general process for parameter tuning is to :

  1. Select a subsample of data to tune on.
  2. Start with default parameters and a small number of particles.
  3. Tune parameters one at a time unitl particles are evenly spread over the entire geometry and in good correspondence.
  4. Optimize on the entire cohort with the best set of hyper-parameters and number of particles to get the final shape model.

2. Qualitative Assessment

To assess the quality of an optimized shape model, consider the following:

  • Are the particles evenly spaced, covering the entire geometry of each sample?
  • Are the particles in good correspondence across the samples? This can be assessed by inspecting the neighboring correspondences of particles (in Studio hover over a particle and press 1 to visualize).
  • Dose the surface reconstruction result in non-anatomical/plausible shapes?
  • Do the shape modes of variation (PCA) reflect meaningful and are they smooth variations? All particles should move at similar velocities and along similar trajectories to their neighbors.

3. Tips and Tricks

10. Correspondences on New Samples

11. XML Parameter File

12. Parameter Dictionary in Python

13. Project Excel File

1. Python API for Generation

2. Project Sheet

Ref

  1. How to Optimize Your Shape Model?

你可能感兴趣的:(java,人工智能,python)