33
Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Embed Size (px)

Citation preview

Page 1: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Research Update:Optimal 3TI MPRAGE T1 Mapping

andDifferentiation of Bloch Simulations

Aug 4, 2014Jason Su

Page 2: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Cramér-Rao Lower Bound

A key theorem in estimation theory and statistics.

The Cramér-Rao lower bound (CRLB) provides a lower bound on the variance of any estimator in the presence of noise. It can:• Analyze the effectiveness of parameter mapping methods and protocols• Optimize their design by finding the protocol that minimizes the CRLB and provides

the most precision per unit scan time

However, it has seen limited use in MRI due to the difficulty of analytically deriving the bound for complex signal behavior

Kingsley. Concepts Magn. Reson. 1999;11:243–276.

Page 3: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Theory: A common formulation• A desirable property, the mean of many samples converges to

the true parameter valueUnbiased estimator

• For magnitude images with adequate SNR this holds trueNormally distributed noise

• Separate images in a scan protocol have independent noiseMeasurement noise is uncorrelated

Page 4: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Theory: Fisher Information Matrix

Definition• gi, the signal equation for the ith image• Θ, the set of parameters, e.g. T1 and M0• J, the Jacobian of the scan protocol• Derivatives of the acquired signal equations for

each tissue parameter input• Σ, the noise covariance between the images• This is diagonal with uncorrelated images

Interpretation• J captures the sensitivity of the signal equation

to changes in a parameter• F is the Fisher matrix representing the

information captured by a protocol• Its “invertibility” or conditioning is how

separable parameters are from each other: the specificity of the measurement

• This is can be confounded by nuisance parameters which have little diagnostic value but must be estimated, such as M0

Page 5: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Theory: Cramér-Rao Lower Bound

The variance of an estimate of a parameter, Θi, is no better than the corresponding ith diagonal entry on the inverse of the Fisher information matrix

Page 6: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

The Challenge: Computing the Jacobian

• Has previously limited the application of CRLB• Difficult by hand, inefficient by computer program• Slow with partial derivatives of multi-input/output functions

Analytic or symbolic differentiation

• Prone to round-off errors• Slow with partial derivatives of multi-input/output functions

Numeric differentiation

• An algorithm that solves all these problems• Calculation times comparable to first difference numeric• But 108 times more accurate

Automatic differentiation

Classical computer-based differentiation methods are problematic to apply to this task

Page 7: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

• How do we design an experiment to give us the highest SNR measurement of a quantity?

• If you only had one shot to examine something for the next 20 years, how would you collect the best data possible?

Optimal Experimental Design

Page 8: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Optimal Experimental DesignThe effect of noise on measurements of a nonlinear function is hard to estimate

• Often analyzed with computationally expensive Monte Carlo simulations• Impractical for evaluating many scenarios• Unsuitable for the problem of finding the most efficient set of measurement points

We can relax the problem: use the Cramér-Rao Lower Bound instead to predict our experimental precision

• This is much more tractable. We just need some derivatives.• This formalism has been used in many scientific fields including dark energy experiments in cosmology.

Atkinson and Donev. Optimum experimental designs. Oxford: Oxford University Press; 1992

Page 9: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

The FrameworkWe created a framework that marries the CRLB with automatic differentiation

• Enables the calculation of the unbiased CRLB for arbitrary signal equations with no more effort than implementing the equation under study

• Including sequences that can only be described with Bloch simulations• Python was used with PyAutoDiff and SciPy for general function optimization

This enables the analysis and optimization of arbitrary parameter mapping experiments

• Including highly exotic techniques like MR Fingerprinting• Or one can design new methods by evaluating the information provided by a new pulse sequence

Git it: http://sujason.web.stanford.edu/quantitative/

Page 10: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

A Typical SetupImplement a function that computes the signal(s) for your pulse sequence(s)• Sometimes as simple as a one line signal equation for magnitude data, but it can

also be more complex

Create a cost-function

• We provide a one line wrapper for your signal function to compute its derivatives• Use our functions to find the CRLB of the scan protocol with these derivatives• Weight the variance of the estimated parameters according to your interest

Page 11: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

A Typical Setup: OptimizationSet up constraints on your solution space• We provide utilities to accomplish this easily using the actual names

of your function inputs

Feed the cost function into a general solver• Find the optimal choice of scan parameters, number of images, and

fraction of time to spend on each image series

Profit!

Page 12: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Application: 3TI MPRAGELiu et al. performed a brute force optimization of the experiment using a noise function• Not sure if noise function is exact• Sampled on a grid and took the minimum• From this he drew some heuristics about what optimum values of TI and TS

should be

I reproduce this analysis using the experimental design framework• With greater numerical accuracy (parameters limited by sampling grid)• And extend it to more complex scenarios

Page 13: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

3TI MPRAGE: SetupMPRAGE signal equation implemented in 3 different formulations from literature to ensure correctness

For unbiased CRLB analysis, I think we should be using the raw signal equations, before any image combination

• Fisher information/CRLB describes the sensitivity of the actual images collected• Representing the intrinsic lower bound on the pulse sequence itself to changes in T1, instead of a

particular recon. implementation

In 3TI MPRAGE, various effects are removed or modeled out in the fitting process

• These include: M0 and more perhaps subtly, B1+ or κ• In such analyses, there are two types of parameters, those that we assume a value for and those

that we estimate/account for

Page 14: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

3TI MPRAGE: Setup• Find TIs, TS, <acquisition time

fraction>• Estimate T1, M0, κ• Cost: T1/σT1 * sqrt(TS)

– The coefficient of variation of T1, normalized by acquisition time

– i.e. precision efficiency

• Fixed parameters – based on Liu’s marmosat parameters– N = 64 readouts, centric-encoding– α = 9deg., TR = 8.45

• Constraints – implemented as plugin transforms to the input variables– train_length = (N-1)TR = 532.35– TS ≥ 2*train_length– TI ≤ TS – train_length– TI ≥ 10ms (or higher for multi T1)

• Solver– Brute force search number of

TIs/images from 2-5– Regularization = 1e-16, checked

against neighboring values 0, 1e-14, 1e-12 for consistency

Page 15: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Variable Time Fraction Equal Time Fraction

Single T1=1300ms

Page 16: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Single T1=1300ms

Variable Time Fraction Equal Time Fraction

Page 17: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

CommentsAs Liu observed, the first and last TIs should be as close to the bounds as they can get• The middle TI should be ~T1• Liu stated that TS should be 4.2*T1• This shows about 4.4

Let’s be a bit more rigorous about these conclusions

• Solve the single T1 design problem over a range

Page 18: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Optimal Parameters as T1 Changess

Page 19: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Cost Gap

Page 20: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Multiple T1• To optimize over a range of T1s, we sample the

range and evaluate the CRLB of a protocol for each– The cost is then a single value summary of these

precisions– Common to either minimize the mean or maximum

(i.e. worst case) CoV• T1=1000-2000ms (20 pts)

Page 21: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000

Page 22: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000

Page 23: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000, equal time

Page 24: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000, equal time

Page 25: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000, free FA, equal time

Page 26: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Mean Max

Multi T1=1000-2000, free FA, equal time

Page 27: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Next Steps• Multi κ• Multiple α recon?– ARLO?

Page 28: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Bloch Simulation• One of the distinct advantages of automatic

differentiation is that it can handle complex programs– Bloch simulation and extended phase graph analysis are ways

to analyze the MR experiment using computer programs• More complicated mapping methods, like MR

Fingerprinting, rely on simulation to describe their– This provides a way to extend the experimental design

framework to more exotic pulse sequences

Page 29: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Libraries• I’ve been using pyautodiff for AD

– It provided the most seamless conversion of functions to derivatives, with 0 extra code asked of the user

– However, it is slow. Somewhat surprising because it uses theano which does a JIT compile to C.

– It is even slower for programs with loops• So I went shopping for different AD packages

– theano (what I’ve been using)– ad (pure python)– algopy (inspired by ADOL-C?)– CasADi (python frontend to C library)

Page 30: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Simple Speed Test• Bloch simulation is

essentially a sequence of matrix multiplies and additions on an input time series

• Simple vector accumulation test

• Other ones I want to try:– CppAD, pyadolc

Package F (1k x 1) dF (1k x 1k)

Python 0.848ms

theano 4.34ms 8640ms

algopy 271ms

ad DNF

CasADi 0.0573ms 8.64ms

Page 31: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Implementation• Given that there are still other AD packages out there

that may be better• Bloch simulation implemented to be modular so can

plugin in whatever AD library– Assuming it has the same general structure:

• Instantiate symbolic tracer variables• Use the specific math functions from the library

• With this I have theano and CasADi versions working

Page 32: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

Bloch Simulation Speed• For a 1000 length input Bloch simulation:

– Hargreaves’s MEX = 0.13 ms– CasADi = 1ms– theano = 94ms

• For a 1000x1000 Jacobian of the simulation:– Central difference = 0.1*2000 = 260ms

• Half for forward difference

– CasADi = 115ms (with no loss of accuracy!)– theano = 2m54s

Page 33: Research Update: Optimal 3TI MPRAGE T1 Mapping and Differentiation of Bloch Simulations Aug 4, 2014 Jason Su

• Should I migrate everything to CasADi?– Or away from theano– Ease of use?

• Been treating bloch as a separate module so don’t implementation can be as complex as I can take