User:Mim.cis/sandbox/Derivation-of-Variational-Derivatives

= Registering and Matching Information Across Coordiate Systems in CA via Variations = In CA the geodesics and their coordinates are generated by solving inexact matching problems calculating the geodesic flows of diffeomorphisms from their start point onto targets. Inexact matching has been examined in many cases and have come to be called Large Deformation Diffeomorphic Metric Mapping (LDDMM) originally solved for landmarks with correspondence  and for dense image matching. These methods have been extended to landmarks without registration via measure matching, curves, surfaces, dense vector and tensor imagery, and varifolds removing orientation. The objects being matched are generally modelled as noisey versions (see below Bayesian statistical modelling section) of the shapes and forms $$m \in \mathcal{M}$$. The geodesic position and geodesic coordinates associated to Log and Exp are solved as variational problems solving inexact matching of the coordinate systems using classical methods in optimal control.

Matching of coordinates results from introducing an endpoint condition $$E: \phi \rightarrow R^+$$ which measures the correspondence or registration of elements in the orbit under coordinate system transformation.

Control Problem 1 (Euler Equation with Endpoint Condition):


 * $$ \min_{\phi: \dot \phi = v \circ \phi, \phi_0=id} C(\phi) \doteq \frac{1}{2} \int

(A(\dot \phi_t \circ \phi_t^{-1})|\dot \phi_t \circ \phi_t^{-1})dt +E( \phi_1 \cdot q_0) $$

The necessary conditions for a minimizer of 1 satisfies $$ \frac{d}{d \epsilon} C(\phi^\epsilon)|_{\epsilon=0}=0 $$, for perturbation $$\phi^\epsilon \doteq \phi + \epsilon \delta \phi \circ \phi$$, with fixed initial condition, $$\phi_0 \cdot q_0 = q_0$$,$$ \delta \phi_0=0 $$, with free endpoint. This gives the Euler equation interior to $$t \in [0,1)$$, with a boundary condition at $$t=1$$ where the target enters. Integrating by parts $$ \delta v_t = \frac{d \delta \phi_t}{d t}  - ((Dv) \delta \phi-(D\delta \phi) v) $$ gives

\begin{cases} &\frac{d}{d t} Av_t+ad_{v_t}^*(Av_t) \, \ \ t \in [0,1) ; \\ &Av_1 + \frac{\partial E(\phi_1)}{\partial \phi_1}=0 \, , \ \ t = 1 \ . \end{cases} $$

Dense image matching

 * Dense image matching illustrates one of the two extremes of $$

Av \in V^* $$, the momentum having a vector density pointwise function, so that $$ (Av|w) = \int_X \mu \cdot w dx $$ for $$ \mu $$ a vector function. For dense images the action $$\phi \cdot I \doteq I \circ \phi^{-1}$$ implies we will requires the variation of the inverse $$\phi^{-1}$$ with respect to $$\phi$$ for the chain rule calculation $$ \frac{\partial E(\phi)}{\partial \phi^{-1}}\frac{\partial \phi^{-1}}{\partial \phi} $$. This requires the identity  $$\delta \phi^{-1} =-(D \phi_1)_{|_{\phi_1^{-1}}}^{-1} \delta \phi$$ following from the identity $$(\phi + \epsilon \delta \phi \circ \phi)\circ (\phi^{-1} + \epsilon \delta \phi^{-1}) = id + o(\epsilon)$$. This is for such function spaces the generalization of the classic matrix perturbation of the inverse.
 * The optimizer of Control Problem 1 satisfies the Euler equation with boundary condition at time t=1:

$$ \min_{\phi: \dot \phi = v \circ \phi, \phi_0=id} C(\phi) \doteq \frac{1}{2} \int \|\dot \phi_t \circ \phi_t^{-1}\|^2_Vdt +\frac{1}{2} \int_X | I\circ \phi^{-1}-J|^2dx $$

\begin{cases} & \text{Necessary condition:} \ \ \ \ \ \ \ \ \ \ \ \  \  Av_1 =\mu_1 dx, \mu_1 =(I\circ \phi_1^{-1}-J ) \nabla (I \circ \phi_1^{-1})  \, \  ,\\

&\text{Conservation equation:} \ \ \ \ \ \ \ Av_t =\mu_t \, dx, \ \mu_t = (D \phi_t^{-1})^T \mu_0 \circ \phi_t^{-1}|D \phi_t^{-1}|, \ \mu_0=(I - J \circ \phi_1) \nabla I |D \phi_1|   =0. \\ \end{cases} $$.

Landmark matching with correspondence
Landmark matching demonstrates the singularity of $$ Av \in V^* $$ as a generalized function or delta-distribution, since for landmarks,$$q_0 \doteq \{ x_1,x_2,\dots \}$$ all of boundary mass is conscentrated on singular subsets of the volume space. The optimizer of Control Problem 1 satisfies the weak Euler equation for delta-distributions: $$ \min_{\phi: \dot \phi = v \circ \phi, \phi_0=id} C(\phi) \doteq \frac{1}{2} \int \|\dot \phi_t \circ \phi_t^{-1}\|^2_Vdt +\frac{1}{2} \sum_i \| \phi_1(x_i) - y_i \|^2  $$

\begin{cases} & \text{Necessary condition:} \ \ \ \ \ \ \ \ \ \ \ \  \ Av_1= \sum_{i=1}^n p_1(i)\delta_{\phi_1(x_i)}, p_1(i)=(y_i-\phi_1(x_i))  ,\\ &\text{Conservation equation:} \ \ \ \ \ \ \  Av_t = \sum_{i=1}^n p_t(i)\delta_{\phi_t(x_i)}, p_t(i) = (D\phi_{t1})_{|\phi_t(x_i)}^T p_1(i)\ , \phi_{t1} \doteq \phi_1 \circ \phi_t^{-1} \\ \end{cases} $$
 * Notice this gives in particular the initial condition $$Av_0 = \sum_{i=1}^n p_0(i)\delta_{x_i}, p_0(i) = (D \phi_1)_{|x_i}^T (y_i-\phi(x_i))$$.

Taking $$Av_t =\sum_{i=1}^n p_t(i) \delta_{\phi_t(x_i)}$$; conservation $$ (Av_t|(D \phi_t w)_{|\phi_t^{-1}}) = const. $$, $$\sum_{i=1}^n (D \phi_t)_{x_i}^T p_t(i) \cdot w(x_i) =\sum_{i=1}^n (D \phi_1)_{x_i}^T p_1(i) \cdot w(x_i)$$

. $$p_t(i) = ((D \phi_t)_{|x_i}^{-1})^T(D \phi_1)_{x_i}^T p_1(i)$$.

LDDMM for image and landmark matching: perturbation in the vector fields
The original large deformation diffeomorphic metric mapping (LDDMM) algorithms took variations with respect to the vector field parameterization of the group, since $$ v \doteq \dot \phi \circ \phi^{-1} $$ are in a vector spaces. Variations satisfy the necessary optimality conditions..
 * Beg solved the Control Problem for dense image matching maximizing with respect to the velocity field; as did Joshi for Landmark matching.

$$ \min_{v:\phi_1=\int_0^1 v_t \circ \phi_t dt} C(v) \doteq \frac{1}{2} \int \|v_t\|^2_V \, dt +\frac{1}{2} \| I \circ \phi_1^{-1} -J \|^2 $$

necessary conditions become      $$ Av_t = (I \circ \phi_t^{-1} -J \circ \phi_{t1} ) \nabla(I \circ \phi_t^{-1}) | D\phi_{t1}|dx $$ where  $$\phi_{t1} \doteq \phi_1 \circ \phi_t^{-1}$$. $$ \min_{v:\phi_1=\int_0^1 v_t \circ \phi_t dt} C(v) \doteq \frac{1}{2} \int \|v_t\|^2_Vdt +\frac{1}{2} \sum_i \| \phi_1(x_i)-y_i \|^2 $$;
 * Joshi solved the landmark matching problem taking variations with respect ot the vector field:

necessary conditions become      $$Av_t = \sum_i  (D \phi_{t1})^T|_{\phi_t(x_i)} (y_i-\phi_1(x_i))\delta_{\phi_t(x_i)}$$.

The perturbation in the vector field requires the identity $$\frac{d }{d t} \delta \phi_{|\phi} = (Dv)_{| \phi} \delta \phi_{| \phi} + \delta v_{| \phi}$$ which implies $$ (\delta \phi_1)_{|{\phi_1}} = (D \phi_1) \int_0^1 (D \phi_t)^{-1} \delta v_t \circ \phi_t dt $$ Take the variation in the vector fields $$v+\epsilon \delta v$$ using the chain rule $$ \frac{\partial E(\phi_1)}{\partial v}=\frac{\partial E(\phi_1)}{\partial \phi^{-1}}\frac{\partial \phi_1^{-1}}{\partial \phi} \frac{\partial \phi_1}{\partial v} $$ which gives the first variation
 * $$ \frac{\partial E}{\partial v} =(I \circ \phi_1^{-1} -J) \nabla I|_{\phi_1^{-1}} (- D \phi_1)_{|\phi_1^{-1}}^{-1}(D \phi_1)_{|\phi_1^{-1}}) \int_0^1 (D \phi_t)_{|\phi_1^{-1}}^{-1} (\delta v_t)_{|{\phi_t \circ \phi_1^{-1}}} dt

$$.
 * Joshi solved the landmark matching problem optimizing with respect to the velocity field:


 * $$ \frac{\partial E}{\partial v} =\sum_i (\phi_1(x_i) - y_i) \cdot D \phi_1 |_{\phi_1^{-1}(\phi_1(x_i))} \int_0^1 (D \phi_t)_{|\phi_1^{-1}(\phi_1(x_i))}^{-1} \delta v_t |_{\phi_t \circ \phi_1^{-1} (\phi_1(x_i))} dt

$$


 * $$ \frac{\partial E}{\partial v} =\int_0^1 \int_X \sum_i \delta_{\phi_t(x_i)}(x) (\phi_1(x_i) - y_i) \cdot (D \phi_1)_{\phi_t^{-1} (x)}(D \phi_t)_{\phi_t^{-1}(x)}^{-1} \delta v_t (x) dx dt

=\int_0^1 \int_X \sum_i \delta_{\phi_t(x_i)}(y) (D \phi_{t1})_{\phi_t(x_i)}^T (\phi_1(x_i) - y_i) \cdot \delta v_t (x) dx dt $$