11institutetext:  Rudolf Peierls Centre for Theoretical Physics, Clarendon
Laboratory, Parks Road, University of Oxford, OX1 3PU, UK 22institutetext:
CERN, Theoretical Physics Department, CH-1211 Geneva 23, Switzerland

# Leveraging universality of jet taggers through transfer learning

Frédéric A. Dreyer 11 Radosław Grabarczyk 11 Pier Francesco Monni 22

###### Abstract

A significant challenge in the tagging of boosted objects via machine-learning
technology is the prohibitive computational cost associated with training
sophisticated models. Nevertheless, the universality of QCD suggests that a
large amount of the information learnt in the training is common to different
physical signals and experimental setups. In this article, we explore the use
of transfer learning techniques to develop fast and data-efficient jet taggers
that leverage such universality. We consider the graph neural networks LundNet
and ParticleNet, and introduce two prescriptions to transfer an existing
tagger into a new signal based either on fine-tuning all the weights of a
model or alternatively on freezing a fraction of them. In the case of
$W$-boson and top-quark tagging, we find that one can obtain reliable taggers
using an order of magnitude less data with a corresponding speed-up of the
training process. Moreover, while keeping the size of the training data set
fixed, we observe a speed-up of the training by up to a factor of three. This
offers a promising avenue to facilitate the use of such tools in collider
physics experiments.

###### pacs:

12.38.-tQuantum Chromodynamics, Machine Learning

##  1 Introduction

The tagging of energetic heavy particles through machine learning methods is
one of the key technical challenges at the Large Hadron Collider. Such
identification techniques are used to search for new-physics signatures (see
e.g. Refs. Collins:2018epr ; Heimel:2018mkt ; DeSimone:2018efk ;
DAgnolo:2018cun ; Collins:2019jip ; Aguilar-Saavedra:2020uhm ;
Kasieczka:2021xcg ; Karagiorgi:2021ngt ), or to study the properties of
Standard Model particles Radovic:2018dip , notably to identify boosted
electroweak bosons deOliveira:2015xxd ; Barnard:2016qma ; Louppe:2017ipp ;
CMS:2020poo , the Higgs boson Lin:2018cin ; Lim:2018toa ; Datta:2019ndh ;
Moreno:2019neq ; Chakraborty:2019imr ; Khosa:2021cyk ; Cavallini:2021vot ;
Qu:2022mxj , or to assign jet flavour Almeida:2015jua ; Guest:2016iqz ;
Komiske:2016rsd ; ATLAS:2017dfg ; Kasieczka:2017nvn ; Butter:2017cot ;
ATLAS:2017gpy ; CMS:2017wtu ; Cheng:2017rdo ; Macaluso:2018tck ;
Moreno:2019bmu ; Andreassen:2020nkr ; ATLAS:2020jip ; Kasieczka:2020nyd ;
dAgnolo:2021aun ; Romero:2021qlf ; Dreyer:2021hhr . The most challenging
scenario is the one in which such heavy objects decay into hadronic jets, in
which case the ability to identify them from the decay products is seriously
challenged by the overwhelming background arising from QCD jets. Provided one
has a robust theoretical control over such background processes, the use of
pattern-recognition methods from computer science can help construct novel
taggers with a significantly improved performance with respect to analytic
discriminants (see e.g. Ref. review ; reviewexperimental ; Larkoski_2020  for
recent reviews).

A large variety of methods has been proposed in recent years, achieving a
remarkable performance in discriminating signal from background in different
experimental measurements. These are based on several types of techniques,
which span from the use of theory-motivated observables such as energy-flow
polynomials Komiske:2017aww , convolutional neural networks deOliveira:2015xxd
and graph networks Qu:2019gqs  that use four-momenta as input variables. Among
the more recent tools, LundNet LundNet  combines the performance of the state
of the art graph networks with theory-motivated kinematic input variables,
namely the Lund jet plane Andersson:1988gp  of emissions within a jet
Dreyer:2018nbf .

In the application of machine learning technology to jet tagging, a first
challenge is represented by the robust assessment of the theoretical
uncertainty in a given model. This is dominated by the dependence of the
model’s ability to discriminate a given signal from the QCD background on the
underlying simulation that is used in the training. A precise control over
these effects demands the development of more accurate event generators, a
task that is receiving significant attention in the literature (see e.g. Refs.
Hamilton:2013fea ; Alioli:2013hqa ; Hoeche:2014aia ; Monni:2019whf ;
Monni:2020nks ; Alioli:2021qbf ; Campbell:2021svd ; Prestel:2021vww ;
Hoche:2017hno ; Dasgupta:2018nvj ; Bewick:2019rbu ; Dasgupta:2020fwr ;
Forshaw:2020wrq ; Nagy:2020rmk  and references therein for some recent
developments). A second outstanding challenge is reducing the high
computational cost of training sophisticated models, which besides the
generation of large samples of events also usually requires running on GPUs
for several days. In consequence, the training of such taggers requires
computational resources not always in the reach of their potential users.
Moreover, the models are highly dependent on the experimental signal (e.g. $W$
vs. top-quark tagging) as well as on the choice of experimental cuts which
makes the training of a tagger for specific experimental needs from scratch
highly inefficient. The physical picture suggests, however, that most of the
information learnt by a tagger is related to the description of the QCD
splittings that occur within a jet, which simply encode universal properties
of QCD rather than features that depend on the underlying experimental signal.
It has been demonstrated multiple times in the past that early layers of a
deep convolutional network extract general features from the data, and can
thus be potentially reused for new tasks DBLP:journals/corr/abs-1808-01974 .
In the present short article we examine the latter aspect of jet tagging, and
we tackle the problem by applying inductive transfer learning techniques
articletransfer  to leverage an existing model for a new application to a
different experimental signature. As a result, we will discuss the
construction of computationally efficient jet taggers that can achieve high
performance also when trained on a small fraction of the original data set,
with a significant reduction in the computational complexity associated with
the training. The article is structured as follows. In Sec. 2 we briefly
review the graph neural network LundNet that we adopt for our studies, and
discuss the underlying description of jets in terms of Lund jet plane
declusterings. In Sec. 3 we then introduce two transfer-learning procedures
that allow one to train a new signal starting from an existing model trained
on a different tagging problem. These techniques are then applied to the
problem of top tagging in Sec. 4, where we study in detail the performance of
transfer learning between top taggers with different transverse-momentum cuts
and from a $W$ tagger to a top tagger. Subsequently, we present an analysis of
the computational advantages of transfer learning procedures over training new
models from scratch. In Sec. 5 we discuss our conclusions.

##  2 Graph neural networks in the Lund plane

The Lund jet plane Dreyer:2018nbf  is a useful theoretical framework to
represent the internal kinematics of a jet by means of Lund diagrams
Andersson:1988gp . To define it, one starts by constructing the Cambridge-
Aachen Dokshitzer:1997in ; Wobisch:1998wt  clustering sequence using the
constituents of the jet, which carries out a sequential pair-wise
recombination of the two proto-jets with the smallest angular separation in
rapidity-azimuth. One maps this clustering sequence to a tree of Lund
declusterings, each of which encodes the kinematic properties of the
corresponding clustering step. Each declustering $p_{i}\to p_{a},p_{b}$ can be
parametrised in terms of the following set of variables:

$\displaystyle\Delta$ $\displaystyle\equiv\Delta_{ab},\quad k_{t}\equiv
p_{Tb}\Delta_{ab},\quad m^{2}\equiv(p_{a}+p_{b})^{2},$ $\displaystyle z$
$\displaystyle\equiv\frac{p_{Tb}}{p_{Ta}\\!+\\!p_{Tb}},\quad\psi\equiv\tan^{-1}\frac{y_{b}\\!-\\!y_{a}}{\phi_{b}\\!-\\!\phi_{a}},$
(1)

where $p_{a}$, $p_{b}$ are the post-branching momenta with their transverse
momenta ordered such that $p_{Tb}<p_{Ta}$,
$\Delta_{ab}=\sqrt{(y_{a}-y_{b})^{2}+(\phi_{a}-\phi_{b})^{2}}$ (with $y$ and
$\phi$ denoting the rapidity and azimuth, respectively), $\psi$ is an
azimuthal angle around the subjet axis, and $z$ is the transverse momentum
fraction of the branching. The construction of the Lund jet plane can be
schematically understood with the help of Fig. 1. The (primary) Lund plane
associated with the initial proto-jet represents a two-dimensional
parametrisation of the phase space available to further radiation from it.
This is indicated by the large (blue) triangle in the $\ln k_{t}-\ln 1/\Delta$
plane in Fig. 1. Each subsequent primary emission along the hard branch of the
tree is shown in red, and it forms a new leaf of the Lund plane, from which
secondary emissions will be radiated, indicated by orange leaves. The
procedure iterates through all branches of the clustering history, leading to
a complete representation of the jet’s substructure. In particular, the
structure of the primary Lund jet plane can be computed accurately with
perturbative methods Lifson:2020gua  and measured experimentally ATLAS:2020bbn
.

LundNet dreyer2021jet  is a graph neural network which takes the Lund jet
plane as input to train efficient and robust jet taggers. The resulting
taggers outperform tools with low-level inputs dreyer2021jet  and are
relatively resilient to non-perturbative and detector effects given an
appropriate choice of cuts in the Lund plane.

Figure 1: A graphic representation of the Lund plane for the radiation within
a jet. The blue triangle represents the primary Lund plane, with secondary and
tertiary Lund planes shown in red and orange, respectively.

The jet is mapped into a graph whose nodes represent the declustering steps of
the Cambridge-Aachen history, parametrised in terms of tuples
$\mathcal{T}^{(i)}$ containing the kinematic variables defined in Eq. (2). In
particular, one can define two versions of the LundNet network based on the
dimensionality of the input tuple, defined as follows:

$\displaystyle{\rm\texttt{LundNet3}:}\quad$
$\displaystyle\mathcal{T}^{(i)}=\\{k_{t}^{(i)},\Delta^{(i)},z^{(i)}\\}\,,$ (2)
$\displaystyle{\rm\texttt{LundNet5}{}:}\quad$
$\displaystyle\mathcal{T}^{(i)}=\\{k_{t}^{(i)},\Delta^{(i)},z^{(i)},m^{(i)},\psi^{(i)}\\}\,.$
(3)

The edges of the graph correspond to the structure of the Cambridge-Aachen
tree.

The LundNet5 network contains more kinematic information for each declustering
node, and therefore results in a higher tagging efficiency. Conversely, the
LundNet3 network has been shown to be more resilient to non-perturbative and
detector effects dreyer2021jet , while having an efficiency similar to state-
of-the-art taggers.

The core of the graph architecture relies on an EdgeConv operation DGCNN ,
which applies a multi-layer perceptron (MLP) to produce a learned edge
feature, using combined features of node pairs along each edge as input. This
shared MLP consists of two layers, each with a dense network, batch
normalisation DBLP:journals/corr/IoffeS15  and ReLU activation glorot2011deep
. This is followed by an aggregation step which takes an element-wise average
of the learned edge features along the edges. The model also includes a
shortcut connection he2016deep . The same MLP is applied to each node,
updating all node features while keeping the structure of the graph itself
unchanged. The LundNet architecture consists of six successive EdgeConv
blocks, with the number of channels for each MLP pair in the block given by
$(32,32)$, $(32,32)$, $(64,64)$, $(64,64)$, $(128,128)$ and $(128,128)$. Their
final output is concatenated, and processed by a MLP with 384 channels, to
which a global average pooling is applied to extract information from all
nodes in the graph. This is followed by a fully connected layer with 256 units
and a dropout layer with rate 10%. A final softmax output provides the result
of the classification. This model is implemented with the Deep Graph Library
0.5.3 wang2020deep  and the PyTorch 1.7.1 NEURIPS2019_9015  backend, using an
Adam optimiser DBLP:journals/corr/KingmaB14  to minimise the cross entropy
loss. The LundNet architecture is summarised in figure 2a. Training is
performed for 30 epochs using an initial learning rate of 0.001, which is
lowered by a factor 10 after the 10th and 20th epochs.

The architecture of LundNet is based on a similar graph neural network,
ParticleNet Qu:2019gqs , which also provides excellent performance on LHC
classification tasks, and we will use it as one of the benchmarks in our study
below in comparison to LundNet.

Figure 2: A flowchart representing the LundNet architecture and the transfer
learning procedure employed in this article.

##  3 Transfer learning

In this section we briefly discuss the application of transfer learning
techniques to the design of jet taggers. Transfer learning aims at reusing
pre-trained models on new problems, leveraging the knowledge obtained on a
similar task to improve the training of a new model, for example by using some
or all of the weights of an existing pre-trained neural network as starting
point.

Transfer learning has seen a wide range of applications, notably in language
processing and computer vision 5288526 ; DBLP:journals/corr/abs-1911-02685 .
While earlier data-based approaches to transfer learning focused on domain
adaptation DBLP:journals/corr/abs-0907-1815 ; li-etal-2012-cross , there has
been a surge of interest in recent years in adapting deep learning models to
new tasks DBLP:journals/corr/abs-1808-01974 . The two main avenues to achieve
this goal is either through the retraining of a deep neural network while
freezing the weights of its initial layers DBLP:journals/corr/YosinskiCBL14 ,
or through the fine-tuning of the model DBLP:journals/corr/GirshickDDM13 ;
10.5555/3044805.3044879 ; 10.1145/2818346.2830593 . While most existing
applications are based on convolutional or recurrent neural networks, the
development of deep learning on graph structured data has also seen advances
in transfer learning applied on graph neural networks
DBLP:journals/corr/abs-1905-12265 ; 10.5555/3298483.3298550 .

In the context of machine learning applications to jet physics, one could
expect that different taggers rely on a certain amount of information that is
common to different tasks. Concretely, the properties of QCD that define the
radiation pattern inside a boosted jet stemming from the QCD background is
largely identical within different taggers, and further commonalities can be
identified among signals with a similar number of prongs produced by the
resonance decay inside a (fat) jet. This suggests that jet physics is an ideal
area for the application of transfer learning methods. On the practical side,
this would allow for the design of new models/taggers starting from a pre-
existing one, not necessarily trained on the same task. The main advantage of
transfer learning would then be the considerably reduced computational cost
associated with the training of the new model, which does not need to be built
from scratch for every new task.

A first important question is the extent to which a network is transferable,
i.e. whether the transferred model is capable of reaching a performance that
is as close as possible to the fully trained model with just a fraction of the
computing resources. A general answer to this question requires a thorough
investigation of the features of a given network that are connected to a
higher transferability, and this goes beyond the scope of this article. Here
we instead take a first step in this direction, and consider the two graph
neural networks which have been discussed in the previous section. Of these,
ParticleNet relies on the information carried by the full four momenta of the
jet constituents, whereas the LundNet models essentially map the
Cambridge/Aachen sequence of a jet into its own Lund jet plane. The latter
representation encodes the kinematic information at each of the branchings in
the fragmentation process, which in turn is to a large extent universal across
taggers and depends mainly on the properties of QCD near the soft and/or
collinear limits. A second interesting property of the Lund jet plane is that
QCD (background) jets roughly have a uniform density of emissions in the Lund
jet plane, and hence this structure can be learnt very effectively by a neural
network such as LundNet. Both of the above properties are expected to
facilitate transfer learning in that the input variables on which LundNet
relies already highlight universal properties of QCD jets and allow the
network to distinguish them from those of typical signal jets stemming from
the decay of a boosted heavy object. For this reason, our expectation is that
transfer learning reaches a rather good performance in the context of this
class of models. On the other hand, in the case of ParticleNet, the model
needs to learn the non-trivial mapping between the information carried by the
final-state four momenta used as input, to the physical fragmentation process
of the jet. This ends up adding an additional layer of complexity in the
training of the network, which is expected to be reflected in a lower
performance of the models trained via transfer learning.

In order to explore the transferability of the models adopted in this article,
we consider two different approaches to inductive transfer learning. Our first
transfer-learning approach is a frozen-layer model. Here the weights of the
EdgeConv layers of LundNet or ParticleNet have been pre-trained on a separate
jet sample and are kept fixed during the retraining process. The final MLP
layers are instead reinitialised to random weights and retrained on a new
sample to specialise the tagger to this new pattern recognition task. This
procedure is shown in figure 2b, and the training on a new data set is
performed with the same learning rate and scheduler as the training for the
original model. The second approach is a fine-tuning of all the weights in the
original tagger. In this case, the learning rate is reduced by a factor ten
(or a factor three when transferring from a $W$ to a top tagger), and the
tagger is retrained with the same number of epochs and scheduler on a new data
set.

The difference in performance between the transferred models and those trained
from scratch probes the ability of a network to learn features that are common
to different tasks and therefore its suitability to the application of
transfer learning techniques. Moreover, the difference between the frozen-
layer and fine-tuning procedures probes how much of the high-level information
learnt by a network is extracted from the initial layers, which provides
insights on the extrapolating ability of each model.

##  4 Case study with top tagging

As a case study, we consider the application to top-quark tagging at the LHC.
We are interested in discriminating top-quark jets with $p_{T}>500$ GeV
against the QCD background. We apply and analyse the properties of transfer
learning for four different models, LundNet3 and its transfer from a top-
tagger with $p_{T}>2$ TeV, LundNet5 and its transfer from either a top-tagger
with $p_{T}>2$ TeV or a $W$-boson tagger with $p_{T}>500$ GeV, and finally
ParticleNet and its transfer from a top-tagger with $p_{T}>2$ TeV. All models
presented in this section are trained with events generated using Pythia 8.223
pythia , considering jets defined according to the anti-$k_{t}$ algorithm
Cacciari_2008  with a jet radius $R=0.8$ and rapidity $|y|<2.5$. Signal events
are obtained from the simulation of either $WW$ or $t\bar{t}$ production, with
$W$ bosons decaying hadronically, while the background sample is obtained from
QCD dijet events. The signal and background training data sets consist of
$5\times 10^{5}$ events each. Validation and testing is done on data sets of
$5\times 10^{4}$ events for each of the signal and background process.111The
data is available at https://github.com/JetsGame/data

We start by discussing the reduction in computational complexity that can be
achieved through the use of transfer learning techniques, and then provide a
phenomenological study of top tagging performance for each model.

###  4.1 Computational complexity of transferred models

As described in section 3, we consider two transfer learning approaches to
retrain an existing jet tagger, a frozen layer model and a fine-tuning model.
In this section, we aim to investigate the computational cost of both
approaches. For this we consider the construction of a top tagger for $500$
GeV jets, starting from a model trained on $2$ TeV data. The training time was
measured on a NVIDIA GeForce RTX 2080 Ti GPU, training a tagger on either
$10^{6}$ or $10^{5}$ total top and QCD jets with an equal number of signal and
background events. We measure the time required to train a LundNet5 and
ParticleNet model,222The training time for both LundNet5 and LundNet3 is
almost identical. given in milliseconds per sample and epoch (which is
identical for both the $10^{6}$ and $10^{5}$ samples) as well as the
corresponding total training time for both data sizes. These measurements are
summarised in Tab. 1.

x

Table 1: Training time for different taggers. The time was measured when
running the models on an NVIDIA GeForce RTX 2080 Ti card. Note that LundNet5
transferred from a top tagger with $p_{T}>2$ TeV, when trained on a data set
10 times smaller, still performs better than ParticleNet in terms of AUC (see
Tab. 2) despite the time of training being significantly reduced.

|  | Training time |  | Total for $10^{6}$ samples |  | Total for $10^{5}$ samples
---|---|---|---|---|---|---
|  | [ms/sample/epoch] |  | [hh:mm:ss] |  | [hh:mm:ss]
LundNet5 |  | 0.46 |  | 03:48:15 |  | 00:22:43
LN5${}_{\text{frozen}}$ |  | 0.15 |  | 01:17:02 |  | 00:07:36
LN5${}_{\text{finetuning}}$ |  | 0.46 |  | 03:48:32 |  | 00:22:45
ParticleNet |  | 3.60 |  | 30:09:44 |  | 02:59:17
PN${}_{\text{frozen}}$ |  | 2.16 |  | 18:13:21 |  | 01:47:37
PN${}_{\text{finetuning}}$ |  | 3.60 |  | 29:59:46 |  | 03:01:04

All models were trained for 30 epochs, regardless of their convergence, shown
in Fig. 3 for the full data sample.

Figure 3: Validation accuracy as a function of the number of training epochs.

The figure shows the convergence for the two sample cases of LundNet5 (in
blue) and ParticleNet (in orange). The solid lines show the evolution for
models trained from scratch, the dashed lines refer to the fine-tuning
transfer learning setup (trained using a ten-times smaller initial learning
rate of $10^{-4}$), and finally the dotted lines refer to the frozen-layer
transfer learning setup. One observes here that, in practice, the transferred
models approach an optimum at a much faster rate, with the fine-tuning setup
converging sooner to higher values of the validation accuracy. This implies
that such models could be trained for only a few epochs to further reduce the
computational cost.

The fine-tuning model does not provide any noticeable speed-up in training
time, as it requires the update of all the weights in the network. However, as
we will see in section 4.2, it can achieve comparable performance to a full
model with only a small fraction of the data. As such, if one uses a tenth of
the full data sample, this effectively provides a factor of ten speed-up in
training time. Moreover, as already pointed out, the convergence of the model
is significantly faster, and requires only a few epochs to converge to an
optimal solution, hence providing an opportunity for further optimisation of
the training time.

Conversely, the frozen-layer approach has the advantage of reducing the
computational cost of the retraining by limiting the update of the weights to
the final dense layers, while keeping the EdgeConv blocks unchanged. This
results in a reduction of the training time by about a factor of three
compared to that of a full model on the same data sample. As for the fine-
tuning model, a further reduction can be achieved by reducing the number of
epochs and the size of the data set. However, as will be discussed in section
4.2, the frozen layer model requires a larger data sample than the fine-tuning
approach to achieve comparable performance.

###  4.2 Performance of top taggers

We now study the performance of our top taggers, using the area under the ROC
curve (AUC) as an indicator of a model’s performance, and summarise our
results in Tab. 2.

Table 2: Benchmarks for top tagging with $p_{T}>500\textrm{ GeV}$. The different columns show the AUC for the different transfer learning models considered in the text, where FT denotes the fine-tuning option, FR denotes the frozen-layer option, and the $(10\%)$ superscript refers to results obtained with just one tenth of the original training data. | AUC | AUCFT | AUCFR | AUC(10%) | AUC${}_{\rm FT}^{(10\%)}$ | AUC${}_{\rm FR}^{(10\%)}$
---|---|---|---|---|---|---
LundNet3 (from top 2 TeV) | 0.9820 | 0.9820 | 0.9816 | 0.9773 | 0.9802 | 0.9791
LundNet5 (from top 2 TeV) | 0.9866 | 0.9865 | 0.9863 | 0.9826 | 0.9850 | 0.9845
LundNet5 (from $W$ 500 GeV) | - | 0.9863 | 0.9858 | - | 0.9834 | 0.9832
ParticleNet (from top 2 TeV) | 0.9826 | 0.9826 | 0.9793 | 0.9765 | 0.9795 | 0.9772

For each model, we consider the AUCs corresponding to a training from scratch
(indicated by AUC in the table), transfer learning with a fine-tuning setup
(indicated by AUCFT), and transfer learning with a frozen-layer setup
(indicated by AUCFR). For the above three options, we also consider the values
of the AUC obtained with $10\%$ of the original training data (denoted by
AUC(10%) in Tab. 2). We find that, in the case of LundNet models trained in
the full data set, the fine-tuning setup reproduces exactly the AUC of the
model trained from scratch. We also observe that the frozen option, despite
being considerably cheaper from a computational viewpoint, leads to AUC values
which are extremely close to those of the above models, indicating that
LundNet models are very suitable for the application of transfer learning as
discussed in the previous section. We also consider the more demanding
transfer of a LundNet5 $W$ tagger to a top tagger at the same 500 GeV $p_{T}$
threshold. We can see from the AUC values shown in Tab. 2 that while a
moderate loss of performance is found for the model trained on the reduced
data set, we still recover AUC values for the transferred top tagger that are
very close to the fully trained LundNet5 model, and significantly better than
most state-of-the-art taggers.

In the case of ParticleNet, the fine-tuning setup still performs as well as
the model trained from scratch while the frozen setup leads to visibly smaller
AUC values. As expected, this indicates that ParticleNet is less suitable for
the application of transfer learning. This is due to the fact that it relies
on low-level information, such as four momenta, which makes it less easy to
identify general properties of the kinematic pattern of QCD already in early
layers of the network. For models trained on $10\%$ of the original training
data set, we observe that in the case of LundNet3 and LundNet5, the values of
AUC obtained with transfer learning models are hardly affected by the
reduction in sample size, and they still perform nearly as well as the
original models trained on the full data set. For ParticleNet the performance
of the models obtained through transfer learning is instead closer to that of
the model trained (from scratch) on the reduced data set, in line with our
expectation that this class of models is less transferable. We also show the
dependence of the AUC on the total (signal plus background) size of the
training data set in Fig. 4. The figure shows that transfer learning gives a
significant advantage for small sizes of the training data set. For example,
the retrained LundNet5 model with the fine-tuning setup and $1.25\times
10^{4}$ events for signal and background data sets achieves AUC $=0.983$,
meaning that state-of-the-art performance can be achieved using far smaller
data sets than those needed to train a network from scratch, with a
considerable speed-up of the process. Concretely, when retraining with
$2.5\times 10^{4}$ samples, the training time is almost two orders of
magnitude smaller than that needed to train a similarly performing LundNet
model from scratch. Importantly, the difference between the fully trained
model and the fine-tuning and frozen-layer transfer learning setups is rather
moderate in the case of LundNet5, which indicates that such class of models
have rather high transferability and they can easily be retrained on a
different task. In the case of ParticleNet, we observe that the fine-tuning
setup still produces AUC values higher than those of the model fully trained
on smaller data sets, although it does not reach the tagging accuracy observed
for LundNet5. Moreover, Fig. 4 also shows that the performance of ParticleNet
gets significantly worse when using the frozen-layer setup, with the fully
trained model outperforming the transfer learning results already for a
training done on $10^{5}$ events, while LundNet5 reaches almost the asymptotic
values of AUC for this data sample (see also Tab. 2). Overall, this clearly
shows that the use of transfer learning provides a promising avenue to reduce
the amount of data required to train new taggers, with certain classes of
models such as LundNet being more suitable for the application of these
techniques. Whether it is possible to define a metric quantifying a priori the
ability of a model to be transferred to a different task with reduced
computational resources than those needed for a full training, and how to
construct better taggers with such features remain interesting open questions.

Figure 4: Area under the ROC curve as a function of the total signal and
background training data set size.

We now move on to study the ROC curves corresponding to the different models
in Fig. 5, showing the background rejection $1/\varepsilon_{\textrm{QCD}}$
versus signal efficiency, $\varepsilon_{\textrm{Top}}$. A better performing
tagger has a corresponding ROC curve closer to the top-right corner of the
figure. The upper panel shows the ROC corresponding to the models LundNet3,
LundNet5 and ParticleNet all trained from scratch for a top tagger with
$p_{T}>500$ GeV. We observe that, as expected, LundNet5 performs better than
the other two models, which achieve a very similar performance. This is due to
the additional information stored in the tuples associated with each node of
the graph (see Eq. (3)). The second panel of Fig. 5 shows the ROC obtained
with LundNet5 and different transfer learning options from a top tagger with
$p_{T}>2$ TeV, divided by the ROC of the model trained from scratch (shown in
the upper panel). The dashed blue line corresponds to the fine-tuning setup in
which all weights are re-trained on the new task. This option clearly
reproduces the performance of the tagger trained from scratch, but as already
observed before it does not lead to any reduction of the computational
complexity associated with the training. The dotted blue line, instead,
corresponds to the transfer learning obtained with the frozen-layer setup
which, as already observed in Tab. 2, leads to a performance that is very
close to that of the original model, with an AUC less than a permille below
the full model, and background rejection at intermediate signal efficiencies
within 20% of the fully trained tagger. This performance remains far better
than most state-of-the-art jet taggers, and orders of magnitude above analytic
substructure discriminants.

The remaining three panels in Fig. 5 show a similar comparison in the case of
LundNet3 and ParticleNet models transferred from a top tagger with $p_{T}>2$
TeV, and LundNet5 models transferred from a $W$-boson tagger with $p_{T}>500$
GeV. For the fine-tuned $W$, the initial learning rate is set to $3\cdot
10^{-4}$ to allow for a larger perturbation of the pre-trained top model. All
of the above four panels also report, in red, the result obtained with a
reduced training data set of $10\%$ of the original size, i.e. $10^{5}$
events, with either the fine-tuning (dashed) or frozen-layer (dotted) setup.
For LundNet, the plot confirms the conclusions drawn from the AUC study above,
showing that these models (both for LundNet3 and LundNet5) still reach the
performance of state-of-the-art taggers also in the transfer learning setups,
with the frozen-layer setup being only moderately less accurate than the
computationally more demanding fine-tuning. While it is clearly easier to
transfer a model from a similar tagger trained on a different kinematic
regime, we see that transfer learning still reaches highly competitive ROC
curves also when the starting model is a $W$ tagger, shown in the last panel
of Fig. 5, which demonstrates that the techniques studied in this article can
be adopted across wide families of jet taggers. As already observed,
ParticleNet, shown in the fourth panel of Fig. 5, performs less well under the
transfer learning setups, with a wider gap between the fine-tuning and frozen-
layer options.

In general, from Fig. 5 we conclude that the retrained models achieve
performances which are extremely close to the models trained from scratch,
meaning that the output of EdgeConv operations is a representation of the data
which can be efficiently reused for other tasks. The benefits of transfer
learning then consist of a significantly shorter training time and a smaller
data set size required to converge on an efficient tagger.

Figure 5: QCD rejection vs. Top tagging efficiency.

All models in the above comparison have been trained for 30 epochs. We stress
once again that the computational cost can be reduced further by exploiting
the fact that transferred LundNet models converge to an optimum with less
epochs, as discussed above in Fig. 3.

##  5 Conclusions

In this article, we have explored the use of transfer learning methods to
train efficient jet taggers from existing models. With this, we aimed to
investigate the ability of a neural network to learn universal features of QCD
and to transfer them to a separate task. In practice, we have considered the
application of transfer learning to top tagging at different transverse
momentum thresholds and to the tagging of two- and three-pronged boosted
objects, e.g. $W$ boson and top quark decays. We studied two jet taggers
constructed from graph neural networks, LundNet and ParticleNet, and conducted
a detailed study of the performance of transferred models as well as of the
reduction in computational complexity provided by transfer learning.

We have implemented two transfer-learning procedures. The first one relies on
fine-tuning all weights in a model by retraining it on a new data sample with
a lower learning rate, while the second freezes the edge convolutions and
retrains solely the final dense layers of the network. In the case of LundNet
taggers, we find that the fine-tuning approach requires a similar training
time per epoch and sample as the fully trained model, but converges to an
almost optimal solution after just a few epochs (compared to tens of epochs
for a full model) and requires only a small fraction of the data. Concretely,
a model can achieve nearly the same performance using a third of the epochs
and a tenth of the original training sample, which leads to a dramatic speed-
up of the training process. On the other hand, the frozen-layer method
provides a further speed-up in training time by a factor three as only a small
fraction of the model weights are updated, but requires a comparatively larger
sample size to achieve a similar performance to the fine-tuning approach.

For the two specific LundNet taggers considered (LundNet3 and LundNet5, which
differ in the dimensionality of the kinematic inputs associated with each node
of the graph), we observe that fine-tuning with a tenth of the data achieves a
background rejection moderately lower than that of a fully trained model, with
the transferred LundNet3 tagger recovering slightly more of the performance of
the baseline model. The frozen-layer approach performs comparably, although in
both LundNet3 and LundNet5 it achieves slightly lower background rejection for
the same training sample than the fine-tuning method.

The conclusions are somewhat different for ParticleNet, where the frozen-layer
method performs noticeably worse than the fine-tuning approach, regardless of
the amount of data and number of epochs. Furthermore, the background rejection
that can be achieved with a reduced data set is significantly smaller. We
attribute this to the fact that ParticleNet relies on kinematic information
structured as the four momenta of the jet constituents, which in turn makes it
more challenging for the EdgeConv layers to extract general features about the
jet fragmentation. In comparison, LundNet uses kinematic information of the
sequential clustering steps of the Cambridge/Aachen algorithm as input, which
carries denser information about the jet fragmentation dynamics. This is
reflected in a larger gap between the fine-tuning and frozen-layer approaches
in the ParticleNet case.

Our results show that transfer learning constitutes a promising avenue to
build computationally efficient and versatile taggers with state-of-the-art
performance. This opens a wide array of possibilities for more wide-spread
adoption of machine learning jet-tagging technology for experimental studies
at colliders, such as the Large Hadron Collider and future facilities. This
article provides a first step towards this goal, and motivates further
investigations on the application of these methods to particle phenomenology.
In this context, a number of interesting theoretical questions arise. As
future directions, it would be informative to study concrete metrics of
transferability of a network, and which features of the input variables and
choices in the architecture of a model can lead to more transferable designs.
Furthermore, it would be interesting to study knowledge transfer in jet
taggers from first principles, and gain analytical insights into the behaviour
of transferred models Kasieczka_2020 ; Dreyer:2021hhr .

## Acknowledgments

We are grateful to Alexander Huss for constructive comments and collaboration
in the early stages of this work, and to Stefano Carrazza and Huilin Qu for
valuable comments on the manuscript. This work was supported by a Royal
Society University Research Fellowship (URF$\backslash$R1$\backslash$211294)
(FD), and by the CERN’s Summer Student Programme (RG).

## References

  * (1) J. H. Collins, K. Howe, and B. Nachman, Anomaly Detection for Resonant New Physics with Machine Learning. Phys. Rev. Lett. 121 (2018) no. 24, 241803, arXiv:1805.02664 [hep-ph].
  * (2) T. Heimel, G. Kasieczka, T. Plehn, and J. M. Thompson, QCD or What? SciPost Phys. 6 (2019) no. 3, 030, arXiv:1808.08979 [hep-ph].
  * (3) A. De Simone and T. Jacques, Guiding New Physics Searches with Unsupervised Learning. Eur. Phys. J. C 79 (2019) no. 4, 289, arXiv:1807.06038 [hep-ph].
  * (4) R. T. D’Agnolo and A. Wulzer, Learning New Physics from a Machine. Phys. Rev. D 99 (2019) no. 1, 015014, arXiv:1806.02350 [hep-ph].
  * (5) J. H. Collins, K. Howe, and B. Nachman, Extending the search for new resonances with machine learning. Phys. Rev. D 99 (2019) no. 1, 014038, arXiv:1902.02634 [hep-ph].
  * (6) J. A. Aguilar-Saavedra, F. R. Joaquim, and J. F. Seabra, Mass Unspecific Supervised Tagging (MUST) for boosted jets. JHEP 03 (2021) 012, arXiv:2008.12792 [hep-ph]. [Erratum: JHEP 04, 133 (2021)].
  * (7) G. Kasieczka et al., The LHC Olympics 2020 a community challenge for anomaly detection in high energy physics. Rept. Prog. Phys. 84 (2021) no. 12, 124201, arXiv:2101.08320 [hep-ph].
  * (8) G. Karagiorgi, G. Kasieczka, S. Kravitz, B. Nachman, and D. Shih, Machine Learning in the Search for New Fundamental Physics. arXiv:2112.03769 [hep-ph].
  * (9) A. Radovic, M. Williams, D. Rousseau, M. Kagan, D. Bonacorsi, A. Himmel, A. Aurisano, K. Terao, and T. Wongjirad, Machine learning at the energy and intensity frontiers of particle physics. Nature 560 (2018) no. 7716, 41–48.
  * (10) L. de Oliveira, M. Kagan, L. Mackey, B. Nachman, and A. Schwartzman, Jet-images — deep learning edition. JHEP 07 (2016) 069, arXiv:1511.05190 [hep-ph].
  * (11) J. Barnard, E. N. Dawe, M. J. Dolan, and N. Rajcic, Parton Shower Uncertainties in Jet Substructure Analyses with Deep Neural Networks. Phys. Rev. D 95 (2017) no. 1, 014018, arXiv:1609.00607 [hep-ph].
  * (12) G. Louppe, K. Cho, C. Becot, and K. Cranmer, QCD-Aware Recursive Neural Networks for Jet Physics. JHEP 01 (2019) 057, arXiv:1702.00748 [hep-ph].
  * (13) CMS Collaboration, A. M. Sirunyan et al., Identification of heavy, energetic, hadronically decaying particles using machine-learning techniques. JINST 15 (2020) no. 06, P06005, arXiv:2004.08262 [hep-ex].
  * (14) J. Lin, M. Freytsis, I. Moult, and B. Nachman, Boosting $H\to b\bar{b}$ with Machine Learning. JHEP 10 (2018) 101, arXiv:1807.10768 [hep-ph].
  * (15) S. H. Lim and M. M. Nojiri, Spectral Analysis of Jet Substructure with Neural Networks: Boosted Higgs Case. JHEP 10 (2018) 181, arXiv:1807.03312 [hep-ph].
  * (16) K. Datta, A. Larkoski, and B. Nachman, Automating the Construction of Jet Observables with Machine Learning. Phys. Rev. D 100 (2019) no. 9, 095016, arXiv:1902.07180 [hep-ph].
  * (17) E. A. Moreno, T. Q. Nguyen, J.-R. Vlimant, O. Cerri, H. B. Newman, A. Periwal, M. Spiropulu, J. M. Duarte, and M. Pierini, Interaction networks for the identification of boosted $H\rightarrow b\overline{b}$ decays. Phys. Rev. D 102 (2020) no. 1, 012010, arXiv:1909.12285 [hep-ex].
  * (18) A. Chakraborty, S. H. Lim, and M. M. Nojiri, Interpretable deep learning for two-prong jet classification with jet spectra. JHEP 07 (2019) 135, arXiv:1904.02092 [hep-ph].
  * (19) C. K. Khosa and S. Marzani, Higgs boson tagging with the Lund jet plane. Phys. Rev. D 104 (2021) no. 5, 055043, arXiv:2105.03989 [hep-ph].
  * (20) L. Cavallini, A. Coccaro, C. K. Khosa, G. Manco, S. Marzani, F. Parodi, D. Rebuzzi, A. Rescia, and G. Stagnitto, Tagging the Higgs boson decay to bottom quarks with colour-sensitive observables and the Lund jet plane. arXiv:2112.09650 [hep-ph].
  * (21) H. Qu, C. Li, and S. Qian, Particle Transformer for Jet Tagging. arXiv:2202.03772 [hep-ph].
  * (22) L. G. Almeida, M. Backović, M. Cliche, S. J. Lee, and M. Perelstein, Playing Tag with ANN: Boosted Top Identification with Pattern Recognition. JHEP 07 (2015) 086, arXiv:1501.05968 [hep-ph].
  * (23) D. Guest, J. Collado, P. Baldi, S.-C. Hsu, G. Urban, and D. Whiteson, Jet Flavor Classification in High-Energy Physics with Deep Neural Networks. Phys. Rev. D 94 (2016) no. 11, 112002, arXiv:1607.08633 [hep-ex].
  * (24) P. T. Komiske, E. M. Metodiev, and M. D. Schwartz, Deep learning in color: towards automated quark/gluon jet discrimination. JHEP 01 (2017) 110, arXiv:1612.01551 [hep-ph].
  * (25) ATLAS Collaboration, Quark versus Gluon Jet Tagging Using Jet Images with the ATLAS Detector.
  * (26) G. Kasieczka, T. Plehn, M. Russell, and T. Schell, Deep-learning Top Taggers or The End of QCD? JHEP 05 (2017) 006, arXiv:1701.08784 [hep-ph].
  * (27) A. Butter, G. Kasieczka, T. Plehn, and M. Russell, Deep-learned Top Tagging with a Lorentz Layer. SciPost Phys. 5 (2018) no. 3, 028, arXiv:1707.08966 [hep-ph].
  * (28) ATLAS Collaboration, Identification of Jets Containing $b$-Hadrons with Recurrent Neural Networks at the ATLAS Experiment.
  * (29) CMS Collaboration, A. M. Sirunyan et al., Identification of heavy-flavour jets with the CMS detector in pp collisions at 13 TeV. JINST 13 (2018) no. 05, P05011, arXiv:1712.07158 [physics.ins-det].
  * (30) T. Cheng, Recursive Neural Networks in Quark/Gluon Tagging. Comput. Softw. Big Sci. 2 (2018) no. 1, 3, arXiv:1711.02633 [hep-ph].
  * (31) S. Macaluso and D. Shih, Pulling Out All the Tops with Computer Vision and Deep Learning. JHEP 10 (2018) 121, arXiv:1803.00107 [hep-ph].
  * (32) E. A. Moreno, O. Cerri, J. M. Duarte, H. B. Newman, T. Q. Nguyen, A. Periwal, M. Pierini, A. Serikova, M. Spiropulu, and J.-R. Vlimant, JEDI-net: a jet identification algorithm based on interaction networks. Eur. Phys. J. C 80 (2020) no. 1, 58, arXiv:1908.05318 [hep-ex].
  * (33) A. Andreassen, B. Nachman, and D. Shih, Simulation Assisted Likelihood-free Anomaly Detection. Phys. Rev. D 101 (2020) no. 9, 095004, arXiv:2001.05001 [hep-ph].
  * (34) ATLAS Collaboration, Deep Sets based Neural Networks for Impact Parameter Flavour Tagging in ATLAS.
  * (35) G. Kasieczka, S. Marzani, G. Soyez, and G. Stagnitto, Towards Machine Learning Analytics for Jet Substructure. JHEP 09 (2020) 195, arXiv:2007.04319 [hep-ph].
  * (36) R. T. d’Agnolo, G. Grosso, M. Pierini, A. Wulzer, and M. Zanetti, Learning New Physics from an Imperfect Machine. arXiv:2111.13633 [hep-ph].
  * (37) A. Romero, D. Whiteson, M. Fenton, J. Collado, and P. Baldi, Safety of Quark/Gluon Jet Classification. arXiv:2103.09103 [hep-ph].
  * (38) F. Dreyer, G. Soyez, and A. Takacs, Quarks and gluons in the Lund plane. arXiv:2112.09140 [hep-ph].
  * (39) D. Guest, K. Cranmer, and D. Whiteson, Deep Learning and Its Application to LHC Physics. Annual Review of Nuclear and Particle Science 68 (2018) no. 1, 161–181, https://doi.org/10.1146/annurev-nucl-101917-021019. https://doi.org/10.1146/annurev-nucl-101917-021019.
  * (40) F. Van der Veken, G. Azzopardi, F. Blanc, L. Coyle, E. Fol, M. Giovannozzi, T. Pieloni, S. Redaelli, L. Rivkin, B. Salvachua, M. Schenk, R. Tomas, and G. Valentino, “Application of machine learning techniques at the CERN Large Hadron Collider,” 06, 2020.
  * (41) A. J. Larkoski, I. Moult, and B. Nachman, Jet substructure at the Large Hadron Collider: A review of recent advances in theory and machine learningPhysics Reports 841 (Jan, 2020) 1–63. http://dx.doi.org/10.1016/j.physrep.2019.11.001.
  * (42) P. T. Komiske, E. M. Metodiev, and J. Thaler, Energy flow polynomials: A complete linear basis for jet substructure. JHEP 04 (2018) 013, arXiv:1712.07124 [hep-ph].
  * (43) H. Qu and L. Gouskos, ParticleNet: Jet Tagging via Particle Clouds. Phys. Rev. D 101 (2020) no. 5, 056019, arXiv:1902.08570 [hep-ph].
  * (44) F. Dreyer and H. Qu, LundNet v1.0.0, Available at https://github.com/fdreyer/LundNet (2021/01/15).
  * (45) B. Andersson, G. Gustafson, L. Lonnblad, and U. Pettersson, Coherence Effects in Deep Inelastic Scattering. Z. Phys. C43 (1989) 625.
  * (46) F. A. Dreyer, G. P. Salam, and G. Soyez, The Lund Jet Plane. JHEP 12 (2018) 064, arXiv:1807.04758 [hep-ph].
  * (47) K. Hamilton, P. Nason, E. Re, and G. Zanderighi, NNLOPS simulation of Higgs boson production. JHEP 10 (2013) 222, arXiv:1309.0017 [hep-ph].
  * (48) S. Alioli, C. W. Bauer, C. Berggren, F. J. Tackmann, J. R. Walsh, and S. Zuberi, Matching Fully Differential NNLO Calculations and Parton Showers. JHEP 06 (2014) 089, arXiv:1311.0286 [hep-ph].
  * (49) S. Höche, Y. Li, and S. Prestel, Drell-Yan lepton pair production at NNLO QCD with parton showers. Phys. Rev. D 91 (2015) no. 7, 074015, arXiv:1405.3607 [hep-ph].
  * (50) P. F. Monni, P. Nason, E. Re, M. Wiesemann, and G. Zanderighi, MiNNLOPS: a new method to match NNLO QCD to parton showers. JHEP 05 (2020) 143, arXiv:1908.06987 [hep-ph].
  * (51) P. F. Monni, E. Re, and M. Wiesemann, MiNNLO${}_{\text{PS}}$: optimizing $2\rightarrow 1$ hadronic processes. Eur. Phys. J. C 80 (2020) no. 11, 1075, arXiv:2006.04133 [hep-ph].
  * (52) S. Alioli, C. W. Bauer, A. Broggio, A. Gavardi, S. Kallweit, M. A. Lim, R. Nagar, D. Napoletano, and L. Rottoli, Matching NNLO predictions to parton showers using N3LL color-singlet transverse momentum resummation in geneva. Phys. Rev. D 104 (2021) no. 9, 094020, arXiv:2102.08390 [hep-ph].
  * (53) J. M. Campbell, S. Höche, H. T. Li, C. T. Preuss, and P. Skands, Towards NNLO+PS Matching with Sector Showers. arXiv:2108.07133 [hep-ph].
  * (54) S. Prestel, Matching N3LO QCD calculations to parton showers. JHEP 11 (2021) 041, arXiv:2106.03206 [hep-ph].
  * (55) S. Höche, F. Krauss, and S. Prestel, Implementing NLO DGLAP evolution in Parton Showers. JHEP 10 (2017) 093, arXiv:1705.00982 [hep-ph].
  * (56) M. Dasgupta, F. A. Dreyer, K. Hamilton, P. F. Monni, and G. P. Salam, Logarithmic accuracy of parton showers: a fixed-order study. JHEP 09 (2018) 033, arXiv:1805.09327 [hep-ph].
  * (57) G. Bewick, S. Ferrario Ravasio, P. Richardson, and M. H. Seymour, Logarithmic accuracy of angular-ordered parton showers. JHEP 04 (2020) 019, arXiv:1904.11866 [hep-ph].
  * (58) M. Dasgupta, F. A. Dreyer, K. Hamilton, P. F. Monni, G. P. Salam, and G. Soyez, Parton showers beyond leading logarithmic accuracy. Phys. Rev. Lett. 125 (2020) no. 5, 052002, arXiv:2002.11114 [hep-ph].
  * (59) J. R. Forshaw, J. Holguin, and S. Plätzer, Building a consistent parton shower. JHEP 09 (2020) 014, arXiv:2003.06400 [hep-ph].
  * (60) Z. Nagy and D. E. Soper, Summations of large logarithms by parton showers. Phys. Rev. D 104 (2021) no. 5, 054049, arXiv:2011.04773 [hep-ph].
  * (61) C. Tan, F. Sun, T. Kong, W. Zhang, C. Yang, and C. Liu, “A survey on deep transfer learning,” in Artificial Neural Networks and Machine Learning – ICANN 2018, V. Kůrková, Y. Manolopoulos, B. Hammer, L. Iliadis, and I. Maglogiannis, eds., pp. 270–279.  Springer International Publishing, Cham, 2018.
  * (62) K. Weiss, T. Khoshgoftaar, and D. Wang, A survey of transfer learningJournal of Big Data 3 (05, 2016) .
  * (63) Y. L. Dokshitzer, G. Leder, S. Moretti, and B. Webber, Better jet clustering algorithms. JHEP 9708 (1997) 001, arXiv:hep-ph/9707323 [hep-ph].
  * (64) M. Wobisch and T. Wengler, Hadronization corrections to jet cross-sections in deep inelastic scattering. arXiv:hep-ph/9907280 [hep-ph].
  * (65) A. Lifson, G. P. Salam, and G. Soyez, Calculating the primary Lund Jet Plane density. JHEP 10 (2020) 170, arXiv:2007.06578 [hep-ph].
  * (66) ATLAS Collaboration, G. Aad et al., Measurement of the Lund Jet Plane Using Charged Particles in 13 TeV Proton-Proton Collisions with the ATLAS Detector. Phys. Rev. Lett. 124 (2020) no. 22, 222002, arXiv:2004.03540 [hep-ex].
  * (67) F. A. Dreyer and H. Qu, Jet tagging in the Lund plane with graph networks, 2021.  arXiv:2012.08526 [hep-ph].
  * (68) Y. Wang, Y. Sun, Z. Liu, S. E. Sarma, M. M. Bronstein, and J. M. Solomon, Dynamic Graph CNN for Learning on Point CloudsACM Trans. Graph. 38 (Oct., 2019) 146.
  * (69) S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in Proceedings of the 32nd International Conference on Machine Learning, vol. 37, pp. 448–456.  PMLR, Lille, France, 07–09 Jul, 2015.  http://proceedings.mlr.press/v37/ioffe15.html.
  * (70) X. Glorot, A. Bordes, and Y. Bengio, “Deep sparse rectifier neural networks,” in Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, vol. 15, pp. 315–323.  PMLR, Fort Lauderdale, FL, USA, 11–13 Apr, 2011.  http://proceedings.mlr.press/v15/glorot11a.html.
  * (71) K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778.  IEEE, Las Vegas, NV, USA, 2016.
  * (72) M. Wang, D. Zheng, Z. Ye, Q. Gan, M. Li, X. Song, J. Zhou, C. Ma, L. Yu, Y. Gai, T. Xiao, T. He, G. Karypis, J. Li, and Z. Zhang, Deep Graph Library: A Graph-Centric, Highly-Performant Package for Graph Neural Networks, 2020.  arXiv:1909.01315 [cs.LG].
  * (73) A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala, “Pytorch: An imperative style, high-performance deep learning library,” in Advances in Neural Information Processing Systems 32, H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. Fox, and R. Garnett, eds., pp. 8024–8035.  Curran Associates, Inc., 2019.
  * (74) D. P. Kingma and J. Ba, Adam: A Method for Stochastic Optimization. CoRR abs/1412.6980 (2014) , arXiv:1412.6980. http://arxiv.org/abs/1412.6980.
  * (75) S. J. Pan and Q. Yang, A Survey on Transfer Learning. IEEE Transactions on Knowledge and Data Engineering 22 (2010) no. 10, 1345–1359.
  * (76) F. Zhuang, Z. Qi, K. Duan, D. Xi, Y. Zhu, H. Zhu, H. Xiong, and Q. He, A Comprehensive Survey on Transfer Learning. CoRR abs/1911.02685 (2019) , 1911.02685. http://arxiv.org/abs/1911.02685.
  * (77) H. D. III, Frustratingly Easy Domain Adaptation. CoRR abs/0907.1815 (2009) , 0907.1815. http://arxiv.org/abs/0907.1815.
  * (78) F. Li, S. J. Pan, O. Jin, Q. Yang, and X. Zhu, “Cross-domain co-extraction of sentiment and topic lexicons,” in Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 410–419.  Association for Computational Linguistics, Jeju Island, Korea, July, 2012\.  https://aclanthology.org/P12-1043.
  * (79) J. Yosinski, J. Clune, Y. Bengio, and H. Lipson, How transferable are features in deep neural networks? CoRR abs/1411.1792 (2014) , 1411.1792. http://arxiv.org/abs/1411.1792.
  * (80) R. B. Girshick, J. Donahue, T. Darrell, and J. Malik, Rich feature hierarchies for accurate object detection and semantic segmentation. CoRR abs/1311.2524 (2013) , 1311.2524. http://arxiv.org/abs/1311.2524.
  * (81) J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell, “Decaf: A deep convolutional activation feature for generic visual recognition,” in Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML’14, p. I–647–I–655.  JMLR.org, 2014.
  * (82) H.-W. Ng, V. D. Nguyen, V. Vonikakis, and S. Winkler, “Deep learning for emotion recognition on small datasets using transfer learning,” in Proceedings of the 2015 ACM on International Conference on Multimodal Interaction, ICMI ’15, p. 443–449.  Association for Computing Machinery, New York, NY, USA, 2015.  https://doi.org/10.1145/2818346.2830593.
  * (83) W. Hu, B. Liu, J. Gomes, M. Zitnik, P. Liang, V. S. Pande, and J. Leskovec, Pre-training Graph Neural Networks. CoRR abs/1905.12265 (2019) , 1905.12265. http://arxiv.org/abs/1905.12265.
  * (84) J. Lee, H. Kim, J. Lee, and S. Yoon, “Transfer learning for deep learning on graph-structured data,” in Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, AAAI’17, p. 2154–2160.  AAAI Press, 2017.
  * (85) T. Sjöstrand, S. Ask, J. Christiansen, R. Corke, N. Desai, P. Ilten, S. Mrenna, S. Prestel, C. Rasmussen, and P. Skands, An introduction to PYTHIA 8.2. Computer Physics Communications 191 (2015) 159–177.
  * (86) M. Cacciari, G. P. Salam, and G. Soyez, The anti-$k_{t}$ jet clustering algorithmJournal of High Energy Physics 2008 (Apr, 2008) 063–063. http://dx.doi.org/10.1088/1126-6708/2008/04/063.
  * (87) G. Kasieczka, S. Marzani, G. Soyez, and G. Stagnitto, Towards machine learning analytics for jet substructureJournal of High Energy Physics 2020 (Sep, 2020) . http://dx.doi.org/10.1007/JHEP09(2020)195.


# Beam Dynamics Framework Incorporating Acceleration to Define the Minimum
Aperture in Two Focusing Schemes for Proton Radiotherapy Linac

M. Southerby<EMAIL_ADDRESS>R. Apsimon
<EMAIL_ADDRESS>Engineering Department, Lancaster University,
Lancaster, LA1 4YW, UK  Cockcroft Institute, Daresbury Laboratory, Warrington,
WA4 4AD, UK

###### Abstract

In this paper, a self-consistent transverse beam dynamics framework is
demonstrated, that incorporates acceleration into the transverse beam dynamics
studies for a proton linac machine. Two focusing schemes are developed and
discussed; the FODO-like scheme, and the minimum aperture scheme. The FODO-
like scheme is a simple scheme, requiring only one quadrupole per cavity. The
scheme is analytically solved to minimise the beam size at the cavity
entrance/exit and ensures a constant beam size along the lattice, with respect
to adiabatic damping due to longitudinally accelerating rf cavities. The
minimum aperture scheme describes the regime that matches the beam ellipse to
the acceptance ellipse of a cavity, allowing for the smallest possible
aperture, for a given cavity length. A simple approximation of an rf cavity
map is determined to allow changes in particle energy along a lattice, and
acceleration is assumed only in the longitudinal direction.

##  I Introduction

In the recent decades, all-linac solutions for proton acceleration with
medical applications have become an increasing area of interest future_linacs
. Two areas to have benefited from such improvements are cancer radiotherapy
and medical imaging radio ; imaging . All-linac solutions have benefits over
the conventional cyc-linac and synchrotron machines with respect to energy and
intensity modulated on the scale of ms. This allows for more efficient
treatment of cancers with proton beams, such as active spot scanning for
moving organs pbs . In addition to advantages to radiotherapy, linac boosters
can be used in conjunction with cyc-linac or all-linac solutions to push
proton energy to 350 MeV, the energy required for medical imaging
imaging_proton . Proton medical imaging allows a more accurate calculation of
the required proton energy during radiotherapy, over conventional X-ray
imaging, due to the proton stopping power.

All-linac machines benefit from a smaller beam emittance than cyc-linac
machines, and therefore can operate with smaller beam apertures, increasing
the shunt impedance. Limits are often placed on the beam aperture due to the
transverse focusing requirements of the linac, in addition to peak fields and
power coupling.

This paper describes the method used to minimise the beam aperture with
respect to transverse beam losses, for a given cavity length, analytically.
The paper will discuss two focusing schemes, namely the FODO-like scheme, and
the Minimum Aperture Scheme (MAS), incorporating longitudinal momentum gain.
The FODO-like scheme is similar to the well-known FODO scheme, comprised of
quadrupole of alternating polarity to produce a net focusing force
transversely. The MAS scheme produces a matching section that aligns the
transverse beam ellipse with the cavity acceptance ellipse. An RF cavity
transfer map is produced to simulate longitudinal acceleration of protons, and
the corresponding adiabatic damping that occurs as a result. Due to the very
low beam currents used in proton radiotherapy linacs (of the order nA), space-
charge effects are ignored.

The Twiss parameter transfer matrix is adapted to account for the change in
beam emittance due to acceleration. The method requires minimising the Twiss
beta function, $\beta$, at the cavity entrance and exit to minimise the beam
aperture for a given cavity length and beam emittance, whilst ensuring maximum
beam acceptance.

##  II Twiss Parameters with Acceleration

The phase space ellipse of a particle in a periodic beam line, with geometric
emittance $\varepsilon_{g,x}$, is described;

$\varepsilon_{g,x}=\beta_{x}x^{\prime
2}+2\alpha_{x}xx^{\prime}+\gamma_{x}x^{2}.$ (1)

Where $\beta_{x}$, $\alpha_{x}$ and
$\gamma_{x}=\frac{1+\alpha_{x}^{2}}{\beta_{x}}$ are the Twiss parameters in
$x$ wolski . $x$ is the transverse size of the beam, and
$x^{\prime}=\frac{dx}{ds}$ = $\frac{p_{x}}{p_{z}}$ for longitudinal
displacement, $s$. The maximum beam size at any point $s$, is given
$\sigma=x_{max}=\sqrt{\beta(s)\varepsilon_{g}(s)}$.

It is required to use the Lorentz invariant normalised emittance, defined as
$\varepsilon_{n}=\varepsilon_{g}(s)\gamma_{r}(s)\beta_{r}(s)$ wolski . Where
$\gamma_{r}(s),\beta_{r}(s)$ are the Lorentz factor and normalised particle
velocity, respectively. Using Eqn. 1 to equate the normalised emittance of a
particle before and after an rf cavity;

$\begin{aligned} \gamma_{r0}\beta_{r0}(\beta_{x1}x_{1}^{\prime
2}+2\alpha_{x1}x_{1}x_{1}^{\prime}+\gamma_{x1}x_{1}^{2})=\\\
\gamma_{r1}\beta_{r1}(\beta_{x0}x_{0}^{\prime
2}+2\alpha_{x0}x_{0}x_{0}^{\prime}+\gamma_{x0}x_{0}^{2})\end{aligned},$ (2)

where $\gamma_{r0}\beta_{r0}$ and $\gamma_{r1}\beta_{r1}$ are the Lorentz
factor and normalised particle velocity at the start and end of the cavity,
respectively. The cavity can be described with a linear transfer map, $R$.

$\begin{pmatrix}x_{1}\\\
x^{\prime}_{1}\end{pmatrix}=\begin{pmatrix}R_{11}&R_{12}\\\
R_{21}&R_{21}\end{pmatrix}\begin{pmatrix}x_{0}\\\
x^{\prime}_{0}\end{pmatrix}.$ (3)

Assuming only longitudinal acceleration, the divergence before and after the
cavity is given;

$x_{1}^{\prime}=\frac{\Delta p_{x}+x_{0}^{\prime}p_{z0}}{p_{z1}},$ (4)

where $\Delta p_{x}$ can be determined from Lorentz force, for a particle of
charge $q$, longitudinal velocity $\beta_{z}c$, and at azimuthal angle,
$\theta$;

$\Delta p_{x}=q\cos\left(\theta\right)\left(\frac{\int
E_{r}dz}{\beta_{rz}c}+\int B_{\theta}dz\right).$ (5)

In an azimuthally symmetric cylindrical cell, the radial electric field
($E_{r}$) and azimuthal magnetic field ($B_{\theta}$) can be written as
functions of the longitudinal electric field, $E_{z}$, using a first order
expansion about $r=0$;

$E_{r}=-\frac{r}{2}\frac{dE_{z}}{dz},\hskip 14.22636ptB_{\theta}=\frac{\omega
r}{2c^{2}}E_{z}.$ (6)

Where $\omega$ is the angular frequency. A typical $E_{z}$ field component can
be written as a Fourier series matt_fc2ct , with the most simple case being;

$E_{z}=\sin\left(\frac{\pi z}{L_{cell}}\right)\sin\left(\omega
t+\phi_{0}\right),$ (7)

for a given cell length, $L_{cell}$. $\phi_{0}$ represents the mean phase over
the cavity. The value of $E_{z}$ as observed by a particle at constant
velocity can be determined by substituting $t=\frac{z}{\beta_{z}c}$ into Eqn.
7.

Using equations 7, 6, 5 and 4 produces an approximation for $x_{1}^{\prime}$;

$x_{1}^{\prime}=\frac{N\pi}{4p_{z1}}\left(\beta_{rz0}-\frac{1}{\beta_{rz0}}\right)\sin(\phi_{0})x_{0}+\frac{p_{z0}}{p_{z1}}x_{0}^{\prime}.$
(8)

Where $N$ is the number of rf cells in the rf cavity, and $NL_{cell}=L_{cav}$.
Integrating Eqn. 8 over the cavity length produces a similar form for $x_{1}$.
The final result of the cavity map is shown below;

$\begin{pmatrix}x_{1}\\\
x^{\prime}_{1}\end{pmatrix}=\begin{pmatrix}1+\frac{N\pi}{4}\left(\beta_{rz0}-\frac{1}{\beta_{rz0}}\right)\sin(\phi_{0})L^{\prime}&\gamma_{r0}\beta_{rz0}mcL^{\prime}\\\
\frac{N\pi}{4\gamma_{rs}\beta_{rz1}mc}\left(\beta_{rz0}-\frac{1}{\beta_{rz0}}\right)\sin(\phi_{0})&A_{d}\end{pmatrix}\begin{pmatrix}x_{0}\\\
x^{\prime}_{0}\end{pmatrix}.$ (9)

Where,

$L^{\prime}=\frac{L_{cav}}{\Delta\gamma\cos(\phi_{0})mc}\biggl{(}\cosh^{-1}({\gamma_{r0}+\Delta\gamma\cos(\phi_{0})})-\\\
\cosh^{-1}(\gamma_{r0})\biggr{)},$ (10)

with $\Delta\gamma=\gamma_{r1}-\gamma_{r0}$, and

$A_{d}=\left({{1+\Delta\gamma_{r}\cos(\phi_{0})\frac{\Delta\gamma_{r}\cos(\phi_{0})+2\gamma_{r0}}{\gamma_{r0}^{2}-1}}}\right)^{-1/2}.$
(11)

To proceed, the rf phase is chosen such that longitudinal acceleration is
maximised, and defocusing forces are minimised, $\phi_{0}=0$, as these are the
conditions of the ideal particle

$\begin{pmatrix}x_{1}\\\
x^{\prime}_{1}\end{pmatrix}=\begin{pmatrix}1&L_{cav}\frac{\gamma_{r0}\beta_{rz0}}{\gamma_{r1}-\gamma_{r0}}ln\left(\frac{\gamma_{r1}\beta_{rz1}+\gamma_{r1}}{\gamma_{r0}\beta_{rz0}+\gamma_{r0}}\right)\\\
0&\frac{\gamma_{r0}\beta_{rz0}}{\gamma_{r1}\beta_{rz1}}\end{pmatrix}\begin{pmatrix}x_{0}\\\
x^{\prime}_{0}\end{pmatrix}.$ (12)

The Twiss parameter transfer matrix can be derived by substituting
$x_{0},x_{0}^{\prime}$ as functions of $x_{1},x_{1}^{\prime}$ (using the
inverse form for Eqn. 3) into Eqn. 2.

$\begin{pmatrix}\beta_{x1}\\\ \alpha_{x1}\\\ \gamma_{x1}\end{pmatrix}=\\\
\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}\begin{pmatrix}R_{11}^{2}&-2R_{11}R_{12}&R_{12}^{2}\\\
-R_{11}R_{21}&R_{11}R_{22}+R_{12}R_{21}&-R_{12}R_{22}\\\
R_{21}^{2}&-2R_{21}R_{22}&R_{22}^{2}\end{pmatrix}\\\
\begin{pmatrix}\beta_{x0}\\\ \alpha_{x0}\\\ \gamma_{x0}\end{pmatrix}.$ (13)

The Twiss parameter transfer matrix takes on the recognised form for zero
acceleration, when $\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}=1$, as
expected.

The basic start point has now been established, with a simple cavity transfer
map, and the Twists parameter transfer matrix incorporating acceleration.

##  III FODO-like Scheme

The aim of the FODO-like scheme is to analytically provide the quadrupole
$k$-strength and length such that the beam size is minimised at the cavity
entrance/exit, producing the smallest beam aperture possible for a given
chosen cavity length.

The lattice starts at a location such that the Twiss alpha function is $0$ in
both transverse planes;

$\alpha_{x0}=\alpha_{y0}=0.$ (14)

It is arbitrarily chosen;

$\beta_{x}=\text{Max},\hskip 5.69054pt\beta_{y}=\text{Min}.$ (15)

The focusing scheme is a periodic array of the following elements,
constructing the FODO cell;

$[\text{Half-FQ}][\text{Drift}][\text{DQ}][\text{Drift}][\text{Half-FQ}].$
(16)

It is convenient to split the FODO cell into half FODO cells, where the split
is at some point within the DQ such that $\alpha_{x1}=\alpha_{y1}=0$. For zero
acceleration, the split is at the mid-point. The drift sections are replaced
with cavity sections, sandwiched between short drift lengths, of length
$l_{g}$, to closer approximate a realistic beam line. The half focusing
quadrupoles are described with length $l_{q1,2}$ (where the second index (2)
refers to the quadrupole being the second half of a complete quadrupole) and
strength $k_{1}$, as shown in Fig. 1. For now, the second quadrupole index is
dropped ($l_{q1,2}=l_{q1}$).

Figure 1: FODO-like schematic.

The half FODO cell in the $x$ plane is thus;

$M=[\text{Half-FQ}][\text{Drift}][\text{Cavity}][\text{Drift}][\text{Half-
DQ}].$ (17)

Explicitly, the transfer map is as follows;

$\\\
M=\begin{pmatrix}\cosh(\sqrt{k_{2}}l_{q2})&\frac{1}{\sqrt{k_{2}}}\sinh(\sqrt{k_{2}}l_{q2})\\\
\sqrt{k_{2}}\sinh(\sqrt{k_{2}}l_{q2})&\cosh(\sqrt{k_{2}}l_{q2})\\\
\end{pmatrix}\\\ \begin{pmatrix}1&L_{eff}\\\
0&\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}\end{pmatrix}\\\
\begin{pmatrix}\cos(\sqrt{k_{1}}l_{q1})&\frac{1}{\sqrt{k_{1}}}\sin(\sqrt{k_{1}}l_{q1})\\\
-\sqrt{k_{1}}\sin(\sqrt{k_{1}}l_{q1})&\cos(\sqrt{k_{1}}l_{q1})\\\
\end{pmatrix}.$ (18)

Where the [Drift][Cavity][Drift] matrix have been multiplied together, and,

$\displaystyle
L_{eff}=l_{g}\left(\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}+1\right)+$
(19) $\displaystyle
l_{cav}\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}-\gamma_{r0}}ln\left(\frac{\gamma_{r1}\beta_{r1}+\gamma_{r1}}{\gamma_{r0}\beta_{r0}+\gamma_{r0}}\right).$

Using Eqn. 13 to transform the Twiss parameters due to transfer map M from
$\alpha_{x0}=0$ to $\alpha_{x1}=0$,

$0=-M_{11}M_{21}\beta_{x0}-\frac{M_{12}M_{22}}{\beta_{x0}}.$ (20)

This produces an analytical form for the Twiss $\beta$ functions at the start
of the half FODO cell, as functions of the half FODO transfer map, M;

$\beta_{x0}=\sqrt{\frac{-M_{12}M_{22}}{M_{11}M_{21}}},\hskip
14.22636pt\beta_{y0}=\sqrt{\frac{-M_{34}M_{44}}{M_{33}M_{43}}}.$ (21)

Enforcing the beam size in $x$ at the start of the half FODO is equal to the
$y$ beam size at the end of the half FODO;

$\sigma_{x0}=\sigma_{y1},\hskip 14.22636pt\sigma_{x1}=\sigma_{y0}.$ (22)

The beam size can be determined with the following;

$\sigma=\sqrt{\frac{\beta\varepsilon_{n}}{\gamma_{r}\beta_{r}}},$ (23)

therefore Eqn. 22 becomes

$\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}\beta_{x0}=\beta_{y1},\hskip
14.22636pt\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}\beta_{y0}=\beta_{x1}.$
(24)

Therefore

$\beta_{x0}\beta_{x1}=\beta_{y0}\beta_{y1}.$ (25)

The ratio of the $\beta$ functions at each half FODO cell, r, is given

$\frac{\beta_{x0}}{\beta_{y0}}=\frac{\beta_{y1}}{\beta_{x1}}=r.$ (26)

The Twiss $\beta$ and $\gamma$ functions at the end of the half FODO can be
determined using Eqn. 13;

$\beta_{x1}={\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}}\left(M_{11}^{2}\beta_{x0}+\frac{M_{12}^{2}}{\beta_{x0}}\right)$
(27)
$\beta_{y1}={\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}}\left(M_{33}^{2}\beta_{y0}+\frac{M_{34}^{2}}{\beta_{y0}}\right)$
(28)
$\gamma_{x1}=\frac{1}{\beta_{x1}}={\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}}\left(M_{21}^{2}\beta_{x0}+\frac{M_{22}^{2}}{\beta_{x0}}\right)$
(29)
$\gamma_{y1}=\frac{1}{\beta_{y1}}={\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}}\left(M_{43}^{2}\beta_{y0}+\frac{M_{44}^{2}}{\beta_{y0}}\right).$
(30)

Combining the above equations, along with Eqns. 21, 25 and the equality
$\det(M_{x})$ = $\det(M_{y})$, it can be shown;

$M_{12}=\pm M_{34},\hskip 14.22636ptM_{21}=\pm M_{43}\\\ $

and

$M_{11}M_{22}=M_{33}M_{44}.$ (31)

Now that the basic relationships between half FODO cell elements have been
determined, it is required to expand the elements as functions of quadrupole,
drift length and cavity parameters. In order to proceed, quadrupole maps are
simplified using the semi-thin lens approximation.

The semi-thin lens approximation expands trigonometric and hyperbolic
functions and truncates all terms of the order $k^{n}l_{q1}^{n+2}$;

$\displaystyle\cos(\sqrt{k_{1}}l_{q1})\approx 1-k_{1}l_{q1}^{2}/2$
$\displaystyle\sin(\sqrt{k_{1}}l_{q1})\approx\sqrt{k_{1}}l_{q1}$
$\displaystyle\cosh(\sqrt{k_{1}}l_{q1})\approx 1+k_{1}l_{q1}^{2}/2$
$\displaystyle\sinh(\sqrt{k_{1}}l_{q1})\approx\sqrt{k_{1}}l_{q1}.$

It also assumed the drift length between quadrupoles and cavities, $l_{g}<<1$
and therefore any terms of the order $k_{1}^{n}l_{g}^{n+2}$ are also ignored.

Substituting the semi-thin lens approximations into Eqn. 18 it is possible to
show that the results in Eqn. 31 can be simplified to the following
identities;

$k_{1}l_{q1}^{2}=k_{2}l_{q2}^{2}$ (32)
$l_{q1}=\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}l_{q2}$ (33)
$k_{1}=\frac{\gamma_{r1}^{2}\beta_{r1}^{2}}{\gamma_{r0}^{2}\beta_{r0}^{2}}{k_{2}}$
(34)
$\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}k_{1}l_{q1}=k_{2}l_{q2}.$
(35)

For zero acceleration, Eqns. 33, 34 and 35 return to the expected case. The
above results are also solutions for full order quadrupole elements.

In order to find the minimum aperture possible for a given cavity length, the
$\beta_{x}/\beta_{y}$ function at the start/end of the cavity is at a minimum.
The transfer map, $\Lambda_{x}$, that transforms phase space from the initial
position to the cavity entrance in $x$ is a (semi-thin lens) focusing
quadrupole of length $l_{q1}$ followed by a drift of length $l_{g}$;

$\\\ \Lambda=\begin{pmatrix}1&l_{g}\\\ 0&1\end{pmatrix}\\\
\begin{pmatrix}1-k_{1}l_{q1}^{2}/2&l_{q1}\\\ -k_{1}&1-k_{1}l_{q1}^{2}/2\\\
\end{pmatrix}.$ (36)

The $\beta$ function at the cavity entrance, $\beta_{xc0}$, is determined
using Eqn. 13 and 36;

$\beta_{xc0}=\Lambda_{11}^{2}\beta_{x0}+\frac{\Lambda_{12}^{2}}{\beta_{x0}}.$
(37)

$\beta_{xc0}$ is minimised by differentiating Eqn. 37 with respect to
quadrupole parameters, $k_{1}$, and equating to 0. It was found that
differentiating with respect to $l_{q1}$ was not optimal, as produces
quadrupole lengths of the order 1 m.

$\frac{d\beta_{xc0}}{dk_{1}}=2\Lambda_{11}\frac{d\Lambda_{11}}{dk_{1}}\beta_{x0}+\Lambda_{11}^{2}\frac{d\beta_{x0}}{dk_{1}}+\\\
2\Lambda_{12}\frac{d\Lambda_{12}}{dk_{1}}\frac{1}{\beta_{x0}}-\Lambda_{12}^{2}\frac{1}{\beta_{x0}^{2}}\frac{d\beta_{0}}{dk_{1}}=0.$
(38)

Where the total derivative is taken. Rearranging for the derivative of
$\beta_{x0}$ with respect to $k_{1}$;

$\frac{d\beta_{x0}}{dk_{1}}=\frac{-2\Lambda_{11}\beta_{x0}\frac{d\Lambda_{11}}{dk_{1}}-2\Lambda_{12}\beta_{x0}^{-1}\frac{d\Lambda_{12}}{dk_{1}}}{\Lambda_{11}^{2}-\Lambda_{12}^{2}\beta_{x0}^{-2}}.$
(39)

A form for $\beta_{x0}$ can be computed in the semi-thin lens regime using
Eqn. 21. The result is;

$\beta_{x0}\approx\frac{\sqrt{r}}{k_{1}l_{q1}}\sqrt{1+\frac{l_{q1}}{L_{eff,1}}},$
(40)

which is subsequently differentiated with respect to $k_{1}$,

$\frac{d\beta_{x0}}{dk_{1}}=\beta_{x0}\left(\frac{1}{2r}\frac{dr}{dk_{1}}-\frac{1}{k_{1}}\right).$
(41)

The aspect ratio, $r$, can be expanded in the semi-thin lens regime,

$r=\frac{M_{33}}{M_{11}}\approx\frac{1+L_{eff,1}k_{1}l_{q1}+k_{1}l_{q1}^{2}-\frac{L_{eff,1}k_{1}^{2}l_{q1}^{3}}{2}}{1-L_{eff,1}k_{1}l_{q1}-k_{1}l_{q1}^{2}-\frac{L_{eff,1}k_{1}^{2}l_{q1}^{3}}{2}},$
(42)

which can be differentiated with respect to $k_{1}$, as required in Eqn. 41.
Combining Eqns. 36, 39, 41, 40, and Eqn. 42 before simplifying and ignoring
all terms smaller than the semi-thin lens limit, produces a cubic in $k_{1}$;

$-\frac{l_{q1}^{4}L_{eff}^{2}}{2}k_{1}^{3}+l_{q1}^{2}(2l_{g}L_{eff}-2l_{q1}L_{eff}-L_{eff}^{2})k_{1}^{2}\\\
-l_{q1}(L_{eff}+l_{q1})k_{1}+1=0.$ (43)

It can be shown that for reasonable values for $l_{q1},k_{1},L_{eff}$, Eqn. 43
has three real roots, and thus trigonometric solutions exist cubic . The
solutions are as follows, for $m=0,1,2$.

$k_{1}=2\sqrt{\frac{-p}{3}}\cos\left(\arccos\left(\frac{3q}{2p}\right)\sqrt{\frac{-1}{3p}}-\frac{2\pi
m}{3}\right)-\frac{b}{3a},$ (44)

where

$p=\frac{3ac-b^{2}}{3a^{2}},\hskip
2.84544ptq=\frac{2b^{3}-9abc+27a^{2}}{27a^{3}}$

and

$\displaystyle a=\frac{-L_{eff,1}^{2}l_{q1}^{4}}{2}$ $\displaystyle
b=l_{q1}^{2}L_{eff,1}(2(l_{g}-l_{q1})-L_{eff,1})$ $\displaystyle
c=-l_{q1}(L_{eff,1}+l_{q1}).$

Equation 43 can also be solved using the thin lens approximation, keeping
terms of the form $k_{1}^{n}l_{q1}^{n}$. The result is;

$k_{1}=\frac{1}{l_{q1}L_{eff,1}}\frac{\sqrt{5}-1}{2}.$ (45)

Equations 44 and 45 produce analytical methods to determine the optimum value
of $k_{1}$ such that the maximum transverse beam size is minimised at the
cavity entrance/exit, for a given cavity length and quadrupole length, within
a FODO-like scheme.

It can be shown the value of $\beta_{xc0}$ is relatively insensitive to
$l_{q1}$. As a result, the user defined value of $l_{q1}$ is not heavily
constrained. However, as the semi-thin lens regime is adopted, $l_{q1}$ can
not approach similar values to $l_{cav}$. Figure 2 displays $\beta_{xc0}$ as a
function of cavity length and $l_{q1}$. The value of $k_{1}$ is calculated
with Eqn. 44. For longer cavity lengths, $\beta_{xc0}$ is larger, as expected.
The value of $\beta_{xc0}$ is highly insensitive to initial values of
$l_{q1}$.

(a) Figure 2: Optimum value of $\beta_{xc0}$ as a function of cavity length
and first quadrupole length.

###  III.1 Semi-thin lens relative to thin lens

(a) Figure 3: The percentage difference between optimal value of $k_{1}$ as
calculated by thick lens and the thin and semi-thin regimes. $l_{q1}$ = 0.05
m, $l_{g}$= 0.05 m.

Figure 3 displays the percentage difference between the optimal value of
$k_{1}$ as calculated by the thick lens regime (solved numerically) and the
thin/semi-thin regimes. For the minimum ratio $L_{cav}/l_{q1}$ = 2, the
percentage difference between the semi-thin and thick lens regime is less than
1$~{}\%$, approximately 10$\times$ less than the thin lens regime. Whilst the
accuracy of the semi-thin lens regime is a function of $L_{cav}/l_{q1}$, the
error increases with $l_{q1}$, for the same value of $L_{cav}/l_{q1}$.

##  IV Concatenating multiple half-FODO cells

As there is nothing special about the first half FODO cell used to derive
important constraints, the constraints extend to all half-FODO cells in a
lattice, allowing for propagating equations to be formed. Firstly the second
index describing the quadrupole length are reintroduced, describing if the
quadrupole is the first or second half of the complete quadrupole unit,
recall;

$l_{q1}\rightarrow l_{q1,2},\hskip 5.69046ptl_{q2}\rightarrow l_{q2,1}.$

For a set of $N$ half FODO cells, there exists 2$N$ half quadrupoles. The
$k$-strengths behave as follows

$k_{1}=\frac{k_{2}}{\left(\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}\right)^{2}}=\frac{k_{3}}{\left(\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}\right)^{2}}=\\\
\frac{k_{4}}{\left(\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}\beta_{r1}}\right)^{2}\left(\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r2}\beta_{r2}}\right)^{2}}=\cdots=\frac{k_{2N}}{\prod_{i=0}^{N-1}\left(\frac{\gamma_{ri}\beta_{ri}}{\gamma_{r(i+1)}\beta_{r(i+1)}}\right)^{2}}.$
(46)

Where it was used that $k_{2N}$ = $k_{2N+1}$ as they are two sections of the
same quadrupole but separated into two half FODO cells. From Eqn. 35, the
relationship between consecutive quadrupole lengths (first section) can also
be determined;

$l_{q(n),1}=\frac{\gamma_{r(n-1)}\beta_{r(n-1)}}{\gamma_{r0}\beta_{r0}}l_{q1,2}.$
(47)

By defining $l_{q1,2}$ and values for the Lorentz factor, all quadrupole
$k$-strengths and first section lengths can be determined. The second section
lengths of quadrupoles must now be determined.

In order to satisfy the constraint in Eqn. 24, Eqn. 40 is combined with the
fact

$\beta_{y1}\approx\frac{\sqrt{r}}{k_{2}l_{q2,2}}\sqrt{1+\frac{l_{q2,2}}{L_{eff,2}}},$
(48)

producing a constraint on values for $L_{eff,n}$;

$L_{eff,2}=\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}{L_{eff,1}}.$
(49)

As a constant aspect ratio was assumed, this constraint must be enforced

$r_{1}\approx\frac{1+L_{eff,1}k_{1}l_{q1,2}+k_{1}l_{q1,2}^{2}-\frac{L_{eff,1}k_{1}^{2}l_{q1,2}^{3}}{2}}{1-L_{eff,1}k_{1}l_{q1,2}-k_{1}l_{q1,2}^{2}-\frac{L_{eff,1}k_{1}^{2}l_{q1,2}^{3}}{2}}\approx\\\
r_{2}\approx\frac{1+L_{eff,2}k_{2}l_{q2,2}+k_{2}l_{q2,2}^{2}-\frac{L_{eff,2}k_{2}^{2}l_{q2,2}^{3}}{2}}{1-L_{eff,2}k_{2}l_{q2,2}-k_{2}l_{q2,2}^{2}-\frac{L_{eff,2}k_{2}^{2}l_{q2,2}^{3}}{2}}.$
(50)

Substituting with Eqns. 34 and 49, it is a requirement that

$l_{q2,2}={\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}}{l_{q1,2}}.$
(51)

From Eqn. 47, $l_{q2,1}=l_{q2,2}$. This result; quadrupole sections of the
same quadrupole unit are the same length (in addition to $k$-strength), and
the maximum/minimum beam size occurs at the centre point of the quadrupole
unit.

In order to satisfy Eqn. 49, either the drift or cavity length (or a
combination of the both) can be altered within consecutive half-FODO cells
(see Eqn. 19). The required change in element length manifests differently in
each elements. As drift lengths are short relative to cavity lengths, the
drifts become long, and the real estate gradient drops. When the constraint
term is absorbed by increasing consecutive cavity lengths, the additional
length does not cause a drop in real estate gradient. In fact, it can be shown
that a FODO-like scheme is possible such that cavity lengths increase faster
than quadrupole lengths, thus producing a lattice with higher real estate
gradient than the standard FODO scheme. Figure 8 shows the change in real
estate gradient for different methods to solve Eqn. 49.

In this section, the FODO-like focusing scheme was explored. Given an initial
set of parameters, namely the first quadrupole length, drift length and cavity
length, the value of all quadrupole lengths and $k$-strengths are
determinable, such that the limiting beam size is minimised at the cavity
entrance/exit. In addition to the quadrupole parameters, consecutive cavity
lengths and drift lengths are constrained such that the aspect ratio and beam
size are constant at each half FODO cell.

##  V FODO Results

(a) (b)

Figure 4: Twiss $\beta$ (a) and $\alpha$ (b) functions along FODO-like
lattice.

Figure 4 displays the $\beta_{x}$ (a) and $\alpha_{x}$ (b) Twiss parameters as
a function of longitudinal displacement, $s$, over four FODO cells. Twiss
parameters are shown for both the standard (zero acceleration) and FODO-like
(non-zero acceleration) lattice. The standard FODO refers to the case of
constant quadrupole strengths and lengths along the lattice, in addition to
the drift lengths. The FODO-like lattice refers to the case where lattice
parameters change as describe by Eqns. 46, 47, 49 and 51. The lattice is
comprised of cavities with lengths of the order 1 m and gradients of 50 MeV/m.
$l_{q1}$ = 0.01 m and $l_{g1}=~{}$0.05 m. The maximum $\beta_{x}$ function for
a FODO-like lattice increases with $s$, as the Lorentz factor increases due to
acceleration from rf cavities.

(a) (b)

Figure 5: Quadrupole $k$-strength (a) and length (b) as a function of
quadrupole number in FODO-like scheme.

The total length of the FODO lattice is longer for the FODO-like lattice, as
the quadrupole lengths, cavity lengths and/or drift lengths increase with
Lorentz factor, from Eqns. 33 and 49. Figure 5 demonstrates the
decrease/increase in consecutive quadrupole $k$-strength/lengths along a FODO-
like lattice. The constant beam size in both transverse planes along a FODO-
like lattice are shown in Fig. 6, as required.

(a) Figure 6: Transverse beam size in the FODO-like scheme.

Figure 7 displays the $x$ phase space ellipse at the entrance of the fifth
half FODO cell as calculated by both a constant (standard FODO) and
constrained (FODO-like) FODO lattice. For constant lattice parameters, the
phase space ellipse is over/under focused at half FODO cell boundaries, as the
constant aspect ratio and beam size constraint are not met. The constrained
lattice produces a well matched ellipse at the boundary, as required. In the
limit of a high number of periodic FODO cells, the standard FODO scheme
remains stable, when acceleration is incorporated.

(a) Figure 7: Phase space ellipse at fifth half FODO cell calculated with
constant or constrained lattice parameters.

The standard FODO lattice produces larger real estate gradients to the FODO-
like lattice when considering long and fixed cavity lengths. In this case, the
drift length must increase along the lattice to keep Eqn. 49 satisfied. As the
cavity lengths are long, the correction to subsequent $l_{g}$ is large, and
the real estate gradient drops. In addition, increased $l_{g}$ causes the beam
to defocus longitudinally.

For linacs with short cavity lengths, the correction absorbed by $l_{g}$ is
small, and the defocusing effect is suppressed. Thus for short cavity length,
The FODO-like scheme becomes an effective focusing scheme. As previously
discussed, cavity lengths can be defined to increase in length, such that the
FODO-like lattice has higher real estate to the standard FODO lattice. Figure
8 displays the real estate gradient of the three different FODO-like lattice
adopting different methods to satisfy Eqn. 49. It can be seen the maximum real
estate gradient is achieved by keeping $l_{g}$ constant and increasing
$L_{cav}$.

(a) Figure 8: The development of the cavity and drift length, for different
methods of satisfying Eqn. 49.

##  VI Minimum Aperture Scheme

The MAS considers the focusing scheme by which a set of focusing elements are
placed upstream of a cavity that orients the beam ellipse to match the
acceptance ellipse of the cavity. For a given cavity length, the MAS produces
the minimum cavity aperture that can be realised, for a given transverse beam
emittance. A schematic of the MAS is shown Fig. 9.

(a) (b)

Figure 9: (a) MAS Schematic. (b) Input/Output phase space ellipse in MAS.

The MAS scheme realises the case of minimum beam size at the cavity
entrance/exit. The first constraint thus forces equal beam size either side of
the cavity;

$\sigma_{xc0}=\sigma_{xc1},\hskip
5.69054pt\rightarrow\beta_{xc0}\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}=\beta_{xc1}.$
(52)

The input beta function, $\beta_{xc0}$, is a constrained value given by the
beam emittance and aperture size. $\beta_{xc1}$ is determinable using the
Twiss parameter transform matrix (Eqn. 13);

$\beta_{xc1}=\frac{\gamma_{r1}\beta_{r1}}{\gamma_{r0}\beta_{r0}}(R_{11}^{2}\beta_{xc0}-2R_{11}R_{12}\alpha_{xc0}+R_{12}^{2}\gamma_{xc0}).$
(53)

The matrix elements, $R$ are defined by the rf cavity map shown in Eqn. 12.
Solving Eqn. 53 for $\alpha_{xc0}$ produces a quadratic, solved using the
quadratic formula. As there is only one set of Twiss parameters that can
produce the required beam ellipse, the determinant must be zero. The results
are shown below;

$\beta_{xc0}=L_{cav}\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}-\gamma_{r0}}\ln\left(\frac{\gamma_{r1}\beta_{r1}+\gamma_{r1}}{\gamma_{r0}\beta_{r0}+\gamma_{r0}}\right)\approx
L_{cav},$ (54) $\alpha_{xc0}=1,$ (55)

and,

$\gamma_{xc0}=\frac{2}{L_{cav}\frac{\gamma_{r0}\beta_{r0}}{\gamma_{r1}-\gamma_{r0}}\ln\left(\frac{\gamma_{r1}\beta_{r1}+\gamma_{r1}}{\gamma_{r0}\beta_{r0}+\gamma_{r0}}\right)}.$
(56)

It can be shown that for a given transverse emittance, the minimum cavity
aperture as a function of cavity length is;

$a=\sqrt{\varepsilon_{n}\left(\frac{L_{cav}}{\gamma_{r1}-\gamma_{r0}}\ln\left(\frac{\gamma_{r1}\beta_{r1}+\gamma_{r1}}{\gamma_{r0}\beta_{r0}+\gamma_{r0}}\right)\right)}.$
(57)

(a) Figure 10: Beam aperture as a function of cavity length in the MAS scheme.

Figure 10 displays the minimum cavity aperture for a 5$\sigma$ beam as a
function of cavity length with gradient of 50 MeV/m.

The MAS requires multiple quadrupoles to produce the required matching for the
beam ellipse, and thus uses more quadrupole per cavity than the FODO-like
scheme. However, the MAS can produce optimal focusing schemes, where the
increase in non-active length (quadrupoles, drift lengths) is less than the
increase in active cavity length.

##  VII Conclusion

In this paper, a self-consistent framework was demonstrated, that allowed the
incorporation of acceleration into transverse beam dynamics studies for a
proton linac machine. Two focusing schemes were developed and discussed; the
FODO-like scheme, and the minimum aperture scheme. The FODO-like scheme is a
simple scheme, requiring only one quadrupole per cavity. The scheme was
analytically solved to minimise the beam size at the cavity entrance/exit and
ensures constant beam size along the lattice. It was shown that lattice
parameters must be altered along the FODO cell, to meet the design constraints
for an accelerating scheme. The MAS describes the regime that matched the beam
ellipse to the acceptance ellipse of a cavity, allowing for the smallest
possible aperture, for a given cavity length. The MAS will require more than
one quadrupole per cavity, and therefore will only have higher real estate
gradients than the FODO-like scheme in special cases.

###### Acknowledgements.

The studies presented have been funded through the Cockcroft Core Grant by
STFC Grants No. ST/P002056/1 and ST/V001612/1.

## References

  * [1] Christoph Bert, Nami Saito, Alexander Schmidt, Naved Chaudhri, Dieter Schardt, and Eike Rietzel.  Target motion tracking with a scanned particle beam.  Medical physics, 34(12):4768–4771, 2007.
  * [2] Alberto Degiovanni.  Future trends in linacs.  CERN Yellow Reports: School Proceedings, pages Vol 1 (2017): Proceedings of the CAS–CERN Accelerator School on Accelerators for Medical Applications, 2017.
  * [3] J Llacer, A Chatterjee, EL Alpen, W Saunders, S Andreae, and HC Jackson.  Imaging by injection of accelerated radioactive particle beams.  IEEE transactions on medical imaging, 3(2):80–90, 1984.
  * [4] RWD Nickalls.  Viete, descartes and the cubic equation.  The Mathematical Gazette, 90(518):203–208, 2006.
  * [5] Uwe Schneider and Eros Pedroni.  Proton radiography as a tool for quality control in proton therapy.  Medical physics, 22(4):353–363, 1995.
  * [6] Matthew Southerby.  Matt fc2ct.  PRAB.
  * [7] Juliette Thariat, Jean-Michel Hannoun-Levi, Arthur Sun Myint, Te Vuong, and Jean-Pierre Gérard.  Past, present, and future of radiotherapy for the benefit of patients.  Nature reviews Clinical oncology, 10(1):52–60, 2013.
  * [8] Andrzej Wolski.  Beam dynamics in high energy particle accelerators.  World Scientific, 2014.