Slide 1

Slide 1 text

Python For Public Health: Building Statistical Models Of Ciliary Motion Shannon Quinn University of Georgia PyCon 2016

Slide 2

Slide 2 text

Part I: Cilia and their pathologies

Slide 3

Slide 3 text

What are cilia? Scale bars: 10µm

Slide 4

Slide 4 text

Why do we care about cilia? u Clinical u Ciliopathies u Association with congenital heart disease u Developmental u Nodal flow u Left-right asymmetry

Slide 5

Slide 5 text

How do we diagnose ciliopathies? Cheap, fast, inaccurate Slow, expensive, accurate (?) Measure nasal nitric oxide (NO) levels Electron microscopy to search for structural defects Ciliary beat frequency (CBF) computation Manual ciliary beat pattern analysis “Gold standard”

Slide 6

Slide 6 text

What is our goal? u Input: high-speed video of ciliary biopsy u Output: quantitative properties of observed motion Curly!

Slide 7

Slide 7 text

Part II: Quantitative features of ciliary motion

Slide 8

Slide 8 text

Strategy for quantifying motion

Slide 9

Slide 9 text

From videos to features

Slide 10

Slide 10 text

Features describing motion Scaling (zoom) Deformation (biaxial shear) Rotation (curl) Not useful in 2D “Novel use of differential image velocity invariants to categorize ciliary motion defects.” Quinn SP, Francis R, Lo C, Chennubhotla CS. Proceedings of the Biomedical Science and Engineering Conference (BSEC) 2011.

Slide 11

Slide 11 text

What do these features look like? Rotation (rad/s)

Slide 12

Slide 12 text

How do we represent these features? ~ yt = C~ xt ~ xt = A1~ xt 1 + A2~ xt 2 + ... + Ad~ xt d Feature vectors!

Slide 13

Slide 13 text

What can we do with these features? 93% classification accuracy Automated identification of abnormal respiratory ciliary motion in nasal biopsies. Quinn SP, Zahid M, Durkin J, Francis R, Lo C, Chennubhotla CS. Science Translational Medicine 2015.

Slide 14

Slide 14 text

Part III: The Python ecosystem

Slide 15

Slide 15 text

Collecting data from collaborators 1. Upload to django website 2. Annotate manually 3. Save annotations in database using SQLAlchemy

Slide 16

Slide 16 text

Processing raw video data 1. Videos in AVI format 2. Convert to NumPy arrays with OpenCV 3. Compute optical flow with OpenCV 4. Compute rotation with SciPy signal processing filters

Slide 17

Slide 17 text

Derivation of time series models u …custom code! u scipy.linalg

Slide 18

Slide 18 text

Classification pipeline u Cross-validation for model fitting and testing using scikit-learn u joblib / PySpark for parameter scanning u matplotlib + seaborn / bokeh for visualization

Slide 19

Slide 19 text

(BONUS ROUND) Part IV: Conclusions and future directions

Slide 20

Slide 20 text

Conclusions u 93% classification: methods are sound u Dynamic texture representation is accurate u Blackbox tool for clinicians u Web front-end + Python middleware + Spark back-end u Upload video -> Get analysis u Assist experts with diagnostics u Expert input u Phenotype annotations, regions of interest

Slide 21

Slide 21 text

Future directions u Normal / Abnormal is an oversimplification… u Unsupervised motion clustering pipeline u Associate specific motion phenotypes with clinical conditions

Slide 22

Slide 22 text

Thank you! u [email protected] u @SpectralFilter u https://magsol.github.io/