# Performance of a low gain avalanche detector in a medical linac and
characterisation of the beam profile

T. Isidori  P. McCavana  B. McClean  R. McNulty  N. Minafra  N. Raab  L. Rock
C. Royon  Department of Physics & Astronomy, University of Kansas, Lawrence,
KS 66045, USA  St. Luke’s Hospital, Rathgar, Dublin 6, Ireland  School of
Physics, University College Dublin, Belfield, Dublin 4, Ireland  Beacon
Hospital, Sandyford, Dublin 18, Ireland

###### Abstract

Low gain avalanche detectors can measure charged particle fluences with high
speed and spatial precision, and are a promising technology for radiation
monitoring and dosimetry. A detector has been tested in a medical linac where
single particles were observed with a time resolution of 50 ps. The integrated
response is similar to a standard ionising chamber but with a spatial
precision twenty times finer, and a temporal precision over 100 million times
better, with the capability to measure the charge deposited by a single linac
pulse. The unprecedented resolving power allows the structure of the $\sim
3\,\mu$s linac pulses to be viewed and the 350 ps sub-pulses in the train to
be observed.

††journal: Physics in Medicine and Biology

##  1 Introduction

Dosimetry is essential in radiotherapy for understanding linac performance and
to monitor the dose delivered to the patient. Especially for small-field
dosimetry, a high spatial precision is needed to distinguish between
irradiation of the tumour and the surrounding healthy tissue and is
particularly important in intensity-modulated radiation therapy or microbeam
radiation therapy [1], where micron precision is desirable. Time performance
becomes important in dynamic environments when either the target is in motion
or the dose delivered varies with time. With the advent of FLASH radiotherapy
and the ability to delivery ultra-high radiation doses in fractions of a
second [2], there is a need for improved monitoring techniques [3]. Detailed
studies of the dosimetry and an understanding of the radiobiological
mechanisms of Flash treatments would be greatly assisted by new detectors with
high temporal and spatial resolution.

The standard monitoring tool in a clinical environment is the ionisation
chamber, which has a spatial precision of a few mm and a response time of
about a second. Combining several devices into a 2D array can allow the
radiation profile to be mapped out, and studies have been performed using
commercial devices [4, 5], although these are limited in resolution and have
significant dead-areas.

The technology of choice for high spatial precision is silicon diodes, with
dimensions from a few mm down to $50\,\mu$m, which can achieve resolutions of
up to about $5\,\mu$m (for a recent review, see [6]). Individual diodes can be
combined to create 2D arrays that have better resolution and granularity than
ion-chamber arrays: an example is the commercial SRS MapCHECK device
consisting of 1013 diodes that cover a square of side 7.7 cm [7]. Higher
spatial precision and much greater granularity can be obtained by designing
the diode array from scratch as strips or pixel implants in a single wafer of
silicon. Such silicon-strip or pixel detectors have routinely been used in the
field of particle physics over the last 30 years, and are capable of detecting
individual charged particles in the dense high-radiation environment of the
Large Hadron Collider (LHC) [8, 9, 10], with an almost 100% efficiency. These
detectors have now become the baseline choice for many commercial activities
[11, 12] and have found several applications in dosimetry (e.g. [13, 14, 15,
16]), due to their high spatial and temporal resolutions. Small pixel sizes
give near-photographic resolution: the Medipix device [17], an array of
256x256 pixels, each $55\,\mu$m square, can be used for X-ray imaging as well
as charged particle detection.

One drawback of silicon devices for clinical settings has been their radiation
hardness. However, significant advances have been made in the last fifteen
years, driven by the necessity of operating in the intense radiation
environment of the LHC. Today, such detectors can be manufactured capable of
withstanding up to $5\times 10^{15}$ 1 MeV neutrons per cm2 (about 200 kGy)
[18, 19].

Time resolved measurements in radiotherapy have generally been limited to
collection times in the ms range. A typical measurement time would be 0.25 s
for scanned beam profiles and depth doses in water tanks. The requirement for
finer resolved measurements arrived with the advent of dynamic dose delivery
where the gantry and MLC leaves move continuously during a treatment. The 2D
arrays developed to analyse these doses include the Delta4 diode phantom [20],
which with the use of a trigger pulse, can collect individual pulse doses over
tens of $\mu$s. Current interest in FLASH therapy has led to further
refinement with investigations into the individual $\mu$s pulses. Recently,
scintillator fibres were shown to achieve sub-$\mu$s resolution for X-rays
from a clinical Linac [21] using Cerenkov light from a fused silica cylinder
to view the $\mu$s pulse in a FLASH beam, though this suffered from a ringing
artifact. Diamond detectors are also capable of ns resolution of X-ray pulses
[22].

The signal collection time for typical silicon strip or pixel detectors is
about 10 ns, which when readout, for example by the Timepix4 chip [23], allows
the leading edge to be determined with a resolution of 200 ps. The fastest
time resolution however for silicon sensors is obtained with low gain
avalanche detectors (LGAD), which married with specialised electronics, can
record charged particles with a typical precision of 30 ps.

This paper describes the performance of a LGAD, of dimensions 2.9 x 0.5 mm2,
exposed to an electron beam of an Elekta linac. This is a radiation-hard
sensor designed to measure the timing difference (30 ps) between protons at
the LHC, which are 1 cm apart and travelling essentially at the speed of
light. The small dimensions of the device and the fast response mean that it
can measure fluence rates of up to 100 million particles per square millimeter
per second, and is thus capable of detecting single electrons in the linac
pulse. This allows the time-structure of the pulse, usually approximated as a
square wave, to be investigated in detail. Understanding the temporal
deposition of dose is of interest to radiobiologists as well as to machine
engineers in understanding the operation of a linac.

The apparatus used in these studies is described below. Section 2.1 gives an
overview of the linear accelerator, while the LGAD is described in Section 2.2
and the methodology is outlined in Section 2.3. The data analysis and results
are presented in Section 3, and conclusions are given in Section 4.

##  2 Apparatus and methodology

###  2.1 The Elekta linac

Figure 1:  Idealised profile of linac pulse

An Elekta Precise (Elekta AB, Sweden) dual modality linear accelerator at
Saint Luke’s Hospital, Dublin, was used in these studies. This has the
capability to produce photon beams of energy 6 MV with dose rates up to 600
MU/min and electron beams with energies between 4 and 18 MeV and dose rates of
600 MU/min. The linac was decommissioned for clinical use several years ago
but remains on a comprehensive maintenance and quality assurance program,
including dose calibration, which allows its use for research purposes. The
research linac is also equipped with a multileaf collimator (MLC), an
electronic portal imaging device (EPID) and a range of applicators for
electron beam collimation. The accelerator operates at a pulse repetition
frequency of 400 Hz for photon beams and 200 Hz for electron beam with each
pulse length being about 3.2$\,\mu$s long. Each of these pulse sequences
contains thousands of 30 ps sub-pulses separated by 350 ps. The frequency of
this fine structure is 2.856 GHz. An idealised schematic of the pulse is given
in Fig. 1.

The dose was measured with a standard radiotherapy ion chamber. A PTW Semiflex
Ionisation Chamber 31010 was operated at +400 V. It consists of two layers of
material (0.55 mm PMMA and 0.15 mm graphite) that encapsulate the sensitive
volume of the detector. The total active bulk is a cylinder of radius 2.75 mm
and height 6.5 mm. A dual channel PTW Tandem dual channel electrometer was
used to read out the ion chamber with 10 fA resolution. Its minimum measuring
intervals of 10 ms represent the bottleneck for the time required for every
acquisition. The dead time between consecutive measurement is determined by
the time (typically several seconds) needed for resetting the device.

###  2.2 The low gain avalanche detector

LGADs are considered one of the most promising technologies currently
available for fast and precise measurements of charged particles in high-rate
environments. The energy deposited by a particle passing through the sensor
contributes to the creation of free charges (electron and holes) inside the
active volume that drift towards the electrodes once an external electric
field is applied. The motion of the charges generates a current that is
amplified by a thin multiplication layer (hence the name LGAD), which is
further amplified and shaped by the read-out electronics.

The typical gain of a LGAD is in the range 5-20, significantly lower than that
of an Avalanche Photo Diode (APD), whose gain can be up to 1000. The lower
number of free charges generated per unit of deposited energy causes a
reduction in the collection time, which in turns reduces the dead time after
the avalanche process. In addition, the sensor has a lower dark current.
Thanks to these properties, it is possible to design a thin ($\sim$ tens of
microns) sensor that produces a fast, low-noise signal.

Figure 2:  Left: The KU-board mounted on the horizontal rail of an empty PTW
3D scanning water tank at St. Luke’s Hospital, Dublin. Right: A close-up of
the LGAD sensor aligned and glued to the KU-board. Only a single pixel
(outlined in red) was used for these tests.

The device used in the studies is displayed in Fig. 2 and consists of a LGAD
sensor mounted on a bespoke read-out board, developed at the University of
Kansas (KU). Only one of the pixels on the sensor was used with an active area
of 2.9$\times$0.5 mm2. The sensor was originally designed to operate inside
experiments at the Large Hadron Collider [24].

The KU read-out board [25] is designed to host the sensor and the full
amplification chain and is shown in Fig. 2. This compact and robust Printed
Circuit Board (PCB) is designed to be easily configurable for use in different
applications. It consists of 8 identical two-stage trans-impedance amplifiers
and a 20x20 mm2 pad that provides bias to the sensor up to $\sim$500 V. Sensor
pads can be wire bonded to one of the amplifiers. Due to the high input
impedance, the input capacitance has a large impact on the output signal;
therefore, the sensor is placed at only few millimeters from the amplifier (to
reduce the capacitance of the wire) and very high speed SiGe transistors are
used (to reduce parasitic capacitance). Previous tests with a similar
configuration [26], using minimum ionizing particles, showed a typical rise
time of the order of $\sim$ 600 ps, while the amplitude of the signal depends
on the sensor properties, i.e. capacitance and gain.

The amplifier on the KU-board reads the current generated by the sensor,
integrated on the capacitance of the sensor itself. The input impedance of the
amplifier directly affects the integration time. In fact, a higher input
impedance has a better signal-to-noise ratio (SNR) but a slower signal.
However, a high impedance also requires more time to restore the baseline by
removing the charge from the sensor. This presents a potential problem as
subsequent signals will add to the charge already present and the amplifier
will soon saturate. The choice of the input impedance leads to a compromise
between higher rates and SNR. In a similar way, since LGADs have a gain layer,
higher gains lead to more charge collected and a higher SNR but a lower
maximum rate.

The operating voltage for the detector was characterised during a previous
test using a 180 GeV pion beam inside the LHC North Area Facility at CERN
[25]. The gain of the device depends strongly on the applied electric field. A
bias voltage too low will lead to inefficiencies in pulse shaping while, with
a bias voltage too high, the sensor will generate too much charge during the
passage of the particle, limiting the maximum rate of operation. At high
voltages (see Fig.13 in [25]), the detector achieves a time precision better
than 25 ps. However for the present studies, the detector was operated at a
bias voltage of 150 V, in order to give both good SNR and a fast response of
the detector. At this working point, the expected time precision is about 50
ps.

###  2.3 LGAD measurements performed in the linac beam

A 6 MeV electron beam was used without an electron applicator and with the
primary collimators set to 3x3 cm2. A Neodymium N40 permanent magnet was
placed on the shadow tray, 12 cm below the collimator faceplate, to bend the
beam so that it spread along the horizontal axis. This isolates the charged
and neutral components of the beam, separates electrons with different
momenta, and reduces the contamination of bremsstrahlung photons. The LGAD was
mounted on the horizontal rail of an empty PTW 3D scanning water tank so its
position could be changed remotely. The sensor was aligned vertically using
the in-room positioning lasers and horizontally using the linac’s light-field
crosshair. The moving support was used to scan the LGAD along the diverged
beam and its output was recorded as a function of position relative to the
source of radiation. Fig 3 provides a simplified sketch of the setup used
during the tests.

Figure 3:  The sketch shows the configuration used during the studies of the
electron beam. At the top is the linac head. The electron beam was deflected
by the Neodymium permanent magnet that was placed at the exit of the multi-
leaf collimator (MLC). The KU-board was mounted on a moving support to scan
the profile of the beam and connected to the oscilloscope. The thyratron
provided the trigger to the digitizer in the oscilloscope and the data were
recorded on a computer.

The electrical current induced by the particle crossing the sensor was read
out by the two stage amplification circuit producing a signal with a rise time
of $\sim 600$ ps and a total width of $5-10$ ns. The signals were digitized
using an Agilent™DSO8104A Infiniium oscilloscope with a bandwidth of 1 GHz and
a sampling rate of 4 GSa/s.

For each position of the sensor, the response of the detector to 200 pulses of
the linac was recorded. Fig.4 shows a typical signal acquired by the
oscilloscope (in yellow) during one pulse. The acquisition was triggered by a
signal from the thyratron in the linac (in purple) corresponding to the
electron injection inside the first acceleration stage. The data were
subsequently analysed offline.

Figure 4:  Typical response of the LGAD (yellow) to one linac pulse as
recorded by the oscilloscope. The horizontal axis records time: The distance
between the two red vertical scale-lines is 2.34$\,\mu$s. The vertical axis
records voltage: the distance between the two red horizontal scale-lines is 2
V. The purple trace is the signal from the thyratron that provided the trigger
to start the acquisition.

##  3 Experimental results

The data taken were analysed in three steps. First, the total charge collected
by the LGAD per linac pulse was compared to that measured by an ion chamber.
Second, an algorithm was developed to identify individual charged particles
traversing the detector, with a time precision of about 50 ps. Third, this
precise time discrimination was used to investigate the structure of the linac
pulse.

###  3.1 Integrated charge collected by LGAD

Fig. 4 shows the data obtained during one linac pulse. The beam is present
from roughly the left-most red marker. The data were corrected for the DC
offset, which was measured by averaging data from 0.5 to 1.5$\,\mu$s before
the pulse, while the RMS of the data in this region defined the intrinsic
noise, $\sigma_{\rm noise}$. The total charge collected during each linac
pulse was found by integrating the signal.

The detector was moved laterally away from the central beam axis in 1 cm steps
and at each position the LGAD response was recorded for 200 linac pulses as
was the response of an ion chamber (described in Sec. 2.1) placed at the same
location. The average and RMS of the integrated signal in the LGAD is plotted
in Fig. 5(left) and compared to the ion-chamber response at all locations
except those on the beam-axis. A linear response is observed over most of the
range, which is fit with a straight line. The agreement between the two
detectors shows that the LGAD gives equivalent results to the ion chamber, but
with a time resolution of 3$\,\mu$s, rather than seconds.

Using the fit results, the LGAD response is scaled to that of the ion chamber.
Fig. 5(right) shows the average and RMS of the integrated charge in the LGAD
compared to the ion chamber as a function of distance from the axis. As
expected, the responses are broadly similar for charged particles (the region
$\geq 2$ cm from the beam) since both detectors have a highly efficient
response to the passage of charged particles. Differences here can be
attributed to small non-linearities in the read-out response [25] as a
function of deposited charge.

The principal difference between the LGAD and the ion chamber occurs under the
(undeflected) beam position where there is a large flux of low-energy photons
[27]. Differences in the responses of silicon detectors and ion chambers to
photons have previously been observed: sometimes a larger signal is observed
by the silicon and sometimes a smaller one [28]. Since neither the LGAD nor
the ion chamber directly detects photons, the response depends on how photons
convert, both in the detectors and their housings. A complete understanding of
the LGAD response to photons requires a full simulation of both the detector
and the board on which it is mounted. In this paper, we limit further
discussion to its response to charged particles.

The variation in the LGAD response, as reflected by the RMS, is due to the
number of charged particles crossing the detector during a single linac pulse
and the response of the electronics to variations in their temporal
distribution.

Figure 5:  Left: Correlation between the charge in the ion chamber and the
average integrated signal in the LGAD measured for each linac pulse. The red
line shows the result of a straight-line fit. Right: Charge measured with the
ion chamber and average integrated signal recorded in the LGAD per linac pulse
as a function of distance from the beam axis. The error bars indicate the RMS
of the signals obtained over 200 linac pulses.

###  3.2 Single particle counting

The ion chamber response time is typically a few seconds and requires several
hundred linac pulses to obtain a measurement. In contrast, the measurement for
the LGAD presented above are for a single pulse. However, even greater time
precision is possible by identifying each charged particle that traverses the
detector. Fig. 6 shows details of the output signal for a single triggered
event. In the zoomed display the signals resulting from charged particles
crossing the detector are clear, and indicated in the figure by red markers.

Figure 6: Top: Part of a typical LGAD signal obtained during one linac pulse;
the abscissa shows the time elapsed since the trigger. Bottom: Zoom on the
selected area (highlighted in red). The width of the green band corresponds to
five times the noise. Isolated excursions from the baseline are indicated by
red triangles and correspond to candidate charged particles passing through
the silicon sensor, as identified by the algorithm.

An automated algorithm was implemented to identify particles, and was designed
such that it could be applied in real-time to give an instantaneous response
in a clinical setting. It proceeds in the following steps.

  1. 1.

The data are sent through a low-pass filter in order to reduce fluctuations
due to noise.

  2. 2.

For each sample, a baseline is defined using the average of the channels in
the time interval 2-4.5 ns before it. This interval was chosen by inspection
of the signal pulses (Fig. 6). A typical signal takes 1.2 ns (5 samples) to go
from the baseline to the maximum, after which the signal slowly decays. To
account for statistical fluctuations in identifying the maximum channel, the
window to define the baseline starts 8 samples before the putative maximum. To
account for statistical fluctuations in the baseline level, the calculation is
performed over ten samples.

  3. 3.

A search is made for candidate channels greater than $5\sigma_{\rm noise}$
above the baseline

  4. 4.

The candidate channel is required to be the highest channel inside a window of
$\pm 3$ ns. This time interval (corresponding to $\pm 12$ samples) is chosen
by inspection of isolated signals, and is the typical time after which the
signal is 50% of the value at the peak.

The time-stamp for an individual particle crossing the detector, $T$, was
taken as the time at which the leading edge of the signal crossed a threshold
that was set to be 60% of the distance from the baseline to the peak. As
discussed in Sec. 2.2, with the operating conditions chosen, the LGAD has a
time precision of about 50 ps.

Due to the high signal-to-noise of the LGAD, this algorithm is efficient for
particles isolated in time. However, when the time spacing between consecutive
particles crossing the detector becomes significantly lower than the width of
the signal pulse (around 10 ns), the identification efficiency decreases. For
overlapping signals (e.g. between 4010-4020 ns in Fig. 6), the reconstruction
algorithm can fail to identify all particles.

Figure 7: Left: Comparison between the charge measured by the ion chamber and
the average number of particles per pulse measured by the LGAD, as a function
of detector position. Right: Correlation between the ion chamber and LGAD,
before and after an efficiency correction for high fluence rates. The error
bars indicate the RMS on the number of particles detected over 200 linac
pulses.

The average number of particles found in a single linac cycle as a function of
detector position is shown in the left panel of Fig. 7 and compared to the ion
chamber results. It can be seen that the shapes are similar, although at high
fluence rates, there is an inefficiency due to the intrinsic limit to the
algorithm described above. The inefficiency occurs when two particles pass
through the detector in quick succession such that the signals overlap. The
identification algorithm will always reject at least one when they are closer
than 3 ns, while when they are separated by more than 10 ns, the algorithm is
fully efficient. On average, the algorithm fails when two particles pass
through the detector within 6.5 ns of each other. The probability of this
occurring is $\exp(-6.5\mu)$, where $\mu$ is the rate of particles going
through the detector in GHz, and this defines an efficiency correction. Fig. 7
(right panel) shows the correspondence between the charge recorded by the ion
chamber and the number of particles observed in the LGAD, with and without
this efficiency correction. Before the correction, the response can be
modelled with a second-order polynomial, while after, a linear response is
observed.

The method of counting particles gives equivalent results to integrating the
charge but now the detector is operating as a single-quantum detector: so long
as the rate of charged particles passing through the detector is less than 100
MHz, it can resolve single electrons with a time resolution of about 50 ps,
corresponding to the precision with which the leading edge can be measured.

###  3.3 Characterisation of the linac beam

The excellent time resolution and linearity of the LGAD allows the dose
delivered by the linac to be studied as a function of time within the pulse.
The number of particles recorded at all detector positions was summed and
plotted as a function of time. This allows the temporal profile of the beam
intensity to be seen, and since the relative dose delivered scales with the
charged particle flux, this identifies the fluctuations in the delivered dose
during the linac pulse. The result is shown in Fig. 8. It approximates to the
idealised square pulse shown in Fig. 1 but the precision of the LGAD allows a
clear sub-structure to be observed. Furthermore, the width of the pulse is
seen to be smaller than nominal at $2.85\pm 0.01\,\mu$s.

Figure 8:  Particle flux measured by the LGAD, summed over all positions, as a
function of time on a linear (left) and log (right) scale.

Another feature that can be investigated is the train of sub-pulses that make
up the microsecond pulse (see Fig. 1). The linac operates with a radio-
frequency of 2.856 GHz so the sub-pulses (each expected to have a width of 30
ps) are separated by 350 ps. Given a resolution of about 50 ps on the time-
stamp for each particle crossing the detector, the sub-pulses should be
visible so long as all other timing parameters within the linac are well
aligned and have small jitter. Unfortunately, a large timing uncertainty was
found between the thyraton trigger signal and the arrival of the linac beam
(shown as the purple and yellow traces in Fig. 4).

In the absence of a precise trigger and to reduce potential decoherence over
several hundreds of ns, the sub-pulse structure was searched for using the
distribution of the difference between the time-stamps for consecutive
particles crossing the detector, $\Delta T$, which is shown in Fig. 9 (left).
For Poisson-distributed events, this distribution should be an exponential.
However, this idealised shape is modified due to the particle-finding
algorithm that introduces inefficiencies for $\Delta T<10$ ns, while the
requirement for a local maximum within $\pm 3$ ns implies no two particles
have $\Delta T$ below this value. To search for modularity in this plot, the
data were binned in steps of 10 ps and the autocorrelation function,
$R(\tau)=\frac{1}{N-\tau}\sum_{i=1}^{N-\tau}y_{i}y_{i+\tau}$ was calculated,
where $y_{i}$ is the number of entries in bin $i$. The coarse-grained
structure of $\Delta T$ results in a roughly exponential shape to $R(\tau)$,
superimposed on top of which is a fine-grained sinusoidal pattern. Fig. 9
(right) shows $R$ as a function of $\tau$, after the coarse-grained structure
has been subtracted. The periodic structure is fitted with a modulated sine
function for which the period is determined to be $346\pm 3$ ps, consistent
with the operating frequency of the linac of 2856 MHz. Thus, in addition to
observing the large-scale $\sim 3\,\mu$s-wide structure of the linac pulses
that approximate to, but are not precisely square waves, the detector is
capable of resolving the individual 350 ps-wide sub-pulses in the beam.

Figure 9: Distribution of the time between consecutive particles in the beam.
The left plot shows the full distribution. The right plot shows the
autocorrelation fitted with a modulated sine function.

##  4 Conclusions

The results of the beam test at Saint Luke’s hospital, Dublin provide a proof
of concept for the use of new generation fast detectors for medical
applications. Our results for charged particles show a similar response to
standard ion chamber measurements but with an active area a factor twenty
smaller and a time resolution a factor one hundred million better. Using this
new detector we are able to observe the time profile of the charged particles
in the linac beam and detect the pulse modulation due to the RF. We believe
this is the first time either structure has been measured with a particle
detector.

Studies of single particle interactions in high rate medical accelerators
cannot be performed with standard diagnostic tools. The capabilities of a LGAD
read out with the front-end electronics developed at the University of Kansas,
show unprecedented performance in beam monitoring for radiotherapy machines,
and the same strategy of data taking and analysis can be applied for hadron
therapy machines. The much shorter timescale of operation of LGADs suggest a
promising alternative for precise dose measurements and has particular
applicability when a rapid response is required, e.g. for fast profile
measurements or scanning of moving beam profiles.

LGAD technology is still in its infancy and many improvements are to be
expected. More sophisticated electronics should make it possible to reduce the
pulse-length by a factor of ten and this will allow an order of magnitude
improvement in the single-particle rates that it can measure. LGAD sensors and
the associated electronics currently only operate with a few pads or strips,
with current implementations up to 16 channels. However, the next generation
of particle physics experiments have plans for arrays of these sensors read-
out using a front-end ASIC [29], and there are already prototypes of sensors
with 512 pads of 1.3x1.3 mm2 [9].

As the field of medical physics is currently moving towards increasing the
amount of radiation delivered per unit of time with the development of
initiatives like Flash-Radiotherapy linear accelerators, the introduction of
fast detectors becomes important: LGADs represent a promising option for beam
monitoring and dosimetry as they combine excellent spatial and temporal
precision.

## References

  * [1] M.A. Grotzer, E. Schültke, E. Bräuer-Krisch, and J.A. Laissue.  Phys Med, 31(6):564, 2015.  doi:10.1016/j.ejmp.2015.02.011.
  * [2] M. Lempart, B. Blad, G. Adrian, S. Bäck, T. Knöös, C. Ceberg, and K. Petersson.  Radiother. Oncol., 139:40, 2019.  doi:10.1016/j.radonc.2019.01.031.
  * [3] M.R. Ashraf, M. Rahman, R. Zhang, B.B. Williams, D.J. Gladstone, B.W. Pogue, and P. Bruza.  Frontiers in Physics, 8:328, 2020.  doi:10.3389/fphy.2020.00328.
  * [4] S. Alashrah, S. Kandaiya, S.Y. Yong, and S.K. Cheng.  Nucl. Instrum. Meth. A, 619(1):181, 2010.  doi:10.1016/j.nima.2009.10.125.
  * [5] Akbar Anvari, Seyed Mahmoud Reza Aghamiri, Seyed Rabie Mahdavi, and Parham Alaei.  Journal of Radiotherapy in Practice, 14(2):194, 2015.  doi:10.1017/S1460396914000442.
  * [6] Anatoly B Rosenfeld, Giordano Biasi, Marco Petasecca, Michael L F Lerch, Giulio Villani, and Vladimir Feygelman.  Physics in Medicine & Biology, 65(16):16TR01, 2020.  doi:10.1088/1361-6560/aba163.
  * [7] Saeed Ahmed, Geoffrey Zhang, Eduardo G. Moros, and Vladimir Feygelman.  Journal of Applied Clinical Medical Physics, 20(10):13, 2019.  doi:10.1002/acm2.12696.
  * [8] E. Bossini.  Instruments, 2(4):21, 2018.  doi:10.3390/instruments2040021.
  * [9] CMS collaboration.  Technical Report CERN-LHCC-2019-003. CMS-TDR-020, 2019.  Available from: https://cds.cern.ch/record/2667167.
  * [10] ATLAS Collaboration.  Technical Report CERN-LHCC-2018-023. LHCC-P-012, 2018.  Available from: https://cds.cern.ch/record/2623663.
  * [11] A.S. Tremsin and J.V. Vallerga.  Radiation Measurements, 130:106228, 2020.  doi:10.1016/j.radmeas.2019.106228.
  * [12] S. Procz, C. Avila, J. Fey, G. Roque, M. Schuetz, and E. Hamann.  Radiation Measurements, 127:106104, 2019.  doi:10.1016/j.radmeas.2019.04.007.
  * [13] S Manolopoulos, C Wojnecki, R Hugtenburg, M A Jaafar Sidek, G Chalmers, G Heyes, and S Green.  Physics in Medicine and Biology, 54(3):485, 2009.  doi:10.1088/0031-9155/54/3/002.
  * [14] A. Bocci, M.A. Cortés-Giraldo, M.I. Gallardo, J.M. Espino, R. Arráns, M.A.G. Alvarez, Z. Abou-Haidar, J.M. Quesada, A. Pérez Vega-Leal, and F.J. Pérez Nieto.  Nucl. Instrum. Meth. A, 673:98, 2012.  doi:10.1016/j.nima.2012.01.018.
  * [15] Francesca Bisello, David Menichelli, Monica Scaringella, Cinzia Talamonti, Margherita Zani, Marta Bucciolini, and Mara Bruzzi.  Nucl. Instrum. Meth. A, 796:85, 2015.  doi:10.1016/j.nima.2015.04.064.
  * [16] Sarah J. Alnaghy et al.  Medical Physics, 47(4):1920, 2020.  doi:10.1002/mp.14016.
  * [17] Anatoly Rosenfeld, Marco Silari, and Michael Campbell.  Radiation Measurements, 139:106483, 2020.  doi:10.1016/j.radmeas.2020.106483.
  * [18] M. Moll.  IEEE Transactions on Nuclear Science, 65(8):1561, 2018.  doi:10.1109/TNS.2018.2819506.
  * [19] M. Ferrero et al.  Nucl. Instrum. Meth. A, 919:16, 2019.  doi:10.1016/j.nima.2018.11.121.
  * [20] R. Sadagopan, J.A. Bencomo, R.L. Martin, G. Nilsson, T. Matzen, and P.A. Balter.  J Appl Clin Med Phys., 10(2):104, 2009.  doi:10.1120/jacmp.v10i2.2928.
  * [21] Vincent Favaudon, Jean-Michel Lentz, Sophie Heinrich, Annalisa Patriarca, Ludovic de Marzi, Charles Fouillade, and Marie Dutreix.  Nucl. Instrum. Meth. A, 944:162537, 2019.  doi:10.1016/j.nima.2019.162537.
  * [22] L.Y. Liu, X.P. Ouyang, J.F. Zhang, P. Jin, and C.L. Su.  Diamond and Related Materials, 73:248, 2017.  doi:10.1016/j.diamond.2016.10.002.
  * [23] R. Ballabriga, M. Campbell, and X. Llopart.  Radiation Measurements, 136:106271, 2020.  doi:10.1016/j.radmeas.2020.106271.
  * [24] Albrow et al.  Technical Report CERN-LHCC-2014-021, TOTEM-TDR-003, CMS-TDR-13, 2014.  Available from: http://cds.cern.ch/record/1753795.
  * [25] N. Minafra, H. Al Ghoul, R. Arcidiacono, N. Cartiglia, L. Forthomme, R. Mulargia, M. Obertino, and C. Royon.  Nucl. Instrum. Meth. A, 867:88, 2017.  doi:10.1016/j.nima.2017.04.032.
  * [26] M. Berretti et al.  JINST, 12(03):P03024, 2017.  doi:10.1088/1748-0221/12/03/P03024.
  * [27] Jun Deng, Steve B Jiang, Todd Pawlicki, Jinsheng Li, and C-M Ma.  Physics in Medicine and Biology, 46(5):1429, 2001.  doi:10.1088/0031-9155/46/5/308.
  * [28] C McKerracher and D I Thwaites.  Physics in Medicine and Biology, 44(9):2143, 1999.  doi:10.1088/0031-9155/44/9/303.
  * [29] N. Cartiglia et al.  Nucl. Instrum. Meth. A, 979:164383, 2020.  doi:10.1016/j.nima.2020.164383.


# Detecting a Proxy for Potential Comorbid ADHD in People Reporting Anxiety
Symptoms from Social Media Data

Claire S. Lee
Princeton University
<EMAIL_ADDRESS>
&Noelle Lim
University of Toronto
LinkedIn Corporation
<EMAIL_ADDRESS>
&Michael Guerzhoy
University of Toronto
<EMAIL_ADDRESS>

###### Abstract

We present a novel task that can elucidate the connection between anxiety and
ADHD; use Transformers to make progress toward solving a task that is not
solvable by keyword-based classifiers; and discuss a method for visualization
of our classifier illuminating the connection between anxiety and ADHD
presentations.

Up to approximately 50% of adults with ADHD may also have an anxiety disorder
and approximately 30% of adults with anxiety may also have ADHD. Patients
presenting with anxiety may be treated for anxiety without ADHD ever being
considered, possibly affecting treatment. We show how data that bears on ADHD
that is comorbid with anxiety can be obtained from social media data, and show
that Transformers can be used to detect a proxy for possible comorbid ADHD in
people with anxiety symptoms.

We collected data from anxiety and ADHD online forums (subreddits). We
identified posters who first started posting in the Anxiety subreddit and
later started posting in the ADHD subreddit as well. We use this subset of the
posters as a proxy for people who presented with anxiety symptoms and then
became aware that they might have ADHD. We fine-tune a Transformer
architecture-based classifier to classify people who started posting in the
Anxiety subreddit and then started posting in the ADHD subreddit vs. people
who posted in the Anxiety subreddit without later posting in the ADHD
subreddit. We show that a Transformer architecture is capable of achieving
reasonable results (76% correct for RoBERTa vs. under 60% correct for the best
keyword-based model, both with 50% base rate).

Detecting a Proxy for Potential Comorbid ADHD in People Reporting Anxiety
Symptoms from Social Media Data

Claire S. Lee Princeton University<EMAIL_ADDRESS>Noelle Lim University
of Toronto LinkedIn Corporation<EMAIL_ADDRESS>Michael Guerzhoy University
of Toronto<EMAIL_ADDRESS>

##  1 Introduction

Up to 53% of adults with ADHD may also have an anxiety disorder Children and
with Attention-Deficit/Hyperactivity Disorder Report (2018) Quinn and Madhoo
(2014) and up to 28% of adults who have an anxiety disorder may also have ADHD
Van Ameringen et al. (2011). However, patients presenting with anxiety or
depressive symptoms may be treated for these disorders without ADHD ever being
considered Quinn and Madhoo (2014) Katzman et al. (2017). Misdiagnosis of ADHD
is common, as many clinicians are still not aware that ADHD is a valid
diagnosis in adults Quinn and Madhoo (2014) and physicians are more familiar
with mood and anxiety disorders Katzman et al. (2017). The danger of
misdiagnosed comorbid ADHD and anxiety is that only the symptoms for anxiety
will be treated and ADHD will be left untreated Katzman et al. (2017). Social
media such as Reddit provides publicly available text data of anonymous first-
person experiences Low et al. (2020).

We analyze people talking about their mental health on the forum website
Reddit. We propose classifying posts from people who only posted in the
Anxiety subreddit (forum) and never in the ADHD subreddit vs people who posted
in the Anxiety subreddit and will later have started posting in the ADHD
subreddit. This way, we can distinguish text from users whose posting will
show interest/concern with ADHD in the future from people whose posting will
not do that. Posting about ADHD is a proxy for being concerned about ADHD.
Showing that this task is possible indicates that there is a systematic
difference between the two groups of Reddit users. Our hope is that analyzing
the classifier can elucidate the connection between anxiety and anxiety-
comorbid ADHD. A limitation is that posting on Reddit is a proxy for concern
with ADHD, and there can be both false positives and false negatives if Reddit
posting is used as a proxy for identifying patients with ADHD.

We demonstrate that the task above is not solvable using keyword-based methods
such as Naive Bayes and logistic regression. We then demonstrate that the task
is better solved using RoBERTa Liu et al. (2019), indicating that the
connection between anxiety and anxiety-comorbid ADHD is more complex than what
can be captured with keywords. We report on visualizing the “explanation" for
the classifier’s prediction. In future work, we plan to use this visualization
to gain insight into the connection between anxiety and anxiety-comorbid ADHD.

Transformer models such as RoBERTa have been used to classify mental health
disorders from social media text Ameer et al. (2022) Murarka et al. (2020).
However, we are not aware of research published of using transformers to
classify comorbid anxiety with ADHD.

In the rest of the paper, we expand on comorbid ADHD and anxiety (Section
2.1), and using learned classifiers on mental health-related text (Section
2.2). We then discuss our data collection process (Section 3) and report on
our experiments showing that it is possible to predict which posts in the
Anxiety subreddit come from people who will never post in the ADHD subreddit
vs. people who will post in the ADHD subreddit (Section 5). We discuss the
limitations of our work in Section 7 and ethical considerations in Section 8.

##  2 Background

###  2.1 Comorbid ADHD and Anxiety

Up to $53\%$ of adults with ADHD may also have an anxiety disorder Children
and with Attention-Deficit/Hyperactivity Disorder Report (2018) and about 3 in
10 children with ADHD had anxiety
111https://www.cdc.gov/ncbddd/adhd/data.html. ADHD and anxiety are frequently
seen together; however, ADHD and anxiety are separate conditions Ellis (2017).
ADHD is a common mental health disorder with symptoms such as inattention (not
being able to keep focus), hyperactivity, and impulsivity Elmaghraby and
Garayalde (2022). Anxiety disorders may involve symptoms of excessive fear
Muskin (2022) which does not go away over time NIMH (2023). People who have
anxiety disorders may struggle with intense and uncontrollable feelings of
anxiety, fear, worry, or panic American Psychiatric Association et al. (2013).

Although ADHD and anxiety have different symptoms, there are instances when
the two conditions have overlapping symptoms, making it difficult to
distinguish between the two conditions Story (2022). For instance, individuals
with anxiety may have trouble concentrating in situations that trigger
anxiety. Those with ADHD may have trouble concentrating in any type of
situation Story (2022).

It is important to correctly diagnose patients with ADHD and anxiety, as the
co-occurrence of $\mathrm{ADHD}$ and anxiety may make the symptoms of both
conditions seem more extreme Koyuncu et al. (2022). For example, anxiety can
make it even more difficult for someone with ADHD to pay attention and follow
through on tasks Story (2022).

Misdiagnosed comorbid ADHD and anxiety may lead to treating only the symptoms
for anxiety while the root of the problem, which is ADHD, remains untreated
Katzman et al. (2017) Hallowell (2018). Undiagnosed ADHD can cause anxiety and
depression which, in turn, can mask ADHD, making it more difficult to diagnose
accurately Kistler (2022).

Diagnosis of ADHD typically occurs in children; however, ADHD is now
recognized to be persistent to adulthood in 50-66% of people Johnson et al.
(2020). Misdiagnosis of ADHD is common as many clinicians are still not aware
that ADHD is a valid diagnosis in adults Johnson et al. (2020).

###  2.2 Classification of Mental Health-related texts with Deep Learning

Machine learning techniques have been utilized for multi-class classification
of mental health condition-related text, particularly on Reddit. Ameer et al.
(2022) trained various models to detect texts related to anxiety, ADHD,
bipolar disorder, depression, and PTSD. Ameer et al. observed that a pre-
trained and then fine-tuned RoBERTa classifiers achieved the best performance.
Murarka et al. (2020) used RoBERTa to detect and classify texts related to
mental health conditions and observed better accuracy and F-1 scores than BERT
or LSTM models. However, their model performed poorly in classifying anxiety,
partially due to the term “anxiety" occurring in 12% of ADHD posts.

The dataset that was used for both papers was data scraped from 13 subreddits
using the Reddit API: 17,159 posts and title texts. Of the 13 subreddits, 5
were directly associated with a mental illness: "bipolar", "adhd", "anxiety",
"depression", and "ptsd" while the remaining were chosen from a wide range of
subreddit topics and assigned the class label of "none".

Previously, work such as Shen and Rudzicz (2017) applied machine learning to
classifying text by associated mental health condition.

Note that, in our work, we aim to distinguish finer-grained categories than in
previous work: we are specifically interested in disintguishing posts in the
Anxiety subreddit into two classes: posts from people who will and will not
later post in the ADHD subreddit. That is a more difficult task than
distinguishing posts in the Anxiety subreddit from posts in the ADHD
subreddit, as in previous work.

Model | Ameer et al. (2022) | Murarka et al. (2021)
---|---|---
LSTM | 76% | 72%
BERT | 78% | 82%
RoBERTa | 83% | 86%
Table 1: Multiclass classification accuracy for Reddit posts

##  3 Data Collection

Text data was collected from the Anxiety and ADHD subreddits on Reddit.
Although Reddit posts are not formal clinical diagnoses, Reddit data offers
advantages such as being immediately and publicly available, including a
timeframe to track historical data, and anonymous posts documenting vulnerable
first-person experiences Low et al. (2020).

All posts were scraped from the Anxiety and ADHD subreddits from the dates
February 16, 2020 to Nov 28, 2022.

###  3.1 Data Preprocessing

The data was cleaned by removing empty or removed posts. The data was filtered
to only contain posts from users that only ever posted in the Anxiety
subreddit or who first posted on the Anxiety subreddit only then in the ADHD
subreddit.

For users who started posting in the ADHD subreddit eventually, we only kept
posts from the Anxiety subreddit that were posted 6 months or more before the
first post in the ADHD subreddit. No posts from the ADHD subreddit were used.

In total, 47482 posts were downloaded from the ADHD and Anxiety subreddits.
33% were retained for the test set.

##  4 Models

###  4.1 Baseline Model

Our baseline models were regularized logistic regression and binomial Naive
Bayes.

####  4.1.1 Transformer Model

We fine-tined the pre-trained RoBERTa model from HuggingFace Huggingface
(2020) with the RoBERTa tokenizer, the cross-entropy loss function, the Adam
optimizer with a learning rate of $1e-5$, and a dropout layer with $p=0.3$.

##  5 Results

###  5.1 Baseline Results

With a baserate of 50%, the best logistic regression model achieved a correct
classification rate of 54% and the best Naive Bayes model achieved a correct
classification rate of 59%.

As seen, Logistic Regression models performed at 54% accuracy and Naive Bayes
performed at $58.6\%$ accuracy. Attributing to its performance, as seen in
Figure 6, the majority of samples fell correctly into the true positive and
true negative class.

###  5.2 RoBERTa Results

With a test set baserate of 50%, the RoBERTa model achieved a correct
classification rate of 76%.

###  5.3 Discussion

Our results demonstrate that, for posts in the Anxiety subreddit, it is
possible to predict which posts come from people who will later post in the
ADHD subreddit as well from posts that come from people who will not, without
using any information “from the future.”

Further, we have shown that keyword-based methods, Naive Bayes and logistic
regression, are not sufficient for this task, while it is possible to make
progress with RoBERTa. This indicates that complex cues can be used to detect
which posters will later post in the ADHD subreddit.

##  6 Experiments with explainability

One application of our trained classifier is obtaining further insight into
the relationship between anxiety disorders and ADHD.

To enable qualitative analysis, we have experimented with visualizing the
reason that the RoBERTa classifier outputs “will post in ADHD” or “will not
post in ADHD” for a given post. We visualize the difference in output caused
by masking out each individual word and each individual phrase in the post.

Aggregate analysis will be available in the future.

##  7 Limitations

Our primary goal is to gain insight into the connection between anxiety and
ADHD, as well as ADHD co-morbid with anxiety. We use a particular social media
platform (Reddit), which is primarily English-speaking and whose audience is
known to skew male
222https://www.statista.com/statistics/1255182/distribution-of-users-on-
reddit-worldwide-gender/. Conclusions about symptoms drawn from Reddit
therefore are likely biased by language, gender, and culture. We do not have
specific demographic information about the Anxiety and ADHD subreddits, so
that conclusion is itself tentative.

The classifier we train is not intended as a diagnostic tool and should not be
used as such.

Classification results on text from outside of Reddit and outside of the
Anxiety subreddit would likely not match what we report.

##  8 Ethical considerations

We use public data, and as such the research is not human-subjects research,
as confirmed by our IRB.

Owing to the sensitivity of the topic, we have decided not to include samples
from our data in the paper.

Creating classifiers whose output is mental health conditions is fraught with
the danger that such a classifier would be used without consent on users’
text. Care should be taken that this does not happen. Our classifier is not
diagnostically useful.

##  9 Conclusions

We present a novel task: predicting whether internet text that comes from a
person discussing their anxiety comes from a person who in the future will
also discuss ADHD. We demonstrate that this task is not solvable using
keyword-based methods, while it progress can be made using RoBERTa.

The immediate application of our method is for obtaining qualitative insight
into the connection between anxiety and ADHD by visualizing the reason that
the RoBERTa classifier outputs “will post in ADHD” or “will not post in ADHD”
for a given post.

## References

  * Ameer et al. (2022) I. Ameer, M. Arif, G. Sidorov, H. Gòmez-Adorno, and A. Gelbukh. 2022.  Mental illness classification on social media texts using deep learning and transfer learning.  In _8th World Conference on Soft Computing_.
  * American Psychiatric Association et al. (2013) DSMTF American Psychiatric Association, American Psychiatric Association, et al. 2013.  _Diagnostic and statistical manual of mental disorders: DSM-5_ , volume 5.  American psychiatric association Washington, DC.
  * Children and with Attention-Deficit/Hyperactivity Disorder Report (2018) Children and Adults with Attention-Deficit/Hyperactivity Disorder Report. 2018.  Coexisting conditions.  https://chadd.org/about-adhd/coexisting-conditions/.  Accessed: 2023-04-14.
  * Ellis (2017) Rachel Reiff Ellis. 2017.  What’s the link between anxiety and adhd?  https://www.webmd.com/add-adhd/anxiety-adhd-link.  Accessed: 2022-10-10.
  * Elmaghraby and Garayalde (2022) Rana Elmaghraby and Stephanie Garayalde. 2022.  What is adhd?  In _American Psychiatric Association Physician Review_.  Accessed: 2022-10-10.
  * Hallowell (2018) Edward Hallowell. 2018.  When depression and anxiety are really ADHD.  https://www.additudemag.com/depression-adhd-symptoms-misdiagnosis/.  Accessed: 2023-01-29.
  * Huggingface (2020) Huggingface. 2020.  Transformers.  https://huggingface.co/docs/transformers/index.  Accessed: 2023-01-29.
  * Johnson et al. (2020) J. Johnson, S. Morris, and S. George. 2020.  Misdiagnosis and missed diagnosis of adult attention-deficit hyperactivity disorder.  _BJPsych Advances_ , 27(1):60–61.
  * Katzman et al. (2017) Martin A. Katzman, Terrence S. Bilkey, Pratap R. Chokka, Angelo Fallu, and Laureen J. Klassen. 2017.  Adult ADHD and comorbid disorders: clinical implications of a dimensional approach.  _BMC Psychiatry_ , 17(1).
  * Kistler (2022) R. Kistler. 2022.  Trouble sitting still disorder: ADHD through the social model of disability.  https://cedar.wwu.edu/wwu_honors/587/.  Accessed: 2023-01-29.
  * Koyuncu et al. (2022) Ahmet Koyuncu, Tuğçe Ayan, Elvin Ince Guliyev, Şule Erbilgin, and Erdem Deveci. 2022.  Adhd and anxiety disorder comorbidity in children and adults: Diagnostic and therapeutic challenges.  _Current Psychiatry Reports_ , 24(2):129–140.
  * Liu et al. (2019) Y. Liu et al. 2019.  Roberta: A robustly optimized bert pretraining approach.
  * Low et al. (2020) Daniel M. Low, Laurie Rumker, Tanya Talkar, John Torous, Guillermo Cecchi, and Soumya S. Ghosh. 2020.  Natural language processing reveals vulnerable mental health support groups and heightened health anxiety on reddit during covid-19: Observational study.  _Journal of Medical Internet Research_ , 22(10):e22635.
  * Murarka et al. (2020) A. Murarka, B. Radhakrishnan, and S. Ravichandran. 2020.  Detection and classification of mental illnesses on social media using roberta.  http://arxiv.org/abs/2011.11226.
  * Murarka et al. (2021) Ankit Murarka, Balaji Radhakrishnan, and Sushma Ravichandran. 2021.  Classification of mental illnesses on social media using roberta.  In _Proceedings of the 12th international workshop on health text mining and information analysis_ , pages 59–68.
  * Muskin (2022) Philip Muskin. 2022.  What are anxiety disorders?  In _American Psychiatric Association Physician Review_.  Accessed: 2022-10-10.
  * NIMH (2023) NIMH. 2023.  Anxiety disorders.  In _National Institute of Mental Health Information Resource Center_.  Accessed: 2023-04-15.
  * Quinn and Madhoo (2014) Patricia O. Quinn and Manisha Madhoo. 2014.  A review of attention-deficit/hyperactivity disorder in women and girls.  _The Primary Care Companion For CNS Disorders_ , 16(3).
  * Shen and Rudzicz (2017) Judy Hanwen Shen and Frank Rudzicz. 2017.  Detecting anxiety through reddit.  In _Proceedings of the Fourth Workshop on Computational Linguistics and Clinical Psychology—From Linguistic Signal to Clinical Reality_ , pages 58–65.
  * Story (2022) Colleen M. Story. 2022.  Relationship between adhd and anxiety.  https://www.healthline.com/health/adhd-and-anxiety#symptoms.  Accessed: 2023-01-29.
  * Van Ameringen et al. (2011) Michael Van Ameringen, Catherine Mancini, William Simpson, and Beth Patterson. 2011\.  Adult attention deficit hyperactivity disorder in an anxiety disorders population.  _CNS neuroscience & therapeutics_, 17(4):221–226.