Deep convolutional neural networks applied to tomography images

Lara Lloret & Pablo Martínez Ruiz del Árbol October 2019 1st COMCHA school 1

s

t

C

O

M

Cosmic rays: composition, flux, energy spectrum. C

H

A

S

c

h

➔ o

Constant flux of high energy particles bombarding the Earth from the space. o

l

➔ Composed mainly by protons (98%), α particles (1.8%) and others (< 0.2%)

➔ Cosmic rays are the most energetic particle ever seen so far.

The Oh-My-God Particle 3x108 TeV (1991, several since then) http://www.cosmic-ray.org/reading/flyseye.html#SEC10

Deep convolutional neural networks applied to muon tomography images 2 1

s

t

C

O

M

Cosmic : flux and energy spectrum. C

H

A

S

c

h

➔ o

Muons are generated mostly from pion decays in the atmosphere. o

l

➔ The flux of muons is mostly proportional to cos2(θ) (angle with the vertical).

➔ Quickly falling spectra → average of 3 GeV when integrating solid angle.

Rule of thumb at the surface:

10000 muons per squared meter and minute.

Deep convolutional neural networks applied to muon tomography images 3 1

s

t

C

O

M

Muon interaction with matter: ionization C

H

A

S

c

h

➔ o

Ionization is one of the most frequent processes for cosmic muons. o

l

➔ Energy loss depends on the Z, density, and size of the crossed object.

➔ The Range is the distance for which the particle looses all the energy.

Mean excitation potential

Muon Energy/GeV Material Range/m

1 Water 471 10 Water 4260 1 Concrete 228 10 Concrete 2025 1 Standard Rock 209 10 Standard Rock 1857

Deep convolutional neural networks applied to muon tomography images 4 1

s

t

C

O

M

Muons interaction with matter: multiple scattering C

H

A

S

c

h

➔ o

Coulomb scattering deviates the direction of muons when crossing matter. o

l

➔ Scattering angle depends also on the Z, density, and size of the material.

➔ Angular distribution is approximately gaussian (with some tails).

Momentum dependence Muon Material Width/cm Angle/mrad Energy/GeV 1 Iron 1 10 10 Iron 1 1 1 Iron 10 34 10 Iron 10 3 1 1 19 10 Lead 1 2 1 Lead 10 64 10 Lead 10 6 1 1 26 10 Uranium 1 3 1 Uranium 10 88 10 Uranium 10 9

Deep convolutional neural networks applied to muon tomography images 5 1

s

t

C

O

M

Two categories on applications C

H

A

S

c

Absorption Muography Scattering Muography h

o

o

l ➔ Muon flux measured as a function of the direction. ➔ Scattering position and angular shift.

➔ Differential transmittance “T”. ➔ Smaller Masses + shorter exposure times.

➔ Need Large Masses + Long exposure times. ➔ Applications: security, industry, etc.

➔ Applications: vulcanology, geology, archeology… ➔ At least two detectors are needed.

➔ Only one detector needed.

Muon Detector T

θ Δθ Δθ

Muon Detector Muon Detector

Deep convolutional neural networks applied to muon tomography images 6 1

s

t

C

O

M

Two categories on muography applications C

H

A

S

c

Absorption Muography Scattering Muography h

o

o

l ➔ Muon flux measured as a function of the direction. ➔ Scattering position and angular shift.

➔ Differential transmittance “T”. ➔ Smaller Masses + shorter exposure times.

➔ Need Large Masses + Long exposure times. ➔ Applications: security, industry, etc.

➔ Applications: vulcanology, geology, archeology… ➔ At least two detectors are needed.

➔ Only one detector needed.

Muon Detector T

θ Δθ Δθ

Muon Detector Muon Detector

Deep convolutional neural networks applied to muon tomography images 7 1

s

t

C

O

M

Muon detectors: gas proportional chambers C

H

A

S

c

h

Chamber 1 o

o

l X measurement Y measurement

Chamber 2

Surface: 1m x 1m N. wires: 212 Synch Wire: Gold-Tungsten + Wire radius: 25 μm Trigger Chamber 3 Synchronization Gas: Ar-CO2 electronics

Chamber 4

Deep convolutional neural networks applied to muon tomography images 8 1

s

t

C

O

M

Muon detectors: gas proportional chambers C

H

A

S

c

h

o

o

l

Deep convolutional neural networks applied to muon tomography images 9 1

s

t

C

O

M

Image reconstruction in muon tomography C

H

A

S

c

➔ h Tomography is a classic “inverse” mathematical problem. o

o

l ⃗x Input variables for a given dynamical system Example: Position/direction of a muon at the upper detector.

⃗f Physics laws: evolution of the system.

Notice: Can be deterministic but also probabilistic. ⃗y=⃗f (⃗x ;θ⃗) Example: Moliere’s scattering formula for angular deviations.

θ⃗ Parameters describing the physics environment. Example: Densities and geometry of the crossed material.

⃗y Output variables after the action of ⃗f . Example: Position/direction of a muon at the lower detector.

Deep convolutional neural networks applied to muon tomography images 10 1

s

t

C

O

M

Image reconstruction in muon tomography C

H

A

S

c

➔ h Tomography is a classic “inverse” mathematical problem. o

o

Given l ⃗x Input variables for a given dynamical system Example: Position/direction of a muon at the upper detector. Known ⃗f Physics laws: evolution of the system.

Notice: Can be deterministic but also probabilistic. ⃗y=⃗f (⃗x ;θ⃗) Example: Moliere’s scattering formula for angular deviations. Known θ⃗ Parameters describing the physics environment. Example: Densities and geometry of the crossed material. Unknown ⃗y Output variables after the action of ⃗f . Direct problem Example: Position/direction of a muon at the lower detector.

Deep convolutional neural networks applied to muon tomography images 11 1

s

t

C

O

M

Image reconstruction in muon tomography C

H

A

S

c

➔ h Tomography is a classic “inverse” mathematical problem. o

o

Given l ⃗x Input variables for a given dynamical system Example: Position/direction of a muon at the upper detector. Known ⃗f Physics laws: evolution of the system.

Notice: Can be deterministic but also probabilistic. ⃗y=⃗f (⃗x ;θ⃗) Example: Moliere’s scattering formula for angular deviations. Unknown θ⃗ Parameters describing the physics environment. Example: Densities and geometry of the crossed material. Known ⃗y Output variables after the action of ⃗f . Inverse problem Example: Position/direction of a muon at the lower detector.

Deep convolutional neural networks applied to muon tomography images 12 1

s

t

C

O

M

The simple geometric approach: POCA C

H

A

S

c

➔ h This complex problem can be approximated doing some physical assumptions o

o

l

➔ The scattering occurs only at one point during the whole trajectory.

➔ Works very well for scenarios that are essentially empty with some high density chunks.

Point of Closest Approach (POCA)

Deep convolutional neural networks applied to muon tomography images 13 1

s

t

C

O

M

The simple geometric approach: POCA C

H

A

S

c

h

o

o

l

Deep convolutional neural networks applied to muon tomography images 14 1

s

t

C

O

M

The simple geometric approach: POCA C

H

A

S

c

h

o

o Front view Side view l

Top view

wear

wear wear

Deep convolutional neural networks applied to muon tomography images 15 1

s

t

C

O

M

Measurement of the width of an insulated pipe C

H

A

S

c

h

o

o

l

20 cm

Steel 20 cm 24 cm Rock wool 50 cm R Aluminium 24.06 cm

20 cm

DOI:10.1098/rsta.2018.0054

Deep convolutional neural networks applied to muon tomography images 16 1

s

t

C

O

M

Measurement of the width of an insulated pipe C

H

A

S

c

h

o

o

l

20 cm

Steel 20 cm 24 cm Rock wool 50 cm R Aluminium 24.06 cm

20 cm

DOI:10.1098/rsta.2018.0054

Deep convolutional neural networks applied to muon tomography images 17 1

s

t

C

O

M

Measurement of the width of an insulated pipe C

H

A

S

c

h

o

o

l

20 cm

Steel 20 cm 24 cm Rock wool 50 cm R Aluminium 24.06 cm

20 cm

DOI:10.1098/rsta.2018.0054

Deep convolutional neural networks applied to muon tomography images 18 1

s

t

C

O

M

Measurement of the width of an insulated pipe C

H

A

S

c

h

o

o

l

20 cm

Steel 20 cm 24 cm Rock wool 50 cm R Aluminium 24.06 cm

20 cm

DOI:10.1098/rsta.2018.0054

Deep convolutional neural networks applied to muon tomography images 19 1

s

t

C

O

M

Measurement of the width of an insulated pipe C

H

A

S

c

h

o

o

l

Simulation Details:

CRY (*) generator.

Geant4 + local chamber response.

Assuming perfect resolution.

About 1 hour of data taking.

https://nuclear.llnl.gov/simulation/doc_cry_v1.7/cry.pdf

Deep convolutional neural networks applied to muon tomography images 20 1

s

t

C

O

M

Reconstructed images for different widths C

H

A

S

c

Thickness = 1.2 cm Thickness = 1.6 cm Thickness = 1.8 cm h

o

o

l

Thickness = 2.0 cm Thickness = 2.4 cm Thickness = 2.6 cm

Deep convolutional neural networks applied to muon tomography images 21 1

s

t

C

O

M

Simulations with realistic detector C

H

A

S

Thickness = 1.2 cm Thickness = 1.6 cm Thickness = 1.8 cm c

h

o

o

l

Thickness = 2.0 cm Thickness = 2.4 cm Thickness = 2.6 cm

Deep convolutional neural networks applied to muon tomography images 22 1

s

t

C

O

M

Simulations with realistic detector C

H

A

S

Thickness = 1.2 cm Thickness = 1.6 cm Thickness = 1.8 cm c

h

o

o

l

QUESTION:

Thickness = 2.0 cm Thickness = 2.4 cm Thickness = 2.6 cm How to quantify and discern the thickness of the pipes?

Deep convolutional neural networks applied to muon tomography images 23 1

s

t

C

O

M

Convolutional neural networks (brief reminder) C

H

A

S

c

h

➔ o CNN are Machine Learning algorithms designed to operate with images. o

l

➔ Images are 2x1 dimension tensors: horizontal-vertical pixel x color/depth.

➔ A CNN is a network of filters operating over sub-spaces of the input.

Deep convolutional neural networks applied to muon tomography images 24 1

s

t

C

O

M

Convolutional neural networks (brief reminder) C

H

A

S

c

h

➔ o Filters operating on a particular sub-space produce a single number. o

l

Multiplying and adding = (50*30) + (50*30) + (50*30) + (20*30)+(50*30) = 6600

Multiplying and adding = 0

Deep convolutional neural networks applied to muon tomography images 25 1

s

t

C

O

M

Convolutional neural networks (brief reminder) C

H

A

S

c

h

➔ o As the filter spans the whole initial tensor it produces a new “image”. o

l

Filter 5x5 Features map

Deep convolutional neural networks applied to muon tomography images 26 1

s

t

C

O

M

Convolutional neural networks (brief reminder) C

H

A

S

c

h

➔ o Layers with filters are combined with Pooling and Dense Layers. o

l

➔ Pooling layers are just reducing the dimension of the feature maps.

➔ Dense layers are normal NN layers useful specially in the last stages.

Deep convolutional neural networks applied to muon tomography images 27 1

s

t

C

O

M

Idea: Classify Muon Tomography images with CNN C

H

A

S

c

h

➔ o Train a CNN with Muon Tomography images of different thicknesses. o

l

➔ Quantify the thickness of an unknown image as the one with better compatibility.

4 mm

6 mm

8 mm 10 mm 12 mm

14 mm 16 mm

18 mm Thickness = 2.6 cm

9 categories are defined. Hundreds of simulations for each category.

Deep convolutional neural networks applied to muon tomography images 28 1

s

t

C

O

M

A simple keras model for Muon Tomography C

H

A

S

c

h

o

o

l

Deep convolutional neural networks applied to muon tomography images 29 1

s

t

C

O

M

A simple keras model for Muon Tomography C

H

A

S

c

h

o

o

l

ImageDataGenerator (from Keras)

Automatically reads train and test images from a train and test directories.

Each sub-directory within train and test will be taken as a category.

Image colors are automatically rescaled.

The size of the images have to be provided as an argument.

Deep convolutional neural networks applied to muon tomography images 30 1

s

t

C

O

M

A simple keras model for Muon Tomography C

H

A

S

Model definition c

h

o

o Combination of Conv2D, MaxPooling2D and Dense layers. l

But also using Dropout and Flatten.

Defining also the type of loss function, optimizers and metrics to use.

Deep convolutional neural networks applied to muon tomography images 31 1

s

t

C

O

M

A simple keras model for Muon Tomography C

H

A

S

c

h

o

o

l

Model fitting

Definition of number of epochs, batch, shuffling, etc.

Deep convolutional neural networks applied to muon tomography images 32 1

s

t

C

O

M

Training of the network C

H

A

S

c

h

➔ o It is important to monitor the training process to make sure there are no: o

l

➔ Overfiting problems: The model is too complex. “Learning random noise”.

➔ Bias problems: The model is too simple. “Not catching all correlations”.

In this example 70% of images for training and 30% of images for testing.

Deep convolutional neural networks applied to muon tomography images 33 1

s

t

C

O

M

Training of the network C

H

A

S

c

h

➔ o It is important to monitor the training process to make sure there are no: o

l

➔ Overfiting problems: The model is too complex. “Learning random noise”.

➔ Bias problems: The model is too simple. “Not catching all correlations”.

A little bit of overfitting

In this example 70% of images for training and 30% of images for testing.

Deep convolutional neural networks applied to muon tomography images 34 1

s

t

C

O

M

Final results: having a look at the confusion matrix C

H

A

S

c

h

➔ o Use the test sample to evaluate the performance of your classifier. o

l

➔ In about 82% of the cases the answer provided by the CNN is correct.

Deep convolutional neural networks applied to muon tomography images 35 1

s

t

C

O

M

Final results: having a look at the confusion matrix C

H

A

S

c

h

➔ o Use the test sample to evaluate the performance of your classifier. o

l

➔ In about 82% of the cases the answer provided by the CNN is correct.

A resolution of about 2 mm (granularity of the training) can be claimed !!!!

Deep convolutional neural networks applied to muon tomography images 36 1

s

t

C

O

M

Going beyond classification C

H

A

S

c

h

➔ o Can we solve the “Inverse Problem” and the classification in just one go? o

l

➔ Need to think about the nature of a probabilistic Inverse Problem.

Deterministic Inverse Problem Probabilistic Inverse Problem

⃗y=⃗f (⃗x;θ⃗) ⃗y∼ pdf (⃗x ;θ⃗)

A pair of x and θ does not determine y.

A pair of x and θ completely determines y. Only distributions of many (x, y) can do it.

Loss function can use differences between y and f. Loss functions involving these distributions or

estimators on these distributions.

⃗ ⃗ Loss= g(h ( y , x ;θ⃗),h ( y , x ;⃗θ),...) Loss=∑ g(‖⃗yi−f (⃗x ;θ)‖) ∑ 1 ⃗ ⃗ 2 ⃗ ⃗ i i

Index “i” running on events. Index “i” running on measurements of many events.

Deep convolutional neural networks applied to muon tomography images 37 1

s

t

C

O

M

Going beyond classification: quantile distributions. C

H

A

S

c

h

o

➔ Consider the quartiles of distributions of the following parameters as input to DNN o

l

➔ Entrance position and direction of the muon. (x, y)

➔ Deviation in position and direction as measured by second muon. (x,y)

➔ Products of these variables.

➔ Consider the density of every voxel as the output of the DNN.

Paper in preparation

Deep convolutional neural networks applied to muon tomography images 38 1

s

t

C

O

M

Conclusions C

H

A

S

c

h

o

o ➔ Convolutional Neural Networks are a very powerful tool to classify images. l

➔ They can be easily applied to many problems in science and the industry.

➔ I have shown an application in the context of muon tomography.

➔ All using standard tools and not many more than 100 lines of code.

➔ However some advices when dealing with these technologies:

➔ They are not always a/the best solution to your problem. Don’t get obsessed.

➔ These solutions are easy to code but often very hard to understand.

➔ No general rules about what is the best structure → testing, testing, testing

Deep convolutional neural networks applied to muon tomography images 39 1

s

t

C

O

M

C

H

A

S

c

h

o

o

l

Thanks

Muon Tomography Systems SL www.muon.systems Av. Altos Hornos de Vizcaya 33 48901 Barakaldo (Bizkaia)

Deep convolutional neural networks applied to muon tomography images 40 1

s

t

C

O

M

C

H

A

S

c

h

o

o

l

BACKUP

Deep convolutional neural networks applied to muon tomography images 41 1

s

t

C

O

M

Application to vulcanology C

H

A

S

Monitoring of Vesuvious vulcano. c

h

o

o

https://doi.org/10.1098/rsta.2018.0050 l

Only 1 scintillator detector.

Exposure time ~ year.

Dinamic studies on magma convenction.

Monitoring of Asama & Iwujima vulcanos. https://doi.org/10.1098/rsta.2018.0142 Deep convolutional neural networks applied to muon tomography images 42 1

s

t

C

O

M

Application to mineral mines. https://doi.org/10.1098/rsta.2018.0061 C

H

A

S

Search for uranium/lead clusters in McArthur River (Canada) and Pend Oreille (USA) c

h

o

o Canadian Private company: l

CRM Geotomography Technologies, Inc.,

Grid of scintillator detectors in the galleries.

Underground mapping for pipe location.

https://doi.org/10.1098/rsta.2018.0133 Israel Private company:

Lingacom S.L,

Cylindrical-scintillator detectors.

Deep convolutional neural networks applied to muon tomography images 43 1

s

t

C

O

M

Application to archeology/civil engineering. C

H

A

S

c

Search for hidden galleries in Mount Echia (Bourbon Tunnel) h

o

o https://doi.org/10.1098/rsta.2018.0057 l

Only 1 scintillator detector.

Exposure time ~ 26 days.

Monitoring of the dome of Santa Maria del Fiore. https://doi.org/10.1098/rsta.2018.0136

One of the only scattering-based applications in civil engineering.

Two drift tube chambers located outside and inside the dome.

Deep convolutional neural networks applied to muon tomography images 44 1

s

t

C

O

M

Application to border security. C

H

A

Truck inspection using cosmic muons. https://doi.org/10.1098/rsta.2018.0051 S

c

h

o

o Using CMS-like chambers at Torino. l

For this application: 4 chambers.

Detection of a 7cmx7cmx7cm lead box.

Decision Science

First commercial system.

First contract in Singapur to install portal.

Multi-technology detection portal.

https://decisionsciences.com/

Deep convolutional neural networks applied to muon tomography images 45 1

s

t

C

O

M

Application to the nuclear industry. C

H

A

Nuclear waste characterization. S

c

h

o

o

Lynkeos Technology Ltd (University of Glasgow) l

UK Nuclear Decommissioning Authority.

Commercial Scintillator detector. https://doi.org/10.1098/rsta.2018.0048

Fuel cask monitoring.

Exposure times of about 7 hours.

Effective detection of missing fuel.

https://doi.org/10.1098/rsta.2018.0052 Deep convolutional neural networks applied to muon tomography images 46