|
62 | 62 | "best available for the purpose.*" |
63 | 63 | ] |
64 | 64 | }, |
65 | | - { |
66 | | - "cell_type": "markdown", |
67 | | - "metadata": { |
68 | | - "slideshow": { |
69 | | - "slide_type": "skip" |
70 | | - } |
71 | | - }, |
72 | | - "source": [ |
73 | | - "#### Import hyperspy" |
74 | | - ] |
75 | | - }, |
76 | | - { |
77 | | - "cell_type": "code", |
78 | | - "execution_count": 22, |
79 | | - "metadata": { |
80 | | - "slideshow": { |
81 | | - "slide_type": "skip" |
82 | | - } |
83 | | - }, |
84 | | - "outputs": [], |
85 | | - "source": [ |
86 | | - "%matplotlib notebook\n", |
87 | | - "import hyperspy.api as hs\n", |
88 | | - "import numpy as np" |
89 | | - ] |
90 | | - }, |
91 | | - { |
92 | | - "cell_type": "markdown", |
93 | | - "metadata": { |
94 | | - "slideshow": { |
95 | | - "slide_type": "skip" |
96 | | - } |
97 | | - }, |
98 | | - "source": [ |
99 | | - "#### Disable warnings for presentation:" |
100 | | - ] |
101 | | - }, |
102 | | - { |
103 | | - "cell_type": "code", |
104 | | - "execution_count": 2, |
105 | | - "metadata": { |
106 | | - "slideshow": { |
107 | | - "slide_type": "skip" |
108 | | - } |
109 | | - }, |
110 | | - "outputs": [], |
111 | | - "source": [ |
112 | | - "import logging\n", |
113 | | - "hs_logger = logging.getLogger('hyperspy') \n", |
114 | | - "hs_logger.setLevel(logging.ERROR)" |
115 | | - ] |
116 | | - }, |
117 | 65 | { |
118 | 66 | "cell_type": "markdown", |
119 | 67 | "metadata": { |
|
556 | 504 | "metadata": {}, |
557 | 505 | "source": [ |
558 | 506 | "- Many algorithms exist to solve: $\\mathbf{D}_{\\left(x,y\\right),E}=\\mathbf{W}_{\\left(x,y\\right)} \\times \\mathbf{S}_E$\n", |
559 | | - " - Assumptions implicit in each affect their suitability for EDS, EELS, etc.\n", |
560 | | - "\n", |
| 507 | + " - This is a highly underdetermined problem, with an infinite number of solutions\n", |
| 508 | + " - Assumptions implicit in each algorithm affect their suitability for EDS, EELS, etc." |
| 509 | + ] |
| 510 | + }, |
| 511 | + { |
| 512 | + "cell_type": "markdown", |
| 513 | + "metadata": { |
| 514 | + "slideshow": { |
| 515 | + "slide_type": "fragment" |
| 516 | + } |
| 517 | + }, |
| 518 | + "source": [ |
561 | 519 | "- Primary methods (built into <img src='img/hyperspy.svg' width=40px style='display:inline-block;'/> HyperSpy ):\n", |
562 | | - " - Principal component analysis (PCA) — finds non-physical spectra that describe the most variance in the datacube\n", |
563 | | - " - Independent component analysis (ICA) — maximizes independence between spectral results\n", |
564 | | - " - Non-negative matrix factorization (NMF) — enforces positivity in spectral components and weights" |
| 520 | + " - Principal component analysis ([PCA](https://en.wikipedia.org/wiki/Principal_component_analysis)) — finds non-physical spectra that describe the most variance in the datacube\n", |
| 521 | + " - Independent component analysis ([ICA](https://en.wikipedia.org/wiki/Independent_component_analysis)) — maximizes independence between spectral results\n", |
| 522 | + " - Non-negative matrix factorization ([NMF](https://en.wikipedia.org/wiki/Non-negative_matrix_factorization)) — enforces positivity in spectral components and weights" |
| 523 | + ] |
| 524 | + }, |
| 525 | + { |
| 526 | + "cell_type": "markdown", |
| 527 | + "metadata": { |
| 528 | + "slideshow": { |
| 529 | + "slide_type": "subslide" |
| 530 | + } |
| 531 | + }, |
| 532 | + "source": [ |
| 533 | + "## Principle component analysis + blind source separation" |
| 534 | + ] |
| 535 | + }, |
| 536 | + { |
| 537 | + "cell_type": "markdown", |
| 538 | + "metadata": {}, |
| 539 | + "source": [ |
| 540 | + "- PCA will find the spectra that describe the maximum amount of variance within the data set\n", |
| 541 | + " - These principle components (PCs) will contain the most \"information\" — but not information relevant to a microscopist\n", |
| 542 | + " - The results will look like vaguely spectral, but almost guaranteed to be non-physical" |
| 543 | + ] |
| 544 | + }, |
| 545 | + { |
| 546 | + "cell_type": "markdown", |
| 547 | + "metadata": { |
| 548 | + "slideshow": { |
| 549 | + "slide_type": "fragment" |
| 550 | + } |
| 551 | + }, |
| 552 | + "source": [ |
| 553 | + "- [Blind source separation](https://en.wikipedia.org/wiki/Signal_separation) often gives more interpretable results:\n", |
| 554 | + " - Independent component analysis (ICA):\n", |
| 555 | + " - Operates on the PCs to maximize independence between spectral results\n", |
| 556 | + " - Non-negative matrix factorization (NMF):\n", |
| 557 | + " - Decompose the matrix with constraints that match physical expectations" |
565 | 558 | ] |
566 | 559 | }, |
567 | 560 | { |
|
596 | 589 | "cell_type": "markdown", |
597 | 590 | "metadata": {}, |
598 | 591 | "source": [ |
599 | | - "- Data collected from 0 to 360 degrees tilt in increments of 5 degrees\n", |
600 | | - " - Dataset is 165 x 124 x 73 x 900 " |
| 592 | + "- Data collected from 0 to 360 degrees tilt in increments of 5 degrees (73 spectrum images)\n", |
| 593 | + " - Dataset is $\\left(x, y, \\theta, E\\right)$ : $\\left(165, 124, 73, 900\\right)$ — 12.2GB" |
601 | 594 | ] |
602 | 595 | }, |
603 | 596 | { |
|
676 | 669 | "cell_type": "markdown", |
677 | 670 | "metadata": {}, |
678 | 671 | "source": [ |
679 | | - "<div class='two-cols pro-con' style='font-size:1.5em;top:0'>\n", |
| 672 | + "<div class='two-cols pro-con' style='font-size:1.3em;top:0'>\n", |
680 | 673 | "\n", |
681 | | - "<div class='col' style='max-width:45%;margin-top:8%;'>\n", |
| 674 | + "<div class='col' style='max-width:45%;margin-top:6%;'>\n", |
682 | 675 | "<ul style='line-height:150%;'>\n", |
683 | 676 | " <li>PCA orders components by \"described variance\"</li>\n", |
684 | 677 | " <li><em>a priori</em> we know there should be three components</li>\n", |
|
728 | 721 | "cell_type": "markdown", |
729 | 722 | "metadata": {}, |
730 | 723 | "source": [ |
731 | | - "<center><img style=\"width:65%;\" class=\"plain\" src=\"img/andy_eds_intensities_raw_vs_PCA.svg\"/></center>\n", |
| 724 | + "<center><img style=\"width:65%;margin-top:5%;\" class=\"plain\" src=\"img/andy_eds_intensities_raw_vs_PCA.svg\"/></center>\n", |
732 | 725 | "\n", |
733 | 726 | "<div class=\"fig-caption-center\" style=\"height:4em; bottom:-3%;\">\n", |
734 | 727 | "Line intensities extracted from model with top 3 PCA elements;<br/>\n", |
735 | | - "Drastically enhances S/N ratio in \"loading\" maps</div>" |
| 728 | + "Drastically enhances S/N ratio in line intensity maps</div>" |
| 729 | + ] |
| 730 | + }, |
| 731 | + { |
| 732 | + "cell_type": "markdown", |
| 733 | + "metadata": { |
| 734 | + "slideshow": { |
| 735 | + "slide_type": "subslide" |
| 736 | + } |
| 737 | + }, |
| 738 | + "source": [ |
| 739 | + "## Result of PCA + BSS" |
| 740 | + ] |
| 741 | + }, |
| 742 | + { |
| 743 | + "cell_type": "markdown", |
| 744 | + "metadata": {}, |
| 745 | + "source": [ |
| 746 | + "<center><img style=\"width:70%;\" class=\"plain\" src=\"img/andy_BSS.svg\"/></center>\n", |
| 747 | + "<div class=\"fig-caption-center\" style=\"height:4em; bottom:-3%;\">\n", |
| 748 | + "One component for each element (phase)<br/>\n", |
| 749 | + "Much more interpretable results</div>" |
736 | 750 | ] |
737 | 751 | }, |
738 | 752 | { |
|
768 | 782 | "\n", |
769 | 783 | "# <center>Thank you!</center>\n", |
770 | 784 | "\n", |
771 | | - "<div style='text-align:center;margin:auto;'>Onto the demo...</div>" |
| 785 | + "<div style='text-align:center;margin:auto;'>Onto the demo...<br/>Any questions?</div>\n", |
| 786 | + "\n", |
| 787 | + "<div style='text-align:center;margin:auto;margin-top:15px;'><a href=\"mailto:[email protected]\">[email protected]</a></div>" |
772 | 788 | ] |
773 | 789 | } |
774 | 790 | ], |
|
0 commit comments