Status: Archive (code is provided as-is, no updates expected)
Constrained Collaborative Optimization of Charged Particle Tracking with Multi-Agent Reinforcement Learning
Tobias Kortus, Ralf Keidel, Nicolas R. Gauger and Jan Kieseler, on behalf of the Bergen pCT collaboration
The repository contains the official PyTorch implementation for the paper "Constrained Collaborative Optimization of Charged Particle Tracking with Multi-Agent Reinforcement Learning", extending the previously published RL code for particle tracking.
Reinforcement learning demonstrated immense success in modeling complex physics-driven systems, providing end-to-end trainable solutions by interacting with a simulated or real environment, maximizing a scalar reward signal. In this work, we propose, building upon previous work, an end-to-end multi-agent reinforcement learning approach with assignment constraints for reconstructing particle tracks in pixelated particle detectors. Our approach optimizes collaboratively a parametrized policy, functioning as a heuristic to a multidimensional assignment problem, by jointly minimizing the total amount of particle scattering over the reconstructed tracks in a readout frame. To satisfy constraints, guaranteeing a unique assignment of particle hits, we propose a safety layer solving a linear assignment problem for every joint action. Further, to enforce cost margins, increasing the distance of the local policies predictions to the decision boundaries of the optimizer mappings, we recommend the use of an additional component in the blackbox gradient estimation, forcing the policy to solutions with lower total assignment costs. We empirically show on simulated data, generated for a particle detector developed for proton imaging, the effectiveness of our approach, compared to multiple single- and multi-agent baselines. We further demonstrate the effectiveness of constraints with cost margins for both optimization and generalization, introduced by wider regions with high reconstruction performance as well as reduced predictive instabilities. Our results form the basis for further developments in RL-based tracking, offering both enhanced performance with constrained policies and greater flexibility in optimizing tracking algorithms through the option for individual and team rewards.
conda create --name marl python=3.10
conda activate marl
conda env update --file=environment.ymlFor reproducibility we provide the user with the exact Monte-Carlo simulations used throughout the paper. All simulations can be downloaded from Zenodo and extracted using the following command (the downloaded archive should be copied into the data/ directory):
tar -xf data.tar.gz --strip-components 1Note: The files
data/comparison/results_water{100, 150, 200}.csvcontain the processed reconstruction performances for the heuristic search approach by Pettersen et al. The source code can be found under [1].
Note: Please note that the following instructions are provided for Linux operating systems. Some commands may vary for different operating systems.
Similarly we provide the pretrained weights and results of all evaluated network variants used throughout the paper. All model artifacts can be downloaded from Zenodo. The model data can be extracted in a similar fashion using:
tar -xf models.tar.gz --strip-components 1All experiments with the corresponding hyperparameters parameters, performed in the paper, are documented as .json files. An experiment, with the provided models, can be re-run using the following commands:
python policy_evaluation.py -e experiments/****.json -t rl -d ****-e: Experiment definition file. Either one of the predefined experiments in theexperiments/directory or a custom definition following the json structure of the existing experiments.-t: Experiment definition file.rl(reinforcement learning)-d: Computation device that should be used by pytorch (cpu, cuda:1-N)
All code used for analyzing the trained models and loss landscape analysis are archived in the reporting/ directory. A list of all scripts as well as a summary of the data generated is provided in the following script cells.
All compute-intensive results required to generate the following tables and figures are pre-computed and stored in the models/ directory. If needed, this data can be regenerated using the reporting/generate_*.py scripts. For re-running parts of the evaluation (including model training), the relevant files/directories need to be removed.
python reporting/generate_tables.py #Tables 2& 3The additional required results for post-training centralized PPO can be recreated by running
python reporting/generate_centralized_results.pyreporting/plot_policy_entropies.py #Figure 5python reporting/plot_reward_surfaces.py #Figures6& 7python reporting/generate_reward_surfaces.pypython reporting/plot_similarities.py #Figures 8& 9python reporting/generate_similarities.py python reporting/ablation_lsap_runtimes.py #Figure 10python reporting/ablation_parameter_nu.py #Figure 11python reporting/plot_corrupted_seeding.py #Figure 12If you find this repository useful for your research, please cite the following work.
@article{Kortus_2026,
doi = {10.1088/2632-2153/ae352b},
url = {https://doi.org/10.1088/2632-2153/ae352b},
year = {2026},
month = {jan},
publisher = {IOP Publishing},
volume = {7},
number = {1},
pages = {015021},
author = {Kortus, Tobias and Keidel, Ralf and Gauger, Nicolas R and Kieseler, Jan and on behalf of the Bergen pCT Collaboration},
title = {Constrained collaborative optimization of charged particle tracking with multi-agent reinforcement learning},
journal = {Machine Learning: Science and Technology}
}