# Surrogate Model for Linear Accelerator: A fast Neural Network approximation of ThomX's simulator

Emmanuel Goutierre, Christelle Bruni, Johanne Cohen, Hayg Guler, Michèle Sebag

► To cite this version:

Emmanuel Goutierre, Christelle Bruni, Johanne Cohen, Hayg Guler, Michèle Sebag. Surrogate Model for Linear Accelerator: A fast Neural Network approximation of ThomX's simulator. IPAC 2023 - 14th International Particle Accelerator Conference, May 2023, Venice, Italy. JACoW Publishing, JACoW, IPAC2023, pp.4514-4517, 2023, 10.18429/JACoW-IPAC2023-THPL039 . hal-04396183

HAL Id: hal-04396183

https://hal.science/hal-04396183v1

Submitted on 15 Jan 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
## GOAL

Design a new fast-executing, physics-aware surrogate model of ThomX, expected to:

1. Quickly estimate the behavior of the beam, depending on the setting;

2. Efficiently support the surrogate optimization

3. Accommodate the wide variability of settings and beams corresponding to the diversity observed on an in-commissioning machine

<figure><img src="image_1.png" /></figure>

Applied to the ThomX's Linac, a Compton X-ray source in commissioning at Orsay, France

## HOW TO MODELIZE

<figure><img src="image_2.png" /></figure>

Modular Neural Network architecture base on physical description of the machine

<figure><img src="image_3.png" /></figure>

The beam is handled with a PointNet¹-like architecture (particle-based representation)

## HOW TO LEARN

* Each module $m_i$ predicts the distribution at the next diagnostic given:

* $d_{i-1}$ : previous distribution

* $a_i$ : value of the control setting

* $\theta_i$ : eight of the neural network

* Modules can be combined to represents a sub-part of the machine:

$$f_{i,j}(d_i, a; \theta) = m_j(m_{j-1}(\cdots(m_{i+1}(d_i, a_{i+1}; \theta_{i+1}), a_{i+2}; \theta_{i+2})\cdots), a_j; \theta_j)$$

* The final loss is the weighted combination of these predictions:

$$\mathcal{L}_{\alpha}(d, a; \theta) = \sum_{i=1}^{N} \sum_{j=i+1}^{N} \alpha_{i,j} \| f_{i,j}(d_i, a_i; \theta) - d_j \|_2^2$$

### WEIGHTING STRATEGY ($\alpha_{i,j}$)

- Equal weights : Each combination of the modules is deemed equally important

- End-to-End : Only the $\alpha_{0,j}$ are considered

- Independent : Each module $m_i$ is learnt independently

- MGDA² (Multiple Gradient Descent Analysis) : Dynamic weighting of the module that moderates conflicting loss between modules

## RESULTS

<figure><img src="image_4.png" /></figure>

The simulated point cloud is the result of the simulation up to the end of the Linac of a misaligned machine with suboptimal control parameters.

The resulting beam is a bi-modal, truncated beam in the transverse phase space

LinacNet accurately reproduces the beam distribution at the end of the Linac, despite very deteriorated conditions

Simulation

Prediction

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

The surrogate model successfully recovers the properties of the beam.

The projections of the predicted beam (red histogram) match those of

the simulated beam (green histogram)

## PERSPECTIVES

- SURROGATE OPTIMIZATION: Validate the performance of the surrogate model with the optimization task

- MODULARITY: An evolution of the machine only need an evolution of the corresponding modules

- REALITY GAP: The large sampling domain is well-suited to handle the gap between simulation and real-world machines

## REFERENCES

[1] C. R. Qi, H. Su, K. Mo, and L. J. Guibas, "Pointnet: Deep learning on point sets for 3d classification and segmentation," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.

[2] O. Sener and V. Koltun, "Multi-task learning as multi-objective optimization", in Advances in Neural Information Processing Systems, pages 527–538, 2018.

<figure><img src="image_8.png" /></figure>