Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Shannon Quinn - Python for Public Health: Building Statistical Models of Ciliary Motion

Shannon Quinn - Python for Public Health: Building Statistical Models of Ciliary Motion

Cilia, microscopic hairs lining nearly every cell surface in your body, play a major role in developmental and sinopulmonary health. As such, deriving quantitative properties of their motion is compelling for both clinical and research purposes. Here we demonstrate a computational pipeline built entirely in Python for analyzing ciliary motion using a variety of machine learning techniques.

https://us.pycon.org/2016/schedule/presentation/1580/

PyCon 2016

May 29, 2016
Tweet

More Decks by PyCon 2016

Other Decks in Programming

Transcript

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

    View Slide

  2. Part I: Cilia and their pathologies

    View Slide

  3. What are cilia?
    Scale bars: 10µm

    View Slide

  4. 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

    View Slide

  5. 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”

    View Slide

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

    View Slide

  7. Part II: Quantitative features of
    ciliary motion

    View Slide

  8. Strategy for quantifying motion

    View Slide

  9. From videos to features

    View Slide

  10. 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.

    View Slide

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

    View Slide

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

    View Slide

  13. 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.

    View Slide

  14. Part III: The Python ecosystem

    View Slide

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

    View Slide

  16. 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

    View Slide

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

    View Slide

  18. 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

    View Slide

  19. (BONUS ROUND)
    Part IV: Conclusions and future
    directions

    View Slide

  20. 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

    View Slide

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

    View Slide

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

    View Slide