E*_{snake} = ∫ E_{snake}(v(s))ds = ∫ E_{int}(v(s))ds + ∫ E_{ext}(v(s))ds

where EThe internal energy of a snake seeks to preserve the continuity and curvature through the evolution process. Thus, the internal energy can be defined as:

E_{int}
= E_{cont} + E_{curv}

Each of the above energies can be computed in terms of the contour
points defined by v(s). The continuity can be quantified as the rate of
change of the contour points, whereas smoothness is the change in
curvature, and can be measured as the rate of change of the tangent
vectors along the contour. These energies are therefore given by the
first and second derivatives of the contour v(s).The external forces mostly depend on the application. For image segmentation, we want the deformable contour to find a particular feature within an image. Typically, features have well defined edges, and we wish to evolve the snake to match these edges. Thus, the external energy influencing the evolution of the snake must be related to this feature ! The most relevant and obvious measure of edges in an image is the gradient magnitude, and this is precisely what is used to denote the external energy. Mathematically,

E_{ext}
= -|| I ||

Since we wish to minimize both internal and external energies, we
construct the external energy to equal the negative of the gradient
magnitude.Variational calculus can be used to formulate a solution to minimize E

We model the contour as c = {p

Each of the energies related to the snake can be defined using discrete differences (as shown in class). The continuity energy can be defined in terms of the distance between points along the snake, as compared to the average distance between neighboring points. Thus, this term will seek to keep points along the snake as close together as possible.

The curvature energy is nothing but the second derivative at each point along the snake. Finally, each of these energies are normalized by division with the largest value in any given neighborhood.

As discussed earlier, the external energy is nothing but the negative gradient magnitude. However, a pre-processing step is required prior to computing the image gradient. Gaussian blurring is applied as a pre-processing step. This ensures a greater range for the deformable snake to latch onto image contours. Normalizing the gradient magnitude can lead to detection of spurious or weak edges and should be avoided. The influence of the external energy term can instead be controlled by the constant γ related to it.

We try to automate the initialization process by using geometric
primitives such as a circle and an ellipse as initial contours. As we
can see in the first and second rows of the figure above, this approach
does not converge very well ! In fact, the final contour due to the
second initialization actually loops on itself !! The constants also
play a major part in the eovlution, but this effect is not biased due
to those values since they are the same for all three results displayed
below.

One the other hand, user-defined contours
result in much better segmentation. Thr third row displays the result
of a meticulously initialized snake with a dense collection of points
whereas the fourth row has a sparsely populated initialization and yet
generates a decent segmentation. This does not imply that the results
are invariant to the number of points on the initial contour. It is
important to note that the granularity of the feature governs the
required number of points on the initial snake. In the last row of the
figure below, the user-initialized snake has lesser number of points on
the outer curve of the U, but has a dense population of points near the
concave section. This sensitivity is important to generate good results
using deformable snakes.

From the above figure, we can conclude that the deformable snake algorithm is highly sensitive to initialization of the snake. One also needs to understand the granularity of the feature being segmented while deciding on the number of points and their distribution in the initialization process.

Synthetic
data: Gradient image after Gaussian blurring (
Note the increasing range for the snake to move)

(l) σ = 0.25 (c) σ = 0.5, (r) σ = 1.0

(l) σ = 0.25 (c) σ = 0.5, (r) σ = 1.0

The amount of blurring determines the size of the region in which the snake can move under the influence of the external forces. As we can see from the images below, blurring with a wider Gaussian kernel enlarges the range of possible locations any point on the snake can move to. While this may be an advantage in most cases, it may turn out to be a flaw in cases where we have overlapping objects, or the discrimination at an edge is poor (e.g. MRI images of brain tissue).

Synthetic
data:
(l) Initial Contour*, (c) Snake Evolution*, (r) Final Contour*

From the above figure, we can also conclude that the deformable snakes algorithm is fairly robust to noise added into this image using the GIMP software. Even though the noise results in spurious edges and holes in the contour, energy minimization only happens in the center and the snake evolves to fit this contour correctly.

In the first row, the initial snake is roughly a user-initialized ellipse which is slightly biased toward the protrusion on the left as compared to the one on the right. The image in the center shows the animation of snake evolution with a relatively high value of β. The final contour on the right shows that the snake has not been able to recede into the right hand corner as well as it did on the left side. This behavior can be attributed to the value of β which governs the smoothness of the snake, and does not allow bending around corners unless the image forces are strong enough to govern the evolution. It must be noted that this experiment was run with a relatively low value of γ because of which the image force was not able to pull the snake into the right hand corner !

The images in the second row are results from a more balanced configuration of β and γ. This balance allows the snake to follow the contour into both corners and achieve a much better segmentation. Of course, the user-initialization of the snake near the desired contour also helps ! In general, it seems preferable to initialize the snake just outside the feature to be segmented and let it work its way on to the contour. Perhaps, this is due to the nature of our discrete implementation as there is really nothing in the theory which implies such a preference.

This experiment also demonstrates the difficulty in segmenting corners. This problem can again be attributed to the inclusion of the curvature constraint, and its accompanying constant β. The inherent trade-off between trying to maintain smoothness and squeezing into a corner results in the snake rounding off at corners as seen in the results above. The remedy would be to possibly make β a function of each point-location along the snake such that as this point approaches a corner the corresponding β becomes lower in value to allow this point to propagate into the corner.

We briefly look at an example of a 2D CT image of the abdomen and
try to use the deformable snake model to segment the lung. In the
figure below, the left image shows the initial contour, the animation
of the snake evolution process can be seen in the middle image and the
final contour of the lung can be seen in the right image. For real
data, it is tricky to get the balance of parameters right. Also,
initializing the contour very close to the feature we wish to segment
is the key.

Real
data:
(l) Initial Contour*, (c) Snake Evolution*, (r) Final Contour*

Unless there is an automated way to propagate the segmented contour onto the next slice (in a 3D scenario) it would be a tedious process to manually initialize the snake in each frame. One method might be to register each frame to the first one (to get rid of motion artifacts, etc.) and then propagate the segmented contour to the corresponding voxels in subsequent slices and optimize the snake further to capture the contour in that slice.