machine learning for physical sciences · • speeding up existing ... (216 atoms, 40 ps) with gap...

13
MACHINE LEARNING FOR PHYSICAL SCIENCES CSE 5095-006 Spring 2019 Qian Yang Data$Driven Discovery Millennia Centuries Decades Present Observation and Experiment Theoretical Laws Computer Simulation

Upload: others

Post on 16-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

MACHINE LEARNING FORPHYSICAL SCIENCES

CSE 5095-006 Spring 2019Qian Yang

Data$Driven*Discovery

Millennia Centuries Decades Present

Observation*and*

ExperimentTheoretical*

Laws

Computer*Simulation

Page 2: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

COURSE OVERVIEWApplication of machine learning to materials science, chemistry, physics

• What types of problems can ML uniquely address?

• What are the challenges and opportunities?

• Principles of good applied ML for scientific problems

• Needed theoretical developments for scientific ML

An objective of this class is to bring together your combined expertise in CSE and other engineering fields to explore creative solutions to interdisciplinary problems.

Page 3: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

Part I: Machine Learning

• Scientific data in the ML setting• Evaluating model performance• Feature engineering• Deep-learning based strategies• Interpretable ML

Part II: Scientific Applications

• Scientific databases• Property prediction for molecules

and crystals• Enabling faster molecular dynamics

simulation• Scientific imaging• Interests of the class.

?

?

Page 4: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

Check class website for reading assignments:

https://qianyanglab.github.io/teaching/cse5095_mlmaterials.html

Course assessments will be submitted via HuskyCT.

Assessments

• Project (50%) - teams of 2-4 students; final paper and flash talk; project suggestions and milestones will be distributed next week

• Quizzes (20%) - in weeks 4-8, there will be a short weekly quiz on the previous week’s lecture (sample ungraded quiz will be given in week 3)

• Paper Review (30%) - in weeks 9-13, we will review papers as a class; each group of 2-3 students will be responsible for leading the discussion on one paper

Page 5: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

Logistics

Lecture T/Th, 9:30am-10:45am, KNS 201

Office Hours Th, 11:00am-12noon, ITE 259

and by appointment

Start thinking about final project ideas and teams.

Page 6: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

What kind of scientific problems is Machine Learning (not) good for?

Page 7: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

THEMES

• Speeding up existing computational methods without decreasing accuracy

• ML of expensive components

• Model reduction

in diamond and the transition from rhombohedral graphiteto diamond. The agreement with DFT is excellent, dem-onstrating that we can construct a truly reactive model thatdescribes the sp2-sp3 transition correctly, in contrast tocurrently used interatomic potentials.

Even for the small systems considered above, the GAPmodel is orders of magnitude faster than standard planewave DFT codes, but significantly more expensive thansimple analytical potentials. The computational cost isroughly comparable to the cost of numerical bond orderpotential models [17]. The current implementation of theGAP model takes 0:01 s=atom=time step on a single CPUcore. For comparison, a time step of the 216-atom unit cellof Fig. 3 takes 191 s=atom using CASTEP, about 20 000times longer, while the same for iron would take morethan 106 times longer.

In summary, we have outlined a framework for auto-matically generating finite range interatomic potentialmodels from quantum-mechanically calculated atomicforces and energies. The models were tested on bulk semi-conductors and iron and were found to have remarkableaccuracy in matching the ab initio potential energy surfaceat a fraction of the cost, thus demonstrating the fundamen-tal capabilities of the method. Preliminary data for GaN,presented in [8], shows that the extension to multicompo-nent and charged systems is straightforward by augment-ing the local energy with a simple Coulomb term usingfixed charges. Our long-term goal is to expand the range of

interpolated configurations and thus create ‘‘general’’ in-teratomic potentials whose accuracy approaches that ofquantum mechanics.The authors thank Sebastian Ahnert, Noam Bernstein,

Zoubin Ghahramani, Edward Snelson, and CarlRasmussen for discussions. A. P. B. is supported by theEPSRC. Part of the computational work was carried outon the Darwin Supercomputer of the University ofCambridge High Performance Computing Service.

[1] A. Szabo and N. S. Ostlund, Modern Quantum Chemistry:Introduction to Advanced Electronic Structure Theory(Dover, New York, 1996).

[2] M. C. Payne et al., Rev. Mod. Phys. 64, 1045 (1992).[3] M. Finnis, Interatomic Forces in Condensed Matter

(Oxford University Press, Oxford, 2003).[4] D.W. Brenner, Phys. Status Solidi B 217, 23 (2000).[5] N. Bernstein, J. R. Kermode, and G.Csanyi, Rep. Prog.

Phys. 72, 026501 (2009).[6] A. Brown et al., J. Chem. Phys. 119, 8790 (2003).[7] J. Behler and M. Parrinello, Phys. Rev. Lett. 98 , 146401

(2007).[8] See supplementary materials at http://link.aps.org/

supplemental/10.1103/PhysRevLett.104.136403 for de-tailed derivations and results for GaN.

[9] S. A. Dianat and R. M. Rao, Opt. Eng. (Bellingham,Wash.) 29, 504 (1990).

[10] D. A. Varshalovich, A. N. Moskalev, and V.K.Khersonskii, Quantum Theory of Angular Momentum(World Scientific, Singapore, 1987).

[11] C. E. Rasmussen and C.K. I. Williams, Gaussian Pro-cesses for Machine Learning (MIT Press, Cambridge,MA, 2006).

[12] D. J. C. MacKay, Information Theory, Inference, andLearning Algorithms (Cambridge University Press,Cambridge, England, 2003).

[13] I. Steinwart, J. Mach. Learn. Res. 2, 67 (2001).[14] S. Ahnert, Ph.D. thesis, University of Cambridge, 2005.[15] E. Snelson and Z. Ghahramani, in Advances in Neural

Information Processing Systems 18 , edited by Y. Weiss,B. Scholkopf, and J. Platt (MIT Press, Cambridge, MA,2006), pp. 1257–1264.

[16] S. J. Clark et al., Z. Kristallogr. 220, 567 (2005).[17] M. Mrovec, D. Nguyen-Manh, D. G. Pettifor, and V. Vitek,

Phys. Rev. B 69, 094115 (2004).[18] D.W. Brenner et al., J. Phys. Condens. Matter 14, 783

(2002).[19] J. Tersoff, Phys. Rev. B 39, 5566 (1989).[20] J. L. Warren, J. L. Yarnell, G. Dolling, and R.A. Cowley,

Phys. Rev. 158 , 805 (1967).[21] M. S. Liu, L. A. Bursill, S. Prawer, and R. Beserman, Phys.

Rev. B 61, 3391 (2000).[22] G. Lang et al., Phys. Rev. B 59, 6182 (1999).[23] C. Z. Wang, C. T. Chan, and K.M. Ho, Phys. Rev. B 42,

11 276 (1990).[24] M.W. Finnis and J. E. Sinclair, Philos. Mag. A 50, 45

(1984).[25] P. Pavone et al., Phys. Rev. B 48 , 3156 (1993).[26] G. A.Slack and S. F. Bartram, J. Appl. Phys. 46, 89 (1975).

0 500 1000 1500 2000

0246

x 10−6

Temperature / K

α / K

−1

FIG. 3. Linear thermal expansion coefficient of diamond in theGAP model (dashed line) and DFT (dash-dotted line) using thequasiharmonic approximation [25], and derived from MD(216 atoms, 40 ps) with GAP (solid) and the Brenner potential(dotted). Experimental results are shown with squares [26].

0 0.2 0.4 0.6 0.8 1

0

2

4

6

Ene

rgy

/ eV

Ene

rgy

/ eV

Reaction coordinate

dnomaiDetihparg lardehobmohR

0

5

10

DFT−LDAGAPBrennerTersoff

a)

b)

FIG. 4. The energetics of the linear transition path for amigrating vacancy (top) and for the rhombohedral graphite todiamond transformation (bottom).

PRL 104, 136403 (2010) P HY S I CA L R EV I EW LE T T E R Sweek ending2 APRIL 2010

136403-4

ML energy potentials for faster, more accurate atomistic simulation

Bartok, A. P., Payne, M. C., Kondor, R., and Csanyi, G., Gaussian approximation potentials: the accuracy of quantum mechanics, without the electrons. Physical Review Letters, doi:10.1103/PhysRevLett.104.136403 (2010)

Page 8: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

THEMES

• Automation: doing what humans could do, but faster and better

2 F E B R U A R Y 2 0 1 7 | V O L 5 4 2 | N A T U R E | 1 1 7

LETTER RESEARCH

by choosing a threshold probability t and defining the prediction ŷ for each image as ŷ = P ≥ t. Varying t in the interval 0–1 generates a curve of sensitivities and specificities that the CNN can achieve.

We compared the direct performance of the CNN and at least 21 board-certified dermatologists on epidermal and melanocytic

lesion classification (Fig. 3a). For each image the dermatologists were asked whether to biopsy/treat the lesion or reassure the patient. Each red point on the plots represents the sensitivity and specificity of a single dermatologist. The CNN outperforms any dermatologist whose sensitivity and specificity point falls below the blue curve of

a

b

0 1Sensitivity

0

1

Spe

cific

ity

Melanoma: 130 images

0 1Sensitivity

0

1

Spe

cific

ity

Melanoma: 225 images

Algorithm: AUC = 0.96

0 1Sensitivity

0

1

Spe

cific

ity

Melanoma: 111 dermoscopy images

0 1Sensitivity

0

1

Spe

cific

ity

Carcinoma: 707 images

Algorithm: AUC = 0.96

0 1Sensitivity

0

1

Spe

cific

ity

Melanoma: 1,010 dermoscopy images

Algorithm: AUC = 0.94

0 1Sensitivity

0

1

Spe

cific

ity

Carcinoma: 135 images

Algorithm: AUC = 0.96 Dermatologists (25) Average dermatologist

Algorithm: AUC = 0.94 Dermatologists (22) Average dermatologist

Algorithm: AUC = 0.91Dermatologists (21) Average dermatologist

Figure 3 | Skin cancer classification performance of the CNN and dermatologists. a, The deep learning CNN outperforms the average of the dermatologists at skin cancer classification using photographic and dermoscopic images. Our CNN is tested against at least 21 dermatologists at keratinocyte carcinoma and melanoma recognition. For each test, previously unseen, biopsy-proven images of lesions are displayed, and dermatologists are asked if they would: biopsy/treat the lesion or reassure the patient. Sensitivity, the true positive rate, and specificity, the true negative rate, measure performance. A dermatologist outputs a single prediction per image and is thus represented by a single red point. The green points are the average of the dermatologists for each task, with error bars denoting one standard deviation (calculated from n = 25, 22 and 21 tested dermatologists for keratinocyte carcinoma, melanoma and melanoma under dermoscopy, respectively). The CNN outputs a malignancy probability P per image. We fix a threshold probability t

such that the prediction ŷ for any image is ŷ = P ≥ t, and the blue curve is drawn by sweeping t in the interval 0–1. The AUC is the CNN’s measure of performance, with a maximum value of 1. The CNN achieves superior performance to a dermatologist if the sensitivity–specificity point of the dermatologist lies below the blue curve, which most do. Epidermal test: 65 keratinocyte carcinomas and 70 benign seborrheic keratoses. Melanocytic test: 33 malignant melanomas and 97 benign nevi. A second melanocytic test using dermoscopic images is displayed for comparison: 71 malignant and 40 benign. The slight performance decrease reflects differences in the difficulty of the images tested rather than the diagnostic accuracies of visual versus dermoscopic examination. b, The deep learning CNN exhibits reliable cancer classification when tested on a larger dataset. We tested the CNN on more images to demonstrate robust and reliable cancer classification. The CNN’s curves are smoother owing to the larger test set.

Squamous cell carcinomas

Basal cell carcinomas

Nevi

Melanomas

Seborrhoeic keratoses

Epidermal benignEpidermal malignantMelanocytic benignMelanocytic malignant

Figure 4 | t-SNE visualization of the last hidden layer representations in the CNN for four disease classes. Here we show the CNN’s internal representation of four important disease classes by applying t-SNE, a method for visualizing high-dimensional data, to the last hidden layer representation in the CNN of the biopsy-proven photographic test sets

(932 images). Coloured point clouds represent the different disease categories, showing how the algorithm clusters the diseases. Insets show images corresponding to various points. Images reprinted with permission from the Edinburgh Dermofit Library (https://licensing.eri.ed.ac.uk/i/software/dermofit-image-library.html).

© 2017 Macmillan Publishers Limited, part of Springer Nature. All rights reserved.

Computer vision for disease detection

Esteva, A., Kuprel, B., Novoa, R. A., Ko, J., Swetter, S. M., Blau, H. M., and Thrun, S., Dermatologist-level classification of skin cancer with deep neural networks. Nature, doi:10.1038/nature21056 (2017)

Page 9: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

THEMES

• Structure-property prediction

students would naturally predict superionic conduction in theabsence of eq 1, and so they were not given access to any of thepretabulated features employed in eq 1, nor were theyencouraged to make predictions quickly. After makingpredictions, we calculated their average precision and recallon the data set; the average precision was 0.25 and the averagerecall was 0.222, giving an overall average F1 score of 0.235.The baseline F1 score for random guessing is 0.143. Thestudents took approximately one minute to make eachindividual prediction. For comparison, the ML model madeeach prediction in approximately one millisecond.In Figure 4 we compare the performance in speed and F1

score of the Ph.D. students and the ML model. The ML model

exhibits more than double the F1 score of the students and ismore than 3 orders of magnitude faster. As a reference, weprovide the performance of DFT-MD, which we assume has anF1 score of 1.0 and requires approximately 2 weeks to make areliable prediction.While DFT-MD is taken here to be ground truth, the logistic

regression model utilized in this work is trained onexperimental measurements, where grain boundaries, contam-inants, and other uncharacterized factors may have altered theresult. This may mean the model is best suited to guideexperimental searches, as the model has a built-in bias towardexpected results under experimental conditions. In contrast,our DFT-MD simulates conductivity in single crystal bulksystems with small Li vacancy concentrations. Although DFT-MD is well-suited to make predictions under these conditions,its predictions have potential to deviate from the ground truthfor the ML model; for example, the conflicting DFT-MD andexperimental reports for RT Li ion conductivity in Li6Ho-(BO3)3 between this work and ref.40 This work predicts RTion conductivity of approximately 5.1 mS/cm, while ref 40reports RT ion conductivity orders of magnitude lower (seeSection III, Subsection iii). It is possible that the model mayrecognize that experimental efforts on Li6Ho(BO3)3 are likelyto yield a poor conductor even though the single crystalconductivity is fast. We look forward to future experimentalreports of the ionic conductivities of some of the materialspresented here, to both advance the state of the art in ionconductors and to further quantify the performance of the datadriven approach.

IV. CONCLUSIONSGuided by machine learning methods, we discover many newsolid materials with predicted superionic Li ion conduction(≥10−4 S/cm) at room temperature: Li5B7S13, Li2B2S5,Li3ErCl6, LiSO3F, Li3InCl6, Li2HIO, LiMgB3(H9N)2, andCsLi2BS3. Two additional materials show marginal RTconduction: Sr2LiCBr3N2 and LiErSe2. One of these materials,Li5B7S13, has a DFT-MD predicted RT Li conductivity (74mS/cm) many times larger than the fastest known Li ionconductors. A search over randomly chosen materials identifiestwo additional materials with promising predicted RT ionicconductivities: Li6Ho(BO3)3, and LiSbO3. In addition to highionic conductivities, all these materials have high band gaps,high thermodynamic stability, and no transition metals, makingthem promising candidates for solid-state electrolytes inSSLIBs. These materials represent many exciting newcandidates for solid electrolytes in SSLIBs, and we encourage

Figure 4. Comparison of human and machine. Here we plot thepredictive accuracy (F1 score) of the ML model and the predictiveaccuracy of a group of six Ph.D. students working in materials scienceand electrochemistry. We chose 22 materials at random from a list of317 highly stable Li containing compounds in the Materials Projectdatabase and queried both Ph.D. students and the ML model topredict which materials are superionic Li conductors at roomtemperature. Validation of superionic conduction is performed withdensity functional theory molecular dynamics simulation. The Ph.D.students average an F1 score of 0.24 for superionic prediction whilethe model produces an F1 score of 0.5. For reference, we provide thebaseline F1 score expected for random guessing (0.14) as a dashedvertical line. Additionally, the students average a rate of approximatelyone minute per prediction while the trained ML model makes over100 predictions per second, a thousand-fold increase in speed. Thedensity functional theory simulation used to validate superionicconduction is a physics-based model that is taken here to representthe ground truth (F1 score of 1.0) but is very slow, with a predictionrate on the scale of weeks. Taken together, these data points highlightthe experimental approach that ML-based prediction tools are well-suited to address: making fast predictions more accurately than trial-and-error guessing.

Table 3. Summary of Model Performancea

model precision recallF1score fast Li ion conducting materials identified (in this work)

machine learning (logistic regression on 40examples)

1.0 0.33 0.5 Li5B7S13, Li2B2S5, Li3ErCl6, Li2HIO, LiSO3F, Li3InCl6, CsLi2BS3, LiMgB3(H9N)2,Sr2LiCBr3N2 (marginal), LiErSe2 (marginal)

random selection 0.14 0.14 0.14 Li6Ho(BO3)3, LiSbO3, LiSO3FPh.D. student screening 0.25 0.22 0.24 −

aHere we provide the performance metrics (precision, recall, F1 score) and list of discovered fast Li ion conducting materials for the three modelsexplored in this work. The results of the Ph.D. student screening represent the average performance of six students on the same test set of randomlychosen materials as used to compute the “random selection” statistics. The machine learning-based approach to predicting ion conductivity from asmall data set of 40 materials significantly outperforms both random chance and the average polled Ph.D. student. This highlights the promise ofapplying machine learning-based approaches to materials screening before performing computationally expensive simulation techniques like DFT-MD or time consuming experimental tests.

Chemistry of Materials Article

DOI: 10.1021/acs.chemmater.8b03272Chem. Mater. 2019, 31, 342−352

350

Predictions of superionic Li conductors at room temperature.

Sendek, A.D., Cubuk, E.D., Antoniuk, E.R., Cheon, G., Cui, Y., and Reed, E. J., Machine Learning-Assisted Discovery of Solid Li-Ion Conducting Materials. Chemistry of Materials, doi:10.1021/acs.chemmater.8b03272 (2018)

Page 10: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

WHAT MAKES SCIENTIFIC MACHINE LEARNING HARD?

• Distribution of Data

• Feature Engineering

• Model Performance Requirements

• Interpretability

• Others?

Page 11: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

ADVANTAGES IN SCIENTIFIC MACHINE LEARNING

• Problems are often highly structured

• We can often generate new data in a principled way (experiments, computation)

• Existing physical models provide initial guesses and meaningful constraints

Page 12: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

Please email me with a quick response to the following before lecture Thursday (subject line: cse5095spring19survey):

1. What is your background in linear algebra, probability & statistics, and machine learning?

2. How strong is your programming background? (scale 1-3, strongest = 3)3. What scientific applications of ML are you interested in/would you like to

see explored in this class?

Next Class: a whirlwind tour through ML algorithms.

Page 13: MACHINE LEARNING FOR PHYSICAL SCIENCES · • Speeding up existing ... (216 atoms, 40 ps) with GAP (solid) and the Brenner potential ... The energetics of the linear transition path

INTRODUCTIONS