1 of 30

Enhancing Neutron Scattering Experimentation

A Data Science and Machine Learning Approach to Predict Background Scattering

1

14-03-2024

Petroula Karacosta

X-ray and Neutron Scattering Group, NBI

2 of 30

Master’s Thesis:

Using McStas Union components to simulate a magnet sample environment & predicting background with machine learning

2

Kim Lefmann

Professor

NBI

Mads Bertelsen

Computational Neutron Scattering Scientist

ESS, DMSC

Alex Holmes

Scientific Engineer

ESS

3 of 30

What’s Neutron Scattering?

3

4 of 30

The ID of a Neutron

Interaction with matter

4

Spin

Charge

Magnetic Moment

Particle

Wave

1/2

0

-1.9130 e/2mp

Yes

Yes

Absorption

Scattering

  • Coherent & Incoherent
  • Elastic & Inelastic

Bragg’s Law

Debye-Scherrer Cones

In Crystals

In Crystal Powders

5 of 30

European Spallation Source - BIFROST Spectrometer

5

Sample

Environment

6 of 30

Creating synthetic data

6

7 of 30

Simulating the Sample Environment

7

Monte Carlo Neutron Ray-Tracing Simulation Package

McStas Union

Assign physical properties to desired geometries

8 of 30

Simulating the Sample Environment

8

9 of 30

Simulating the Sample Environment

9

10 of 30

10

11 of 30

11

12 of 30

What problem do we need to solve?

12

13 of 30

Background Scattering

13

14 of 30

Background Scattering

14

15 of 30

Example: La2-xSrxCuO4, λ=1.47 Å

15

Produced over 24000 sets of synthetic data based on 7 parameters:

  • Wavelength: λ, λd
  • Beam divergence
  • Sample dimension
  • Sample - Detector distance
  • Sample material

16 of 30

16

  • Wavelength: λ, λd
  • Beam divergence
  • Sample height/radius
  • Sample - Detector distance
  • Sample material

17 of 30

17

  • Wavelength: λ, λd
  • Beam divergence
  • Sample height/radius
  • Sample - Detector distance
  • Sample material

18 of 30

What’s the best way

to predict background?

18

19 of 30

Starting with a Random Forest:

19

  1. Features: High dimensional or reduced?
  2. Information - Complexity trade-off
  3. Background information - bias exploration

20 of 30

1. Dimensionality Reduction

20

High dimensionality: 807 features

  • 7 Instrument parameters
  • 800 intensity/angle values

PCA: 81 features

  • 89.96% of feature reduction
  • 94.45% of information preserved

21 of 30

1. Dimensionality Reduction

21

High dimensionality: 807 features

  • 7 Instrument parameters
  • 800 intensity/angle values

PCA: 81 features

  • 89.96% of feature reduction
  • 94.45% of information preserved

22 of 30

2. Information vs Complexity in target values

22

5 bins per degree: 800 targets

MAE: 0.161

1 bin per degree: 160 targets

MAE: 0.111

Normalised Intensity within 10o - 170o

23 of 30

2. Information vs Complexity in target values

23

5 bins per degree: 800 targets

MAE: 0.161

1 bin per degree: 160 targets

MAE: 0.111

Normalised Intensity within 10o - 170o

24 of 30

3. Bias Exploration: Measurements of pure background

24

0% Background Measurements

MAE: 0.105

50% Background Measurements

MAE: 0.129

100% Background Measurements

MAE: 0.121

25 of 30

3. Bias Exploration: Measurements of pure background

25

0% Background Measurements

MAE: 0.105

50% Background Measurements

MAE: 0.129

100% Background Measurements

MAE: 0.121

26 of 30

3. Bias Exploration: Measurements of pure background

26

0% Background Measurements

MAE: 0.105

50% Background Measurements

MAE: 0.129

100% Background Measurements

MAE: 0.121

Why though?

27 of 30

First results

27

28 of 30

Random Forest vs Gradient Boost

28

Simulation

Predicted Background

Predicted Sample

29 of 30

Still a work in progress…

Nonetheless…

  • Improve data: Simulation quality and better representation of materials
  • Restructuring the database under the F.A.I.R. framework
  • Try Neural Networks - open to suggestions
  • Generalise: Material-agnostic model
  • Synthetic + Real data hybrid

29

First step in background prediction in neutron scattering data

30 of 30

Thank you!

Questions?

30