# Measurement of undulator section wakefield at the SXFEL test facility

He Liu  Hanxiang Yang  Nanshun Hang  Liang Xu  Zenggong Jiang  Duan Gu
Haixiao Deng<EMAIL_ADDRESS>Bo Liu  Shanghai Institute of Applied
Physics, Chinese Academy of Sciences, Shanghai 201800, China  University of
Chinese Academy of Sciences, Beijing 100049, China  Shanghai Advanced Research
Institute, Chinese Academy of Sciences, Shanghai 201210 , China  School of
Nuclear Science and Technology, Xi’an Jiaotong University, Xi’an 710049, China

###### Abstract

In free electron laser facilities, almost every kind of device will generate
wakefield when an electron beam passes through it. Most of the wakefields are
undesired and have a negative effect on the electron beam, which means a
decrease of FEL performance. As for the SXFEL test facility, the sophisticated
layout and the cumulative effect of such a long undulator section lead to an
obvious wakefield, which is strong enough that can not be ignored. Based on
two deflecting cavities at the entrance and the exit of the undulator section
with corresponding profile monitors, we measured the wakefield of the
undulator section. In this paper, we give the theoretical and simulation
results of resistive wall wakefields which agrees well with each other. In
addition, the experimental and the simulation results of the overall undulator
wakefield are given showing small difference. In order to explore the impact
of this wakefield on FEL lasing, we give the simulation results of FEL with
and without wakefield for comparison. There is almost no impact on 44 nm FEL
in stage-1 of cascaded EEHG-HGHG mode, while the impact on 8.8 nm FEL in
stage-2 becomes critical decreasing the pulse energy and peak power by 42% and
27% and broadening the bandwidth.

###### keywords:

wakefield measurement , wakefield simulation , resistive wall wakefield ,
geometry wakefield , wakefield impact on FEL

##  1 Introduction

Free electron laser (FEL) is one of the most advanced light sources around the
world due to its advantages of high power, high coherence and short
wavelength, supporting many cutting-edge researches in various fields,
including chemical dynamics, molecular biology science, material analysis and
so on[1]. In order to meet the demands of more advanced research, fully
coherent X-ray FEL has been developed[2, 3]. Shanghai soft X-ray free electron
laser (SXFEL) test facility is the first coherent X-ray light source in China
and one of the eight completed X-ray FEL facilities around the world. It
mainly consists of a linear accelerator (linac) which accelerates 600 pC
electron beam to 840 MeV, and an FEL amplifier which can support many kinds of
schemes, like HGHG, EEHG and cascaded schemes[4]. SXFEL has achieved lasing at
8.8 nm.

Consider a bunch of electrons moving in a pipe with resistive wall or rough
inner surface, or passing through a discontinuous structure, the longitudinal
and transverse wakefields[5] could be generated and change the behaviors of
the electron beam. Corrugated pipes are designed to generate special
wakefields[6, 7] to extend the bandwidth[8], linearize the longitudinal beam
phase space[9], measure the beam temporal profile[10], support the fresh-slice
multicolor scheme[11] and mostly, remove the energy chirp[12, 13, 14, 15]. In
addition, the wakefields could also be generated in other parts of an FEL
facility, which bring about unexpected influence. Under usual circumstance,
the energy loss induced by the longitudinal wakefield of a single device (not
designed for wakefield utilize) is small enough compared with the energy of
electron that not taken into account. However, the length of the undulator
section in the SXFEL test facility is over 100m and there is a number of
devices with sophisticated structure. As a result of cumulative effect, the
longitudinal passive wakefield of the whole undulator section could be strong
enough and should not be neglected. As well researched, the longitudinal
wakefield could lead to the head-to-tail energy deviation of the electron
beam[16]. If the electron beam is off the target energy, the resonance
relation[17] could not be satisfied which means a degradation of FEL or even
failing in lasing. The electron beam can also generate a strong wakefield in
the linac[18] but its energy feedback system is able to monitor and compensate
the energy deviation[19]. Therefore the measurement of undulator section
wakefield is of great significance for FEL lasing especially for the cascaded
schemes of the SXFEL test facility.

The wakefields of the undulator section mainly consists of two parts: one is
the resistive wall wakefield[20, 21] of vacuum chambers and other resistive
pipers, another is the geometry wakefield of discontinuous structures. The
inner surface of all the devices are considered to be smooth enough that the
surface roughness wakefield is not counted. The theoretical formulas of the
resistive wall wakefields have been well researched and the simulation results
of vacuum chambers are given compared with the theoretical results showing
great agreements. We give the simulation wakefield result of overall undulator
section, which also agrees well with the experimental result.

In this article, we initially introduce the SXFEL test facility. Then we
analyze the source of the wakefield in the undulator section of the SXFEL test
facility. Subsequently, we give simulations of the wakefield using the
wakefield solver, ECHO2D[22]. Following that is the experimental result of the
wakefield measurement which agrees well with the simulation result.
Ultimately, the analysis towards the beam energy loss impact on FEL
performance based on simulation is given.

##  2 SXFEL test facility

SXFEL test facility is designed for external seed laser based on harmonic up-
conversion scheme[4]. The schematic layout of the SXFEL test facility is shown
in Fig.1. The electrons are generated by a photo-cathode RF gun and could be
accelerated to 840 MeV by the linac section which contains S-band and C-band
accelerators[4]. After accelerated the electron beam enters the undulator
section, which consists of two stages of modulators, dispersive chicanes and
undulators. Either the first stage or the second stage can serve as a high
gain harmonic generation (HGHG) scheme independently, and obviously, cascaded
HGHG is also feasible. Before the first stage there is an extra group of
modulator (M0) and dispersive chicane (DS0), which makes the echo-enabled
harmonic generation (EEHG) available working with the first stage. In this
case, SXFEL test facility can lase in single-stage HGHG, single-stage EEHG,
cascaded HGHG and cascaded EEHG-HGHG schemes. SXFEL test facility has achieved
providing 8.8nm FEL operating in cascaded EEHG-HGHG scheme with a 264 nm
pulsed laser as the initial signal.

As is illustrated in Fig.1, there are two deflecting cavities at the entrance
and the exit of the undulator section[23] with corresponding profile monitors.
The first deflector is a C-band deflector and the second deflector is an
X-band deflector. The time resolution of these two deflectors could reach
around 30fs and 6fs, which are designed to diagnose the time-resolved electron
beam energy and longitudinal profile of FEL radiation. Based on these devices,
we can measure the longitudinal phase space of an electron beam at the
entrance or the exit of the undulator section, sequentially the energy loss is
able to be calculated. This offers a condition to our experiment of the
overall undulator section wakefield measurement.

Figure 1: Layout of the SXFEL test facility.

##  3 Wakefield calculations

The vacuum chambers and other pipes in the undulator section of the SXFEL test
facility are non-superconducting but mainly made of aluminum with the room
temperature conductivity $\sigma=3.7\times 10^{7}(\Omega\cdot m)^{-1}$[20],
which means the resistive wall wakefields are generated during the whole
undulator section. The undulators are out vacuum planar undulators thus the
wakefield in an undulator is counted as the resistive wall wakefield in the
resistance chamber. In addition, the structural variation also leads to
another kind of wakefield named geometry wakefield. The contribution of
geometry wakefield mainly comes from flanges, corrugated pipes, step-in and
step-out structures. The internal surface of all the devices are considered to
be smooth enough that the surface roughness wakefield is not counted[24]. In
order to calculate the wakefield of overall undulator section, we used the
wakefield solver, ECHO2D, which supports both resistive wall wakefield and
geometry wakefield calculations. For comparison, we calculated the resistive
wall wakefields of vacuums chamber with formula[20]:

$Z(k)=\frac{Z_{0}}{2\pi a}\left(\frac{1}{\xi(k)}-\frac{ika}{2}\right)$
$w(s)=\frac{c}{2\pi}\int_{-\infty}^{\infty}Z(k)e^{-iks}dk$

where $Z_{0}$ is the free space impedance, $Z_{0}=120\pi\Omega$, a is the
diagram of the chamber, k is frequency and c is the speed of light. We
calculated the resistive wall wakefields of round chambers with diameters of 6
mm and 16 mm and the beam current we used for both simulation and theoretical
calculation was measured in the experiment. The current profile we used is
shown in Fig.2 together with the wake potential calculated by ECHO2D and
formulas (The bunch head is on the left). The bunch charge is 500 pC and the
bunch length is 1.3 ps (FWHM). As is illustrated in Fig.2 (a) and (b), the
theoretical and simulation results agree well with each other. It is obvious
that the wake potential generated by a $\Phi$6 vacuum chamber is more than
twice the wake potential generated by a $\Phi$16 vacuum chamber, which is
reasonable according to the formulas mentioned above.

Figure 2: (a) and (b) are the theoretical and simulation wake potentials of Φ6
and Φ16 vacuum chambers, the blue lines are the results of ECHO2D and the red
lines are the theoretical results.(c) is the current profile.

For simplifying the calculation and saving time, we divide the undulator
section into three modules: vacuum chambers with diameters of 16 mm and 6 mm,
and inter sections between two undulators. The total length of $\Phi$16 and
$\Phi$6 vacuum chambers are 35m and 74.439 m respectively, and the total
number of inner sections is 7. Thus we just need to calculate the wakefield of
10mm vacuum chambers and one inner section, the overall wakefield is the sum
of every kind of the three modules multiplies by their corresponding
multiples. We calculated the wake potential of these three models and the
energy loss of the overall undulator section. The total energy loss of real
bunch and Gaussian bunch ($\sigma$=120 µm) calculated by ECHO2D are shown in
Fig.3.

Figure 3: The energy losses of the overall undulator section calculated based
on the real bunch(a) and Gaussian bunch(b). The red lines show the
corresponding current profile.

The inner sections containing all the discontinuous structures generate
geometry wakefields and resistive wall wakefields simultaneously, which
contributed the most energy loss in the undulator section. As shown in Fig.3,
the energy loss calculated based on Gaussian bunch agrees well with that
calculated based on real bunch, which makes the simulations reliable. The mean
beam energy loss(real bunch) of the overall undulator section is 0.48 MeV, and
the maximal beam energy loss is 0.79 MeV.

##  4 Wakefield measurement

We measured the wakefield of the undulator section through deflecting cavities
and corresponding profile monitors. What should be emphasized is that the
undulators were turned off while the experiment was carrying on. In this way,
we can obtain the longitudinal phase space of the electron beam at either the
entrance or the exit of the undulator section. Fig.4 shows two of these
corresponding measuring results.

Figure 4: The longitudinal phase space (top row: raw data, bottom row: data
after noise reduction and smoothed) of the electron beam at the entrance and
the exit of the undulator section. The left column of images were the results
measured at the entrance and the right ones were measured at the exit.

One thing should be noted is that the measuring images we got from the profile
monitors were not drawn by absolute coordinates, which presented three
problems: 1. the x-axis cannot calibrate the absolute bunch length; 2. the
y-axis cannot calibrate the bunch energy; 3. due to some unknown noises and
engineering errors, the images were jittering on the screen that we could not
collect aligned images. In order to solve these problems, a series of data
processes are needed. The data matrices of the measuring results are
500$\times$500 matrices. Each element in the matrices represents the number of
electrons located in the corresponding position with corresponding energy,
although the position and energy read from the coordinates are not absolute
values. There are a lot of bottom noise and burr in these data matrices thus
we carried on some corresponding processes to remove these noise and burr as
is shown in Fig.4. The processed matrices are named “source matrices” for ease
of description. Subsequently we cut off the blank data columns and calculated
the sum of each column of these matrices and got one dimensional matrices,
named “current matrices”. We stretched or compressed these matrices to a
standard matrix length value and calibrated their x-axis according to the FWHM
bunch length measured in the experiment. Then we got the current profile
matrices. In the same way we cut off the blank columns and stretched or
compressed the source matrices referred to corresponding current matrices,
hence we got aligned source matrices. Actually the absolute energy value is
not cared but the relative value matters. We calculated the weighted average
difference of energy pixel along each column between two aligned source
matrices measured at the entrance and the exit of the undulator and converted
it to a one dimensional matrix in accordance with a pixel-to-energy conversion
factor (100pixels represent 2.5 MeV), named energy matrix. Since the portrait
jitters of images the energy matrices might not begin with zero. A
corresponding vertical translation was carried on to each energy matrix to
guarantee all the energy matrices begin with zero. After all of these
processes, we could get both the current profile and the energy loss.

Another thing should be noted is that this measurement is an interception
measurement, which means the longitudinal phase space we got at both ends of
the undulator section were not from the same electron beam. To solve this
problem we tried to find the most similar beams. As long as the valid data we
collect is enough that we could find several groups of current profile having
satisfying similarities, the longitudinal phase space measured at the entrance
and the exit of the undulator section can be seemed as measured from the same
electron beam. We measured 200 groups of data at the entrance and the exit
respectively. In order to find the most similar electron beams, we wrote a
code to calculate the absolute difference between every current profile of two
beams separately located in the entrance and the exit of the undulator
section. We found the most similar 16 groups whose similarities of current
profiles are all higher than 96.5% and the current profile of the most similar
group is shown in Fig.5(a). To show the importance of finding the similar
electron beams, we put the current profile of a group of bunches in Fig.5(b)
which shows a bad similarity. We compared the energy losses of these chosen
groups and picked up ten of them which show great performances. Fig.5 (c) and
(d) show the energy losses calculated based on three of these groups and the
average energy loss of all the picked groups.

Figure 5: (a) and (b) are the current profiles of two groups of bunches with
high and low similarity. (c) is the energy loss of the three groups picked.
(d) is the average energy loss of all of the groups available.

In Fig.5 we only displayed three example energy losses of the groups picked
but the other results also show the similar curves actually. Each curve of
energy loss has two horns due to the characteristics of current profile which
makes it reasonable. The maximal beam energy loss is 0.93 MeV which is close
to the simulation result but a little bit higher. This is predictable due to
the sophisticated layout of the undulator section. In our calculations the
geometry input of simulation was simplified. However there are some subtle
geometry structures of some devices has been ignored which could generate
geometry wakefields. There is a sharp rise in the latter part of each
experimental energy loss result, which is different from the theoretical
results (not that sharp). This difference might came from the transverse
wakefields since the electron beam possibly move off the axis. Regardless of
the small difference, the similar curves and the closed energy loss makes the
simulation and experimental results reliable.

A meaningful work is to calculate the wake function of the undulator section.
Since the wake function is only related to the structure, material and layout
of devices, it is fixed no matter how the beam current changed. Thus the wake
potential of the undulator section could always be calculated easily according
to the beam current through convolution once the wake function is clear. We
used three methods to calculate the wake function according to the wake
potential measured in this experiment: deconvolution method, Fourier transform
method and matrix method. The first method is only suitable for theoretical
wake potential of Gaussian bunch due to its iteration calculation while the
second method even cannot give a reasonable result. In order to avoid the
iteration calculation resulting in mistakes, we changed the convolution to
matrix multiplication: $CW_{F}=W_{P}$. C is a square matrix consists of 1D
current profile matrices offset with each other and “0” for filling the blank,
$W_{F}$ and $W_{P}$ are wake function and wake potential. Thus we could obtain
wake function through $W_{F}=C^{-1}W_{P}$. This method could give the wake
function calculated by theoretical wake potential of both Gaussian bunch and
real bunch, which showed perfect fit with initial theoretical wake function.
Further more, the results showed perfect performance even if we added noise on
both current profile and initial wake function. Unfortunately the results
became terrible if we smoothed the current profile and the original wake
function after adding noise, which actually happened in data process of the
experiment. It is conceivable that the third method failed to give the correct
wake function of the undulator section based on experimental results.

##  5 Wakefield impact on FEL lasing

The wakefield of the undulator section has been simulated and measured and one
more important thing which is of great interest is how the wakefield impacts
on FEL lasing. We adopted 3D time-dependent numerical simulation codes
GENESIS[25] to simulate the FEL lasing with and without wakefield of the
undulator section to show this impact through comparison.

A problem should be solved before simulation is that the experimental result
contains the wakefields of the devices after the last undulator, which has no
impact on FEL lasing but can not be removed. In addition, some useless drift
sections are usually ignored in GENESIS simulation while the wakefields were
also counted in the experimental result, which means it is not accurate if we
use the experimental result for GENESIS simulation straightly. As for
simulation results of ECHO2D, we can only count the requisite wakefields by
piecewise calculation. Under this circumstance, we compared the ECHO2D
simulation results of two different cases. One is the wakefield of the overall
undulator section as mentioned above and another only contains the specific
sections needed in GENESIS simulation. We calculated the ratio of these two
cases and considered it was the same for experimental results. Thus we could
obtain a “ratio result” of the experiment by multiply the ratio, which is
equivalent to the experimental wakefields of the requisite sections. In this
way we could compare the wakefield impact on FEL lasing simulated with three
different wakefield inputs: segment simulated wakefield (the most accurate
one), average “ratio simulated wakefield” and average “ratio experimental
wakefield”. As long as the results of the first two cases mentioned above
agree well with each other, the average “ratio experimental wakefield” could
be considered as a representation of the realistic experimental wakefield
which makes it reasonable to be a wakefield input of GENESIS simulation. This
means the impact on FEL lasing simulated based on the average “ratio
experimental wakefield” is reliable and the problem presented at the beginning
of this paragraph has been solved. Main parameters used in GENESIS simulation
are listed in Table.1. The periods of three modulators and two radiators are 8
cm, 8 cm, 4 cm and 4 cm, 2.35 cm.

Table 1: Main simulation parameters of SXFEL test facility operating at cascaded EEHG-HGHG mode Specifications |  Electron beam
---|---
Energy |  840 MeV
Slice energy spread |  30 keV
Normalized emittance |  1.5 mm$\cdot$mrad
Peak current |  415 A
Bunch length |  1.3 ps (FWHM)
Specifications |  Seed laser
Peak power of seed1 |  45.9 MW (Gaussian)
Peak power of seed2 |  183.6 MW (Gaussian)
Duration |  160 fs (FWHM)
Wavelength |  264 nm
Rayleigh length |  47.6 m

The simulation results of FEL lasing without and with three different kinds of
wakefields mentioned above are listed in Table.2 and the FEL performance under
the impact of the average “ratio experimental wakefield” are illustrated in
Fig.6. Comparing the data of “ratio simulation” and “segment simulation”, we
could find the differences between them are quite small, which means the
results of “ratio measurement” are reliable. The pulse energy and peak power
of FEL without and with “ratio measurement” wakefield at the end of stage-1
are 29.0 µJ, 26.7 µJ and 286.8 MW, 272.0 MW. This means the wakefield impact
on FEL is slight in stage-1, but the impact become remarkable in stage-2 as
listed in Table.2. The pulse energy decreases from 21.0 µJ to 12.1 µJ and the
peak power decreases from 219.7 MW to 160.2 MW. The attenuation of pulse
energy caused by wakefield is even nearly half of the case without wakefield
and the peak power decreases by 27%. A 23% bandwidth broadening is also
generated in stage-2 due to the wakefield. Actually pulse energy and peak
power measured straightly at the end of stage-2 on the SXFEL test facility are
more than 10 µJ and 100 MW, which makes the simulation results reliable.

Table 2: The simulation results of FEL lasing with different kinds of wakefields | Pulse energy | Peak power | Pulse length | Bandwidth
---|---|---|---|---
Without Wakefield |  |  |  |
Stage1 EEHG | 29.0 µJ | 286.8 MW | 100.5 fs | 0.103%
Stage2 HGHG | 21.0 µJ | 219.7 MW | 105.7 fs | 0.019%
Segment simulation |  |  |  |
Stage1 EEHG | 27.8 µJ | 286.6 MW | 95.2 fs | 0.103%
Stage2 HGHG | 16.9 µJ | 169.6 MW | 105.7 fs | 0.019%
Ratio simulation |  |  |  |
Stage1 EEHG | 26.3 µJ | 259.3 MW | 100.5 fs | 0.113%
Stage2 HGHG | 14.3 µJ | 161.6 MW | 105.7 fs | 0.023%
Ratio measurement |  |  |  |
Stage1 EEHG | 26.7 µJ | 272.0 MW | 95.2 fs | 0.113%
Stage2 HGHG | 12.1 µJ | 160.2 MW | 84.6 fs | 0.024%

Figure 6: Simulation results given by GENESIS. (a) and (b) are the results of
stage-1 while (c) and(d) is of stage-2. (e) shows the the energy loss
with(red) and without(blue) lasing.

Fig.6(e) clearly shows the energy deviation caused by the wakefield and the
wakefield impact on FEL lasing could be estimated from the image. The red line
shows the energy loss with two hollows cause by lasing. The right one is
caused by lasing in stage-1 and the left one is of stage-2. When the electron
beam entries in stage-2 the energy loss at lasing position caused by the
wakefield is much more than that in stage-1. Further more, the lasing is more
sensitive to energy deviation when it is close to FEL saturation in stage-2.
In the meanwhile, the quadratic curvature of the energy loss also brings about
an obvious bandwidth broadening to the lasing[26].

##  6 Conclusion

Wakefields are ineluctable when an electron beam is moving in a pipe with
resistive wall or discontinuous structure. The impact on the electron beam due
to wakefields in the LINAC section of FEL facility is always ignored because
the wakefields are small enough and the impact could be neutralized by tuning
the accelerator. However the impact becomes critical in the undulator section
especially for cascaded schemes. On the one hand the diagrams of pipes in the
undulator section are smaller which means a stronger wakefield, on the other
hand it is extremely sensitive in the radiator when it is getting close to FEL
saturation. We compared the resistive wall wakefields given by theoretical
formulas and ECHO2D, which turned out to be similar, to demonstrate the
feasibility of ECHO2D simulation results. On this basis, we measured the
wakefield of the overall undulator section of SXFEL test facility. The
experimental result after post process agreed well with the simulation result,
which made the experiment reliable. In order to illustrate the wakefield
impact on the FEL lasing, we used GENESIS to simulate the lasing process at
cascaded EEHG-HGHG mode. The experimental and simulation wakefields are
adjusted to accommodate the GENESIS simulation. Comparing the lasing
simulation results, we saw a minor affect on stage-1 but a critical damage to
stage-2 lasing performance. The FEL gain increases along the undulator line
while the wakefield also accumulates to degrade the FEL performance. According
to the results given in this paper, the pulse energy and peak power of 8.8nm
FEL could decrease by 42% and 27% due to the wakefield and could also result
in bandwidth broadening. This suggests that the undulator should be well
tuned, like taper scheme, according to the wakefield to compensate the loss of
FEL performance.

##  7 Acknowledgement

The authors sincerely thank Jiawei Yan for helpful discussions and useful
comments. This work was partially supported by the National Key Research and
Development Program of China (Grants No. 2018YFE0103100) and the National
Natural Science Foundation of China (Grants No. 11935020).

## References

  * [1] W. Barletta, J. Bisognano, J. Corlett, P. Emma, Z. Huang, K. Kim, R. Lindberg, J. Murphy, G. Neil, D. Nguyen, C. Pellegrini, R. Rimmer, F. Sannibale, G. Stupakov, R. Walker, A. Zholents, Free electron lasers: Present status and future challenges, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 618 (1) (2010) 69–96.
  * [2] N. Huang, H. Deng, B. Liu, D. Wang, Z. Zhao, Features and futures of X-ray free-electron lasers, The Innovation 2 (2) (2021) 100097.
  * [3] C. Feng, H. Deng, Review of fully coherent free-electron lasers, Nuclear Science and Techniques 29 (11) (2018) 1–15.
  * [4] J. Yan, Z. Gao, Z. Qi, K. Zhang, K. Zhou, T. Liu, S. Chen, C. Feng, C. Li, L. Feng, T. Lan, W. Zhang, X. Wang, X. Li, Z. Jiang, B. Wang, Z. Wang, D. Gu, M. Zhang, H. Deng, Q. Gu, Y. Leng, L. Yin, B. Liu, D. Wang, Z. Zhao, Self-Amplification of Coherent Energy Modulation in Seeded Free-Electron Lasers, Physical Review Letters 126 (8) (2021) 84801.
  * [5] P. Craievich, Short-range longitudinal and transverse wakefield effects in FERMI@Elettra FEL project, Ai Edam Artificial Intelligence for Engineering Design, Analysis and Manufacturing - AIEDAM (2010).
  * [6] A. Novokhatski, Wakefield potentials of corrugated structures, Physical Review Special Topics-accelerators and Beams 18 (10) (2015) 104402.
  * [7] H. X. Deng, M. Zhang, Review of Electron Beam Manipulation by using Corrugated Device for Light Sources, in: 12th Symposium on Accelerator Physics, 2014.
  * [8] I. Zagorodnov, G. Feng, T. Limberg, Corrugated structure insertion for extending the sase bandwidth up to 3% at the european XFEL, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 837 (2016) 69–79.
  * [9] H. Deng, M. Zhang, C. Feng, T. Zhang, X. Wang, T. Lan, L. Feng, W. Zhang, X. Liu, H. Yao, L. Shen, B. Li, J. Zhang, X. Li, W. Fang, D. Wang, M. emmanuelle Couprie, G. Lin, B. Liu, Q. Gu, D. Wang, Z. Zhao, Experimental Demonstration of Longitudinal Beam Phase-Space Linearizer in a Free-Electron Laser Facility by Corrugated Structures, Physical Review Letters 113 (25) (2014) 254802–254802.
  * [10] S. Bettoni, P. Craievich, A. A. Lutman, M. Pedrozzi, Temporal profile measurements of relativistic electron bunch based on wakefield generation, Physical review accelerators and beams 19 (2) (2016) 21304.
  * [11] A. A. Lutman, T. J. Maxwell, J. P. MacArthur, M. W. Guetg, N. Berrah, R. N. Coffee, Y. Ding, Z. Huang, A. Marinelli, S. Moeller, J. C. U. Zemella, Fresh-slice multicolour X-ray free-electron lasers, Nature Photonics 10 (11) (2016) 745–750.
  * [12] P. Emma, M. Venturini, K. L. F. Bane, G. Stupakov, H.-S. Kang, M. S. Chae, J. Hong, C.-K. Min, H. Yang, T. Ha, W. W. Lee, C. D. Park, S. J. Park, I. S. Ko, Experimental demonstration of energy-chirp control in relativistic electron bunches using a corrugated pipe, Physical Review Letters 112 (3) (2014) 34801.
  * [13] K. Bane, G. Stupakov, Corrugated pipe as a beam dechirper, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 690 (2012) 106–110.
  * [14] K. Bane, G. Stupakov, Dechirper wakefields for short bunches, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 820 (2016) 156–163.
  * [15] Z. Zhang, K. Bane, Y. Ding, Z. Huang, R.Iverson, T. Maxwell, G. Stupakov, L. Wang, M. Ruelas, M. Harrison, et al., Design study of LCLS chirp-control with a corrugated structure, in: Proc. 36th Int. Free-Electron Laser Conf.(FEL’14), 2014.
  * [16] K. Bane, G. Stupakov, Using surface impedance for calculating wakefields in flat geometry, Physical Review Special Topics-accelerators and Beams 18 (3) (2015) 34401.
  * [17] Z. Huang, K. J. Kim, A review of x-ray free-electron laser theory, Physical Review Special Topics-accelerators and Beams 10 (3) (2007) 34801.
  * [18] K. Bane, F. J. Decker, P. Emma, L. Hendrickson, P. Krejcik, C. O’Connell, H. Schlarb, J. Welch, M. Woodley, Measurement of the longitudinal wakefield in the SLAC Linac for extremely short bunches, in: Proceedings of the 2003 Particle Accelerator Conference, Vol. 5, 2003, pp. 3126–3128.
  * [19] M. Song, K. Li, C. Feng, H. Deng, B. Liu, D. Wang, Wakefield issue and its impact on X-ray photon pulse in the SXFEL test facility, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 822 (2016) 71–76.
  * [20] G. Stupakov, K. L. F. Bane, P. Emma, B. Podobedov, Resistive wall wakefields of short bunches at cryogenic temperatures, Physical Review Special Topics-accelerators and Beams 18 (3) (2015) 34402.
  * [21] B. Podobedov, Resistive wall wakefields in the extreme anomalous skin effect regime, Physical Review Special Topics-accelerators and Beams 12 (4) (2009) 44401\.
  * [22] I. Zagorodnov, K. L. F. Bane, G. Stupakov, Calculation of wakefields in 2D rectangular structures, Physical Review Special Topics-accelerators and Beams 18 (10) (2015) 104401.
  * [23] M. Song, H. Deng, B. Liu, D. Wang, Deflecting Cavity Dynamics for Time-Resolved Machine Studies of SXFEL User Facility, in: Proc. 5th Int. Beam Instrumentation Conf. (IBIC’16), Barcelona, Spain, Sept. 13-18, 2016, pp. 169–172.
  * [24] M. H. Song, C. Feng, D. Huang, H. X. Deng, B. Liu, D. Wang, Wakefields studies for the SXFEL user facility, Nuclear Science and Techniques 28 (7) (2017) 90–90.
  * [25] S. Reiche, GENESIS 1.3: a fully 3D time-dependent FEL simulation code, Nuclear Instruments & Methods in Physics Research Section A-Accelerators Spectrometers Detectors and Associated Equipment 429 (1) (1999) 243–248.
  * [26] T. Shaftan, L. H. Yu, High-gain harmonic generation free-electron laser with variable wavelength, Physical Review E 71 (4) (2005) 46501–46501.


# Homogeneous Learning: Self-Attention Decentralized Deep Learning

Yuwei Sun
Graduate School of Information Science and Technology
University of Tokyo
Tokyo, Japan 113-8654
<EMAIL_ADDRESS>
&Hideya Ochiai
Graduate School of Information Science and Technology
University of Tokyo
Tokyo, Japan 113-8654
<EMAIL_ADDRESS>

###### Abstract

Federated learning (FL) has been facilitating privacy-preserving deep learning
in many walks of life such as medical image classification, network intrusion
detection, and so forth. Whereas it necessitates a central parameter server
for model aggregation, which brings about delayed model communication and
vulnerability to adversarial attacks. A fully decentralized architecture like
Swarm Learning allows peer-to-peer communication among distributed nodes,
without the central server. One of the most challenging issues in
decentralized deep learning is that data owned by each node are usually non-
independent and identically distributed (non-IID), causing time-consuming
convergence of model training. To this end, we propose a decentralized
learning model called Homogeneous Learning (HL) for tackling non-IID data with
a self-attention mechanism. In HL, training performs on each round’s selected
node, and the trained model of a node is sent to the next selected node at the
end of each round. Notably, for the selection, the self-attention mechanism
leverages reinforcement learning to observe a node’s inner state and its
surrounding environment’s state, and find out which node should be selected to
optimize the training. We evaluate our method with various scenarios for an
image classification task. The result suggests that HL can produce a better
performance compared with standalone learning and greatly reduce both the
total training rounds by 50.8% and the communication cost by 74.6% compared
with random policy-based decentralized learning for training on non-IID data.

##  1 Introduction

Decentralized deep learning (DDL) is a concept to bring together distributed
data sources and computing resources while taking the full advantage of deep
learning models. Nowadays, DDL such as Federated Learning (FL) (Konečný et
al., 2016) has been offering promising solutions to social issues surrounding
data privacy, especially in large-scale multi-agent learning. These massively
distributed nodes can facilitate diverse use cases, such as industrial IoT
(Parimala et al., 2021), environment monitoring with smart sensors (Gao et
al., 2020), human behavior recognition with surveillance cameras (Liu et al.,
2020), connected autonomous vehicles control (Pokhrel and Choi, 2020; Liu et
al., 2019), federated network intrusion detection (Sun et al., 2021; Rahman et
al., 2020), and so forth.

Though FL has been attracting great attention due to the privacy-preserving
architecture, recent years’ upticks in adversarial attacks cause its hardly
guaranteed trustworthiness. FL encounters various threats, such as backdoor
attacks (McMahan et al., 2018; Cao et al., 2019; Nguyen et al., 2020),
information stealing attacks (Duan et al., 2021), and so on. On the contrast,
fully decentralized architectures like Swarm Learning (SL) (Warnat-Herresthal
et al., 2021) leverages the blockchain, smart contract, and other state-of-
the-art decentralization technologies to offer a more practical solution.
Whereas, a great challenge of it has been deteriorated performance in model
training with non-independent identically distributed (non-IID) data, leading
to extremely increased time of model convergence.

Our contributions. To this end, we propose a self-attention decentralized deep
learning model called Homogeneous Learning (HL). HL leverages a shared
communication policy for adaptive model sharing among nodes. A starter node
initiates a training task and by iteratively sending the trained model and
performing training on each round’s selected node, the starter node’s model is
updated for achieving the training goal. Notably, a node selection decision is
made by reinforcement learning agents based on the current selected node’s
inner state and outer state of its surrounding environment to maximize a
reward for moving towards the training goal. Finally, comprehensive
experiments and evaluation results suggest that HL can accelerate the model
training on non-IID data with 50.8% fewer total training rounds and reduce the
associated communication cost by 74.6%.

Paper outline. This paper is organized as follows. Section 2 demonstrates the
most recent work about DDL and methodologies for tackling data heterogeneity
problems in model training. Section 3 presents the technical underpinnings of
Homogeneous Learning, including the privacy-preserving decentralized learning
architecture and the self-attention mechanism using reinforcement learning
agents. Section 4 demonstrates comprehensive experimental evaluations. Section
5 concludes the paper and gives out future directions of this work.

##  2 Related Work

In recent years, lots of DDL architectures have been proposed leveraging
decentralization technologies such as the blockchain and ad hoc networks. For
instance, Li et al. (2021) presented a blockchain-based decentralized learning
framework based on the FISCO blockchain system. They applied the architecture
to train AlexNet models on the FEMNIST dataset. Similarly, Lu et al. (2020)
demonstrated a blockchain empowered secure data sharing architecture for FL in
industrial IoT. Furthermore, Mowla et al. (2020) proposed a client group
prioritization technique leveraging the Dempster-Shafer theory for unmanned
aerial vehicles (UAVs) in flying ad-hoc networks.

On the other hand, methodologies for tackling data heterogeneity in DDL,
especially FL, have been studied for a long time. For example, Sener and
Savarese (2018) presented the K-Center clustering algorithm which aims to find
a representative subset of data from a very large collection such that the
performance of the model based on the small subset and that based on the whole
collection will be as close as possible. Moreover, Wang et al. (2020)
demonstrated reinforcement learning-based client selection in FL, which
counterbalances the bias introduced by non-IID data thus speeding up the
global model’s convergence. Sun et al. (2021) proposed the Segmented-FL to
tackle heterogeneity in massively distributed network intrusion traffic data,
where clients with highly skewed training data are dynamically divided into
different groups for model aggregation respectively at each round.
Furthermore, Zhao et al. (2018) presented a data-sharing strategy in FL by
creating a small data subset globally shared between all the clients.
Likewise, Jeong et al. (2018) proposed the federated augmentation where each
client augments its local training data using a generative neural network.

Different from the aforementioned methodologies, our work is aimed to offer a
practical solution to 1) peer-to-peer decentralized deep learning; 2) a self-
attention mechanism that optimizes the node selection using reinforcement
learning; 3) communication cost-aware model sharing in decentralized learning.

##  3 Homogeneous Learning

###  3.1 Data Privacy and Decentralized Deep Learning

Centralized deep learning in high performance computing (HPC) environments has
been facilitating the advancement in various areas such as drug discovery,
disease diagnosis, cybersecurity, and so on. Despite its broad applications in
many walks of life, the associated potential data exposure of training sources
and privacy regulation violation have greatly decreased the practicality of
such centralized learning architecture. In particular, with the promotion of
GDPR (EU, ), data collection for centralized model training has become more
and more difficult.

For this reason, Google proposed federated learning (FL) to alleviate the
limitation of model training on distributed data. FL allows a client to train
its own model based on a local dataset and achieve a better performance by
sharing the training result with others, whereas without sharing the raw
training data. FL quickly acquired intense attention from lots of fields
related to sensitive data processing including medical image classification,
face recognition, intrusion detection, finance data analysis, and so forth.

Moreover, a fully decentralized deep learning architecture is peer-to-peer
networking of nodes based on decentralization and security technologies such
as the token-exchange, a service capable of validating and issuing security
tokens to enable nodes to obtain appropriate access credentials for exchanging
resources without the central server. In this case, each node owns a local
training model and performs both the function of the client and the server
based on a shared communication policy, which is different from FL where the
central server plays the key role in model sharing.

###  3.2 Edge Heterogeneity in Decentralized Deep Learning

The challenges related to edge heterogeneity mainly refer to two categories,
i.e., data heterogeneity (non-IID data) and hardware heterogeneity (bandwidth,
device memory, computation capability, etc.). Notably, data heterogeneity
usually brings about time-consuming convergence of model training, and
hardware heterogeneity usually causes an increase in the waiting time of
training. HL is aimed to tackle model training under the assumption of data
heterogeneity and improve communication efficiency of model sharing.

To define data heterogeneity, given a N-node scenario where each node
possesses m non-IID data samples, $\alpha$% of the set from a main data class
and the left $(100-\alpha)$% randomly drawn from the other classes. Then the
heterogeneity level of the system is defined as $\frac{\alpha}{100}$. For
example, if a node owns 60% of its data from the main data class and 40 % data
from any other supplemental classes, then the heterogeneity level of the
system is 0.6. Moreover, we assume the main data classes of these N nodes are
different from each other. In particular, when the total data classes C is
smaller than the total nodes N, for every $\frac{N}{C}$ nodes, we assign them
the same main data class.

Furthermore, to study the communication cost of model sharing, we adopt a
relative distance $d_{i,j}$ between every two nodes as the measurement, where
a smaller distance represents less communication cost. To simulate distances
between nodes, we employ a symmetrical matrix $D_{i\times j}$ where the
bidirectional distances between two nodes are the same and the distance to a
node itself $d_{i,j|i=j}$ is zero. In addition, each distance $d_{i,j|i\neq
j}$ in the matrix has a random numerical value between 0 and an upper boundary
$\beta$ (Equation 1).

$D_{i\times j}=\begin{pmatrix}d_{1,1}&d_{1,2}&\cdots&d_{1,j}\\\
d_{2,1}&d_{2,2}&\cdots&d_{2,j}\\\ \vdots&\vdots&\ddots&\vdots\\\
d_{i,1}&d_{i,2}&\cdots&d_{i,j}\end{pmatrix}\,\,subject\,to:\,\,d_{i,j|i=j}=0,\,d_{i,j}=d_{j,i},d_{i,j|i\neq
j}\in(0,\beta]$ (1)

Where $D_{i\times j}$ is the symmetrical matrix of distances between nodes,
and $d_{i,j}$ represents the relative distance from node i to node j.

###  3.3 Technical Fundamentals of Homogeneous Learning

Figure 1: Homogeneous learning: self-attention decentralized deep learning.

We propose a novel decentralized deep learning architecture called Homogeneous
Learning (HL) (Fig. 1). HL leverages reinforcement learning (RL) agents to
learn a shared communication policy for node selection, thus contributing to
fast convergence of model training and reduced communication cost for model
sharing. In HL, each node has two machine learning (ML) models, namely a local
foundation model for a specific ML task and an RL model for the decision-
making of peer-to-peer communications.

Moreover, we call a node that initiates a training task the starter node.
First, the starter node initializes and trains a local model on its local
dataset. At the same time, to measure its surrounding environment, the node
requests for the model states of the other nodes in the system. After
completing the training and receiving the state information, the starter
node’s RL agent makes the node selection decision for the next step’s training
based on the observation of its inner state of the trained model and the outer
state from the other nodes. Then, the selected node trains the model
transmitted from the former node using its local dataset. As such, the above
node selection and model training will be repeated until the model performance
achieves the training goal.

####  3.3.1 Local Foundation Model

In this research, we consider an image classification task, the goal of which
is to successfully predict the correct labels of images owned by each node.
Especially in the case of data heterogeneity, a trained model is considered to
have the ability to predict images never seen before. The individual nodes in
an HL system share the same model architecture which we call the local
foundation model. These nodes share training results with each other to learn
the underlying features that bring to a classification decision.

As a local foundation model, we apply a three-layer convolutional neural
network (CNN) model. The first convolutional layer of the CNN model has a
convolution kernel of size 5×5 with a stride of 1 and it takes one input plane
and it produces 20 output planes, followed by a ReLU activation function.
Besides, the second convolutional layer takes 20 input planes and produces 50
output planes and it has a convolution kernel of size 5×5 with a stride of 1,
followed by ReLU. Then the output is flattened followed by a linear
transformation of a fully connected layer, which takes as input the tensor and
outputs a tensor of size 10. Then the categorical cross-entropy is employed to
compute loss. After that, we apply as a learning function the Adam to update
the model based on the loss.

####  3.3.2 Reinforcement Learning Agent

Each node in HL is associated with a reinforcement learning (RL) agent. The
agent of a node aims to learn a shared communication policy by correlating the
observation of the node’s inner state and the outer state represented by the
other nodes in the systems with the reward for an action based on the
observation. As a result, the recursive self-improvement of agents through
constant exploration allows faster learning of the communication policy, which
we call the self-attention mechanism.

There are three main components with respect to RL, namely, the state, the
action, and the reward. Based on the observation of the current state of the
node and its surrounding environment, an agent selects an optimized action
that will update the current state and at the same time receive a reward for
the taken action. In particular, we employ a deep Q-network (DQN), which
approximates a state-value function in a Q-learning framework with a neural
network. Besides, we apply a DQN consisting of three fully connected layers
(Fig. 2). The two hidden layers consist of 500 and 200 neurons respectively,
using as an activation function the ReLU. The output layer consists of $N$
neurons representing the rewards for selecting each of the nodes in the
systems. It applies a linear activation function followed by the mean squared
error loss. Moreover, for each step the agent selects the node with the
largest reward output. In addition, we adopt the Adam as a learning function
of the DQN model.

Figure 2: The self-attention mechanism based on a deep Q-network.

Moreover, to train a DQN model of a node $i$, we employ the node $i$’s model
parameters $w_{i}$ as the inner state and the model parameters from the other
nodes $w_{j|j\in N,\,j\neq i}$ as the outer state. Then, by concatenating the
inner state and the outer state, it forms a feature vector representing the
current state of the system. Due to the adopted foundation model of each node
includes 33580 parameters, the principal component analysis (PCA) is used for
dimension reduction. As a result, we convert the state feature vector from
33580 dimensions to N dimensions, where N is the number of total nodes in the
systems. After that, based on the extracted feature vector, the DQN agent
takes an action by selecting any node including itself for the next step’s
model training. Furthermore, every step $t$, a trained foundation model is
evaluated with a hold-out validation set, and a reward $r_{t}$ defined in (2)
is computed from the validation accuracy, the communication distance between
the former node and the current node, and a penalty for taking each step. In
addition, an episode refers to a whole training process of the decentralized
learning, and an episode reward $R$ is defined in (3), which is the
accumulative reward of the current reward and discounted future rewards.

$r_{t}=32^{ValAcc_{t}-GoalAcc}-d_{node_{t},node_{t+1}}-1$ (2)
$R=\sum^{T}_{t=1}\gamma^{t-1}r_{t}$ (3)

Where $ValAcc_{t}$ represents the validation accuracy at the time step t,
$GoalAcc$ is the training goal of the starter node, and
$d_{node_{t},node_{t+1}}$ is the communication distance from the symmetrical
matrix $D_{i\times j}$. We employ an exponentially increasing function to
distinguish between different validation results when the model is close to
convergence resulting in a relatively small variance. Besides, a penalty of
minus one is applied for taking each step of training.

To allow constant exploration of a DQN agent, epsilon is a factor to control
the probability of a decision made by the agent at each step. In detail, for
each step, a random numerical value between 0 and 1 is chosen and then
compared with the latest epsilon. If the random value is greater than the
epsilon, the agent will take an action based on the DQN model. In contrast, if
it is less than or equal to the epsilon, the agent will take a random action
instead. For either case, a sample consisting of the state, the action, the
reward, and the next state will be stored in the replay memory of the agent
for future policy updating. Furthermore, a progressively decaying epsilon is
applied to increase the agent’s decision-makings with the progress of
training, defined in (4).

$Epsilon_{T+1}=Epsilon_{T}\cdot e^{-Decay}$ (4)

Where $Epsilon_{T+1}$ is the next episode’s epsilon, $e$ is the Euler’s number
approximately equal to 2.71828, and $Decay$ is the epsilon decay for
decreasing the epsilon every episode.

For each episode, the decentralized learning terminates when the model
achieves the training goal or exceeds the maximum step of actions. Moreover,
at the end of each episode, the DQN model is updated by training on a small
subset of samples drawn from the replay memory, defined in (5). The updated
DQN model is shared with all nodes in the systems. As a result, agents perform
better and better in predicting the reward for selecting a specific node for
the next round, thus improving the final episode reward and reducing the total
training rounds and the communication cost.

$L(w_{T}^{dqn})=\sum_{i=1}^{B}l(r_{i}+\rho\,\underset{a}{max}\,Q(a,s^{{}^{\prime}}_{i};w_{T}^{dqn}),Q(a_{i},s_{i};w_{T}^{dqn}))$
(5)
$\theta^{*}=arg\,\underset{\theta}{min}L(\theta),\,subject\,to\,\,\theta=w_{T}^{dqn}$

Where $w_{T}^{dqn}$ is the DQN model’s weights, $s_{i}$ is the system’s
current state, $s^{{}^{\prime}}_{i}$ is the next step’s system state, $a_{i}$
is the taken action for the current step, $a$ is the predicted next step’s
action that maximizes the future reward, $\rho$ is the discount factor of the
future reward, $Q$ is a feed-forward function to infer the output of the DQN
model, $l$ is the mean squared error loss function, $r_{i}$ is the current
step’s reward, and B is the training sample size from the replay memory.

The training phase of HL is defined in Algorithm 1. Algorithm 2 demonstrates
the application phase of HL after obtaining the optimized communication policy
for node selection.

Algorithm 1 Model Training of Homogeneous Learning

1:Training:

2:initialize $w^{dqn}_{0}$

3:for each episode $T=1,2,...$ do

4: initialize $w^{i}_{0}$ $\triangleright$ $w^{i}_{t}$ is model weights of
$Node_{i}$

5: $node_{t}=i$

6: for each step $t=0,1,2,...$ do

7: while $ValAcc_{t}<GoalAcc$ and $t<t_{max}$ do $\triangleright$ $t_{max}$ is
the maximum episode steps

8: $ValAcc_{t},w_{t+1}^{i},w_{t+1}^{dqn}=HL(w_{t}^{i},w_{t}^{dqn})$

9: Send $\\{w_{t+1}^{i},w_{t+1}^{dqn}\\}$ to $node_{t+1}$ for the next step’s
model update

10: end while

11: end for

12: $Epsilon_{T+1}=Epsilon_{T}\cdot e^{-Decay}$

13:end for

14:

15:function HL($w_{t}^{i},w_{t}^{dqn}$)

16: $w_{t+1}^{i}=Train(w_{t}^{i},m_{i})$ $\triangleright$ $m_{i}$ is
$Node_{i}$’s local training data

17: $State_{t}^{inner}=w_{t+1}^{i}$ $\triangleright$ Inner state of the node

18: $State_{t}^{outer}=\\{w_{t}^{j}\mid j\neq i,j\in N\\}$ $\triangleright$
Outer state of the surrounding environment

19: $s_{t}=Concatenate(State_{t}^{inner},State_{t}^{outer})$

20: $a_{t}=Q(s_{t};w_{t}^{dqn},Epsilon_{T})$

21: $node_{t+1}=a_{t}$

22: $r_{t}=32^{ValAcc_{t}-GoalAcc}-d_{node_{t},node_{t+1}}-1$

23: Add $\\{s_{t},a_{t},r_{t}\\}$ to the replay memory

24: $w_{t+1}^{dqn}=Train(w_{t}^{dqn},B\in replay\ memory)$

25: return $Acc_{t},w_{t+1}^{i},w_{t+1}^{dqn}$

26:end function

Algorithm 2 Application of Homogeneous Learning

1:initialize $w_{0}^{i}$

2:$node_{t}=i$

3:for each step $t=0,1,2,...$ do

4: while $ValAcc_{t}<GoalAcc$ do

5: $w_{t+1}^{i}=Train(w_{t}^{i},m_{i})$

6: $State_{t}^{inner}=w_{t+1}^{i}$

7: $State_{t}^{outer}=\\{w_{t}^{j}\mid j\neq i,j\in N\\}$

8: $s_{t}=Concatenate(State_{t}^{inner},State_{t}^{outer})$

9: $a_{t}=Q(s_{t};w^{dqn})$

10: $node_{t+1}=a_{t}$

11: Send $\\{w_{t+1}^{i},w^{dqn}\\}$ to $node_{t+1}$ for the next step’s model
update

12: end while

13:end for

##  4 Evaluation

###  4.1 Experiment Setup

####  4.1.1 Dataset

We applied MNIST (LeCun et al., 2010), a handwritten digit image dataset
containing 50,000 training samples and 10,000 test samples labeled as 0-9, to
evaluate the performance of the proposed method. Then, a 10-node scenario
training on the MNIST dataset was studied for achieving a validation accuracy
goal of 0.80. Moreover, we conducted all experiments on a GPU server with 60
AMD Ryzen Threadripper CPUs, two NVidia Titan RTX GPUs with 24 GB RAM each,
and Ubuntu 18.04.5 LTS OS. The machine learning library we used to build the
system is Tensorflow.

####  4.1.2 Baseline Models

To compare the performance of the proposed approach, we considered three
different model training methods as baselines, which are centralized learning
with all data collected from the 10 nodes, decentralized learning with a
random node selection policy, and standalone learning of the starter node on
its local data without model sharing. In detail, for each method, we applied
the same local foundation model architecture and associated model training
hyperparameters using the training set data from MNIST. The goal is to achieve
a validation accuracy of 0.80 for a trained model on the hold-out test set of
the MNIST dataset. Besides, regarding the standalone method, we utilized the
early stopping to monitor the validation loss of the model at each epoch with
a patience of five, which automatically terminated the training process when
there appeared no further decrease in the validation loss of the model for the
last five epochs. Furthermore, in the centralized and standalone learning,
evaluation was performed at each epoch of the training. On the other hand, in
decentralized learning, due to multiple models in a system, the evaluation was
performed on the trained local model of each step’s selected node.

####  4.1.3 Homogeneous Learning Settings

Homogeneous Learning (HL) of N=10 nodes with a heterogeneity level of 0.8 was
adopted. Each node i owned a total of m=500 non-IID data samples, 80% of the
set from a main data class $c^{i}_{main}$ and the left 20% randomly drawn from
the other classes $c^{i}_{sup}$. Moreover, the main data classes of these 10
nodes were different from each other (subject to $c_{main|i\in
N}^{i}=i,i\in\\{0,1,2,3,4,...,9\\}$). Likewise, the training goal of HL was
0.80 based on the validation accuracy of a selected node’s model at each round
with the test set of MNIST. In addition, to generate the distance matrix, the
relative communication cost represented by the distance between two different
nodes $d_{i,j|i\neq j}$ takes a random numerical value between 0 and 0.1.
Besides, a random seed of 0 was adopted for the reproducibility of the
distance matrix (See A.1).

For the local foundation model training, we adopted an epoch of one with a
batch size of 32. A further discussion on the selection of these two
hyperparameters can be found in the section A.2. Moreover, the Adam was
applied as an optimization function with a learning rate of 0.001.

###  4.2 Numerical Results

####  4.2.1 Communication Policy Updating Based on Deep Q-Networks

As aforementioned, each node has a specific main data class. We considered a
starter node with the main data class of digit ’0’. Then, starting from the
starter node, a local foundation model was trained on the current node’s local
data and sent to the next step’s node decided by either a deep Q-network (DQN)
model or a random action based on the epsilon. We adopted an initial epsilon
of one and a decay rate of 0.02. Moreover, the DQN model was updated at the
end of each episode using the hyperparameters defined in Table 1. We applied a
maximum replay memory size of 50,000 and a minimum size of 128, where the
training of the DQN model started only when there were more than 128 samples
in the replay memory and the oldest samples would be removed when samples were
more than the maximum capacity. Furthermore, in every episode, an agent
randomly drew 32 samples from the memory to update its model, with a total of
120 episodes. A relatively small number of episodes is due to time-consuming
model training associated with the policy exploration in decentralized
learning.

Table 1: Hyperparameters in Homogeneous Learning LOCAL FOUNDATION MODEL | DQN MODEL
---|---
Epoch | 1 | Episode | 120
Batch size | 32 | Future reward discount | 0.9
Learning rate | 0.001 | Epsilon decay | 0.02
Optimization function | Adam | Epoch | 1
Maximum training rounds | 35 | Batch size | 16
|  | Learning rate | 0.001

For each episode, we computed the step rewards and the episode reward for the
model training to achieve the performance goal. With the advancement of
episodes, the communication policy evolved to improve the episode reward thus
benefiting better decision-making of the next-node selection. Figure 3
illustrates the episode reward and the mean reward over the last 10 episodes
during the DQN model training.

Figure 3: With the increase of episodes, the mean reward over last 10 episodes
is gradually increasing. The DQN model learned a better communication policy
by training on samples from the replay memory, which could contribute to the
systems’ performance concerning required total training rounds and
communication cost.

####  4.2.2 Comparisons Regarding Computational and Communication Cost

To compare the performance between HL and the aforementioned three baseline
models, we performed a comprehensive evaluation against the metrics of
computational cost and communication cost. Notably, the computational cost
refers to the required total rounds for a system to achieve the training goal,
and the communication cost refers to the total communication distance for the
model sharing in decentralized learning.

Figure 4: Validation accuracy at each round of model training based on four
different methods.

Figure 5: Performance comparison between the random policy-based decentralized
learning and our method (HL). Each error bar illustrates ten individual
experiments’ results.

##### Computational Cost

Figure 4 shows the total training rounds required for each method to achieve
the final goal. First, for the standalone learning, due to its limited local
training data, the training appeared to be extremely slow after the validation
accuracy reached 0.70. Finally, it terminated with a final accuracy of around
0.75 due to the early-stopping strategy. Moreover, by comparing the
decentralized learning methods with and without the self-attention mechanism,
the result suggests that our proposed method of HL can greatly reduce the
total training rounds. In addition, though centralized learning shows the
fastest convergence, it suffers from problems of data privacy.

##### Communication Cost

In decentralized learning, to train a model, each selected node trains the
current model on its local dataset and sends the trained model to another
node, and the communication cost refers to the network traffic payload for
sending model weights. We studied the relative cost by introducing the
communication distance between every two nodes. Then, the communication cost
of a decentralized method is defined as the total communication distance for
the model sharing, from the starter node to the last selected node.

We performed ten individual experiments for each method and used as final
results the best cases of node selection over the last five episodes when
decisions were almost made by the agent and a learned communication policy was
prone to be stable. Figure 5 illustrates the experiment results of the total
training rounds and the communication cost when applying the two methods
respectively. The bottom and top of the error bars represent the $25_{th}$ and
$75_{th}$ percentiles respectively, the line inside the box shows the median
value, and outliers are shown as open circles. Finally, the evaluation result
shows that HL can greatly reduce the training rounds by 50.8% and the
communication cost by 74.6%.

##  5 Conclusion

Decentralized deep learning (DDL) leveraging distributed data sources
contributes to a better neural network model while safeguarding data privacy.
Despite the broad applications of DDL models such as federated learning and
swarming learning, the challenges regarding edge heterogeneity covering the
data heterogeneity and device heterogeneity have greatly limited their
scalability. In this research, we proposed a self-attention decentralized deep
learning method of Homogeneous Learning (HL) that recursively updates a shared
communication policy by observing the system’s state and the gained reward for
taking an action based on the observation. We comprehensively evaluated the
method by comparing it with three baseline models, applying as criteria the
computational and communication cost for achieving the training goal. The
evaluation result shows that HL can greatly reduce the above two types of
cost. In future, a decentralized model leveraging various communication
policies at the same time to achieve diverse goals is considered for the
further study of this research.

## References

  * Konečný et al. (2016) Jakub Konečný, H. Brendan McMahan, Felix X. Yu, Peter Richtarik, Ananda Theertha Suresh, and Dave Bacon.  Federated learning: Strategies for improving communication efficiency.  In _NIPS Workshop on Private Multi-Party Machine Learning_ , 2016\.
  * Parimala et al. (2021) Mani Parimala, R. M. Swarna Priya, Quoc-Viet Pham, Kapal Dev, Praveen Kumar Reddy Maddikunta, Thippa Reddy Gadekallu, and Thien Huynh-The.  Fusion of federated learning and industrial internet of things: A survey.  _ArXiv_ , abs/2101.00798, 2021.
  * Gao et al. (2020) Yujia Gao, Liang Liu, Binxuan Hu, Tianzi Lei, and Huadong Ma.  Federated region-learning for environment sensing in edge computing system.  _IEEE Transactions on Network Science and Engineering_ , 7(4):2192–2204, 2020.  doi: 10.1109/TNSE.2020.3016035.
  * Liu et al. (2020) Yang Liu, Anbu Huang, Yun Luo, He Huang, Youzhi Liu, Yuanyuan Chen, Lican Feng, Tianjian Chen, Han Yu, and Qiang Yang.  Fedvision: An online visual object detection platform powered by federated learning.  _Proceedings of the AAAI Conference on Artificial Intelligence_ , 34(08):13172–13179, Apr. 2020.  doi: 10.1609/aaai.v34i08.7021.  URL https://ojs.aaai.org/index.php/AAAI/article/view/7021.
  * Pokhrel and Choi (2020) Shiva Raj Pokhrel and Jinho Choi.  Federated learning with blockchain for autonomous vehicles: Analysis and design challenges.  _IEEE Transactions on Communications_ , 68(8):4734–4746, 2020.  doi: 10.1109/TCOMM.2020.2990686.
  * Liu et al. (2019) Boyi Liu, Lujia Wang, Ming Liu, and Chengzhong Xu.  Lifelong federated reinforcement learning: A learning architecture for navigation in cloud robotic systems.  _CoRR_ , abs/1901.06455, 2019.  URL http://arxiv.org/abs/1901.06455.
  * Sun et al. (2021) Yuwei Sun, Hiroshi Esaki, and Hideya Ochiai.  Adaptive intrusion detection in the networking of large-scale lans with segmented federated learning.  _IEEE Open J. Commun. Soc._ , 2:102–112, 2021.  doi: 10.1109/OJCOMS.2020.3044323.  URL https://doi.org/10.1109/OJCOMS.2020.3044323.
  * Rahman et al. (2020) Sawsan Abdul Rahman, Hanine Tout, Chamseddine Talhi, and Azzam Mourad.  Internet of things intrusion detection: Centralized, on-device, or federated learning?  _IEEE Network_ , 34(6):310–317, 2020.  doi: 10.1109/MNET.011.2000286.
  * McMahan et al. (2018) H. Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang.  Learning differentially private recurrent language models.  In _6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings_. OpenReview.net, 2018.  URL https://openreview.net/forum?id=BJ0hF1Z0b.
  * Cao et al. (2019) Di Cao, Shan Chang, Zhijian Lin, Guohua Liu, and Donghong Sun.  Understanding distributed poisoning attack in federated learning.  In _25th IEEE International Conference on Parallel and Distributed Systems, ICPADS 2019, Tianjin, China, December 4-6, 2019_ , pages 233–239. IEEE, 2019.  doi: 10.1109/ICPADS47876.2019.00042.  URL https://doi.org/10.1109/ICPADS47876.2019.00042.
  * Nguyen et al. (2020) T. Nguyen, P. Rieger, Markus Miettinen, and A. Sadeghi.  Poisoning attacks on federated learning-based iot intrusion detection system.  2020\.
  * Duan et al. (2021) Moming Duan, Duo Liu, Xianzhang Chen, Renping Liu, Yujuan Tan, and Liang Liang.  Self-balancing federated learning with global imbalanced data in mobile systems.  _IEEE Trans. Parallel Distributed Syst._ , 32(1):59–71, 2021.  doi: 10.1109/TPDS.2020.3009406.  URL https://doi.org/10.1109/TPDS.2020.3009406.
  * Warnat-Herresthal et al. (2021) Stefanie Warnat-Herresthal, Hartmut Schultze, Krishnaprasad Lingadahalli Shastry, Sathyanarayanan Manamohan, Saikat Mukherjee, Vishesh Garg, Ravi Sarveswara, Kristian Händler, Peter Pickkers, N. Ahmad Aziz, Sofia Ktena, Christian Siever, Michael Kraut, Milind Desai, Bruno Monnet, Maria Saridaki, Charles Martin Siegel, Anna Drews, Melanie Nuesch-Germano, Heidi Theis, Mihai G. Netea, Fabian Theis, Anna C. Aschenbrenner, Thomas Ulas, Monique M.B. Breteler, Evangelos J. Giamarellos-Bourboulis, Matthijs Kox, Matthias Becker, Sorin Cheran, Michael S. Woodacre, Eng Lim Goh, Joachim L. Schultze, and German COVID-19 OMICS Initiative (DeCOI).  Swarm learning for decentralized and confidential clinical machine learning, 2021.
  * Li et al. (2021) Yuzheng Li, Chuan Chen, Nan Liu, Huawei Huang, Zibin Zheng, and Qiang Yan.  A blockchain-based decentralized federated learning framework with committee consensus.  _IEEE Netw._ , 35(1):234–241, 2021.  doi: 10.1109/MNET.011.2000263.  URL https://doi.org/10.1109/MNET.011.2000263.
  * Lu et al. (2020) Yunlong Lu, Xiaohong Huang, Yueyue Dai, Sabita Maharjan, and Yan Zhang.  Blockchain and federated learning for privacy-preserved data sharing in industrial iot.  _IEEE Transactions on Industrial Informatics_ , 16(6):4177–4186, 2020.  doi: 10.1109/TII.2019.2942190.
  * Mowla et al. (2020) Nishat I. Mowla, Nguyen H. Tran, Inshil Doh, and Kijoon Chae.  Federated learning-based cognitive detection of jamming attack in flying ad-hoc network.  _IEEE Access_ , 8:4338–4350, 2020.  doi: 10.1109/ACCESS.2019.2962873.
  * Sener and Savarese (2018) Ozan Sener and Silvio Savarese.  Active learning for convolutional neural networks: A core-set approach.  In _6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings_. OpenReview.net, 2018.  URL https://openreview.net/forum?id=H1aIuk-RW.
  * Wang et al. (2020) Hao Wang, Zakhary Kaplan, Di Niu, and Baochun Li.  Optimizing federated learning on non-iid data with reinforcement learning.  In _39th IEEE Conference on Computer Communications, INFOCOM 2020, Toronto, ON, Canada, July 6-9, 2020_ , pages 1698–1707. IEEE, 2020.  doi: 10.1109/INFOCOM41043.2020.9155494.  URL https://doi.org/10.1109/INFOCOM41043.2020.9155494.
  * Zhao et al. (2018) Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, and Vikas Chandra.  Federated learning with non-iid data.  _CoRR_ , abs/1806.00582, 2018.  URL http://arxiv.org/abs/1806.00582.
  * Jeong et al. (2018) Eunjeong Jeong, Seungeun Oh, Hyesung Kim, Jihong Park, Mehdi Bennis, and Seong-Lyun Kim.  Communication-efficient on-device machine learning: Federated distillation and augmentation under non-iid private data.  _CoRR_ , abs/1811.11479, 2018.  URL http://arxiv.org/abs/1811.11479.
  * (21) General data protection regulation.  https://gdpr-info.eu.  Accessed: 2021-09-22.
  * LeCun et al. (2010) Yann LeCun, Corinna Cortes, and CJ Burges.  Mnist handwritten digit database.  _ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist_ , 2, 2010.

##  Appendix A Appendix

###  A.1 Communication Distance Matrix

Figure 6 illustrates the generated distance matrix $D_{i\times j}$ when
applying a $\beta$ value of 0.1 and a random seed of 0.

Figure 6: The adopted distance matrix $D_{i\times j}$.

###  A.2 Optimization of Model Distribution Representation

Under the assumption of data heterogeneity, to allow a reinforcement learning
(RL) agent to efficiently learn a communication policy by observing model
states in the systems, a trade-off between the batch size and the epoch of
local foundation model training was discussed. Figure 7 illustrates the
trained models’ weights distribution after applying the principal component
analysis (PCA), with different batch sizes and epochs applied to train on the
MNIST dataset. Moreover, it shows a 100-node scenario where each color
represents nodes with the same main data class. As shown in the graphs,
various combinations of these two parameters have different distribution
representation capabilities. By comparing the distribution density and scale,
we found that when adopting a batch size of 32 and an epoch of one the models
distribution was best represented, which could facilitate the policy learning
of an agent.

Figure 7: Optimization of model distribution representation.


# Prospects for gamma-ray observations of Hercules cluster

V. V. Voitsekhovskyi1

###### Abstract

Galaxy clusters (GCs) are the largest and most massive gravitationally bound
objects in the large-scale structure of the Universe. Due to keV temperatures
of virialized gas in the intracluster medium (ICM) and presence of cosmic rays
(CRs), GCs are effective sources of thermal X-ray radiation and non-thermal
leptonic (synchrotron) radio emission. GCs are also store-rooms for hadronic
CRs, but non-thermal hadronic gamma-ray emission (mainly, due to pp collisions
and subsequent pion decay) from GCs has not been detected yet. In this work we
simulate the expected non-thermal hadronic gamma-ray and neutrino emission
from dominant part of Hercules cluster - GC A2151 - and estimate a perspective
of detection of this emission by existing (Fermi-LAT, LHASSO, IceCube) and
planned (CTA, IceCube-Gen2) ground-based ans space-based detectors.

Key words: Galaxy clusters, Hercules cluster, A2151, gamma-ray emission,
neutrino emission.

1Taras Shevchenko National University of Kyiv, Glushkova ave., 4, 03127, Kyiv,
Ukraine
<EMAIL_ADDRESS>
## introduction

Galaxy clusters (GCs) are the largest virialized structures in the Universe at
the present cosmological time $t_{0}=13.8$ Gyr (a redshift $z_{0}=0.0$)[29]. A
growth of initial density fluctuations due to gravitational instability led to
the formation of main elements of large scale structure: sheet-like
structures, bordered low density voids, and filaments, connected to the high-
density nodes - galaxy clusters and superclusters [26]. The total
gravitational masses $M_{cl}\sim 10^{14}-10^{15}$ M⊙ of GCs include dominant
contribution of dark matter (about 80 % of mass) and much smaller contribution
of baryonic matter ( $\sim 15\%$ of mass in intracluster medium (ICM) gas and
$\sim 5\%$ of mass in stars/galaxies) [15], [7], [4]. Virial temperatures of
ICM plasma $k_{B}T\sim GM_{cl}m_{p}/R_{cl}$ in GCs with typical size
$R_{cl}\sim 2-3$ Mpc are of the order of $1-10$ keV, therefore GCs are
luminous sources of thermal X-ray emission, with typical luminosities
$L_{X}\sim 10^{44}-10^{46}$ erg s-1.

Formation of gravitationally bound and virialised GCs are long-lasting violent
process of main halo collapse and substructures’ merger, that is often not
completed yet. Most clusters have not yet fully relaxed and accretion and
merger processes are still ongoing. Magnetohydrodynamic (MHD) flows in ICM and
in active galactic nuclei (AGN), rich in shock waves, efficiently accelerate
cosmic rays (CR) and enhance/generate magnetic fields in ICM. Once more, in
observed $B_{cl}\sim 1-10\,\mu$G GC magnetic fields the time of diffusive
escape of CR from GCs $t_{dif}\sim R^{2}_{cl}/D(E)$ is of order or larger than
the age of Universe for typical value of diffusion coefficient $D(E)\sim
10^{28}(E/10GeV)^{0.5}$cm2 s-1. As a result, GCs are effective store-rooms for
accelerated CR [7] and, therefore, GCs are expected to be promising sources of
non-thermal leptonic (synchrotron) radio emission as well as of hadronic
(mainly, due to pp collisions and subsequent neutral pion decay) [20], [25].

Indeed, a non-thermal synchrotron radio emission

in MHz $-$ GHz range from relativistic electrons ($E_{e}\sim 10$ GeV) in
clusters’ magnetic fields ($\nu_{syn}\sim 4(B_{cl}/1\mu$ G)($E_{e}$ /10 GeV)2
GHz) is widely presented in observations of GCs [28], but non-thermal gamma-
ray emission from GCs has not been detected yet [1], [30].

Both non-thermal radio- and thermal X-ray emission, supplemented by data of
Planck thermal SZ effect, give a valuable information about dark/baryon matter
distribution and physical processes in ICM of GCs [2]. In our work we have
carried out a modelling of non-thermal hadronic gamma-ray and neutrino
emission from Abell cluster A2151 (a dominant part of Hercules cluster) and
estimate prospects for gamma-ray observations of A2151 by existing and planned
((Fermi-LAT, LHASSO, IceCube, CTA, IceCube-Gen2) ground-based and space-based
detectors. For calculation we use code MINOT [2] and $\Lambda$CDM cosmological
model with $H_{0}=70$ km s-1 Mpc-1, $\Omega_{M}=0.3$, $\Omega_{\Lambda}=0.7$.

## hercules cluster

The nearby ( z=0.0367) Hercules supercluster is one of the most massive
structures in the Local Universe. It is composed by Abell clusters A2151 (the
Hercules cluster), A2147 and A2152 [6]. The most prominent GC A2151 with mass
$M_{200}=4.00\times 10^{14}M_{\odot}$ and size $R_{200}=1.45$ Mpc includes
three subclusters and is still in the processes of collapsing and mergers [3].
There are 7 AGN-type galaxies in central part of A2151, including NGC 6050 in
Arp 272 - a pair of interacting galaxies NGC 6050 and IC 1179.

Considered in this paper GC A2151 contains nearly 360 galaxies, and its
optical center have coordinates R.A. = $241.34^{\circ}$ and Dec =
$17.75^{\circ}$ [3]. This cluster demonstrates significant division into
several substructures, particularly, bright central bimodal subclump A2151C
and two fainters - A2151E and A2151N. Based on Chandra and XMM-Newton
observation, A2151C also can be divided into two substructures - bright
central A2151C(B) and fainter lateral A2151C(F) [27]. According to state of
the art sensitivity of our $\gamma$-ray detectors, only A2151C has a chance to
be detected, so aim of this paper is to inspect this problem.

Physical conditions and spherically-symmetric dark/baryonic matter
distribution in ICM of GC are determined mainly by two global GC parameters -
its total mass $M_{cl}$ and size $R_{cl}$. There are several types of
characteristic masses that we have used in modelling. $M_{500}$ denotes the
mass that is enclosed inside the radius $R_{500}$, where a mean density
(averaged on volume) exceeds critical density 500 times
$\rho/\rho_{crit}=500$. Corresponding values are related to each other by
following relation:

$M_{500}=\frac{4\pi}{3}500\rho_{crit}R_{500}^{3}$ (1)

Total mass $M_{tot}$ of GC can be expressed as $M_{tot}=M_{HSE}/(1-b_{HSE})$,
where $M_{HSE}$ is the hydrostatic mass derived from hydrostatical equilibrium
and $b_{HSE}\sim 0.2$ is the hydrostatic mass bias [22], [24]. Spatial
distribution of gas mass fraction in GC $f_{gas}(r)$ is determined as the
ratio of the gas mass $M_{gas}(r)$ and the total mass $M_{tot}(r)$
$f_{gas}(r)=M_{gas}(r)/M_{tot}(r)$.

Gas electron density profile $n_{e}(r)$ is an important parameter for
estimating gamma-ray emission, because it is proportional to total gas density
$n_{gas}(r)$, that describes the intensity of proton-proton interactions.
There are several theoretical models to describe $n_{e}(r)$, particularly,
analytical beta model [10] that was used in this work:

$n_{e}(r)=n_{e,0}\left[\,1+\left(\frac{r}{r_{c}}\right)^{2}\,\right]^{-3\beta_{dens}/2}$
(2)

where $n_{e,0}$ is the normalisation factor, $r_{c}$ is the core radius of
density distribution, $\beta_{dens}$ is the density index.

Thermal gas pressure is also important, because it allows to normalize the
number of CR. Electron thermal pressure $P_{e}(r)$ is often described by
Generalized Navarro Frank White (GNFW) profile [18] as an improved version of
the earlier Navarro Frenk White profile (NFW) [19]. Universal pressure profile
(UPP) for electrons $\mathbb{P}_{e}(r)$ depends on four parameters: the
normalization factor $P_{0}$, the scale radius $r_{p}=R_{500}/c_{500}$ (where
$c_{500}$ is the concentration parameter for region bounded by $R_{500}$), and
three power indices $a_{p}$,$b_{p}$, $c_{p}$, which denote distribution slope
for different spatial regions ($r<r_{s}$, $r\approx r_{s}$ and $r>r_{s}$,
respectively):

$\mathbb{P}_{e}(r)=P_{0}\cdot\left(r/r_{p}\right)^{-c_{p}}\cdot(1+(r/r_{p})^{a_{p}})^{(c_{p}-b_{p})/a_{p})}$
(3)

In order to describe physical processes in particular GC, it is necessary to
multiply UPP (3) by several scale factors: $P_{e}(r)=\mathbb{P}_{e}(r)\times
P_{500}\times F_{500},$ where $P_{500}$ is the characteristic pressure [18],
[5], which can be determined by mass and cosmological parameters:

$P_{500}=1.65\times 10^{-3}E(z)^{8/3}\left(\frac{M_{500}}{3\times
10^{14}h_{70}^{-1}M_{\odot}}\right)^{2/3}h_{70}^{2}$ (4)

and the corrective factor $F_{500}$ makes modification by mass due to the
self-similarity of GC:

$F_{500}=\left(\frac{M_{500}}{3\times
10^{14}h_{70}^{-1}M_{\odot}}\right)^{0.12}$ (5)

Here $H_{0}=100h$ km/s/Mpc, $h_{70}=h/0.70$, and $E(z)=H(z)/H(0)$ or
$E^{2}(z)=\Omega_{M}(1+z)^{3}+\Omega_{\Lambda}$.

For ICM with hydrogen X=0.725, helium Y=0.270 and heavy elements’ mass
fraction Z = 1-X-Y= 0.005, the mean molecular weights are $\mu_{gas}=0.60$,
$\mu_{e}=1.15$, and now we can express the pressure, density and temperature
of ICM gas through the pressure and number density of ICM electrons [2]:

$P_{gas}(r)=(\mu_{e}/\mu_{gas})P_{e}(r),\,\rho_{gas}(r)=(\mu_{e}/\mu_{gas})m_{H}n_{e}(r),\,k_{B}T_{gas}(r)=\mu_{gas}m_{H}(P_{gas}(r)/\rho_{gas}(r))$
(6)

Magnetic field distribution is following matter distribution [8], [16]. Based
on magnetic freezing conditions, spatial distribution of magnetic field can be
expressed as proportional to some power $\eta_{B}$ of density profile:
$B(r)=B_{0}(n_{e}(r)/n_{e,0})^{\eta_{B}}$. Normalisation factor $B_{0}$ is set
to $5\mu G$, as typical value for GCs, that was measured for Coma cluster
based on Faraday rotation data. [8].

Spatially-energetic distribution of CR - nuclei (mainly protons, i=p) and
electrons ($i=e_{1}$ for primary ICM electrons, $i=e_{2}$ for secondary
electrons produced in inelastic collisions) in ICM can be divided into the
product of energetic and spatial distributions:

$dN_{i}(E,r)/dE=A_{i}f_{i}(E)\phi_{i}(r)$ (7)

ICM protons and electrons, accelerating on shock waves inside GCs, acquire a
power law distribution by energies. In particular, the classic power law with
exponential cut-off energy spectrum was used in this work:

$f_{i}(E)=A_{i}\times\left(\frac{E}{E_{0,i}}\right)^{-\alpha_{i}}\times
exp\left(-\frac{E}{E_{cut,i}}\right)$ (8)

where $\alpha_{i}$ is the spectral index, and cut-off occurs at energies
$E_{cut,i}$ ($i=p,e1$). Normalization factor $A_{i}$ is determined by the
ratio of CR energy to thermal energy inside sphere with radius $r=R_{500}$.
This ratio can be calculated as
$X_{cr,i,th}=U_{CR,i}(R_{500})/U_{th}(R_{500})$, where $U_{CR}$ and $U_{th}$
are CR and thermal energy, respectively. Typical values are
$X_{cr,p,th}\approx 0.02-0.10$, $X_{cr,e,th}\approx 0.0001-0.001$. Spatial
distribution of CR in ICM is related to gas distribution and is approximated
by power law dependence:

$\phi_{i}(r)=\left(\frac{n_{e}(r)}{n_{e}(0)}\right)^{\eta_{CR,i}}$ (9)

It is also important to note such key parameter as the truncation radius
$R_{trunc}$, which is used to denote physical boundaries of region that
contains entire GC volume, outside which density drops to zero. There is
discontinuity in thermodynamic parameters at this distance from center of GC.
It indicates region of accretion shock radius, where kinetic energy of
accretion is converted into thermal energy [13]. Size of this region depends
on characteristic radius $R_{trunc}=3R_{500}$.

## gamma-ray and neutrino emission of A2151

Characteristics of thermal and non-thermal emission of GCs are determined by
spatial distribution of matter (dark and barionic), magnetic fields and CR
(leptonic and hadronic components) inside ICM. To recover this distributions
we can use observational data about thermal X-ray emission and CMB distortions
due to the thermal Sunyaev-Zel’dovich (tSZ) effect. These data allow to
recover a spatial distribution of partial pressure of electrons $P_{e}(r)$ and
of total pressure of baryonic gas $P_{tot}(r)$ inside ICM. According to
presented above formulae we can build then up the distributions of magnetic
fields and CR inside ICM.

Recent work [27] presents new observational results concerning thermal X-ray
emission and recovering of thermodynamic parameters of ICM plasma of brightest
subclumps A2151CB and A2151CF in GC A2151. Corresponding parameters of ICM in
subclumps A2151CB and A2151CF we used for modeling of their gamma-ray and
neutrino emission, are presented in Table 1. Based on these data, we
calculated normalization factor $P_{0}$ for pressure profile from Eq. (3). Its
value is denoted by star in Table 1. Other parameters of pressure distribution
was taken from Plank Universal Profile 2013 [21]. We need also to take into
account the gamma-ray flux absorption by interaction with an extragalactic
background light (EBL) [9]. For this purpose we have used Python package
ebltable111https://github.com/me-manu/ebltable/.

Using described above parameters of galaxy cluster and cosmic rays as input
ones, we use open available online222https://github.com/remi-adam/minot Python
language-based software MINOT (modeling the intracluster medium (non-)thermal
content and observable prediction tools). MINOT simulates the intracluster
diffuse thermal and nonthermal broad-band (from radio- to gamma-ray) and
neutrino emission and as an output calculates the multiwavelength observable
spectra, profiles, fluxes, and images for the radio (synchrotron), X-ray
(thermal Bremsstrahlung), gamma-ray (inverse Compton and hadronic processes),
and neutrino (hadronic processes) messengers [2].

Table 1: Simulation parameters  Global Parameters | A2151CB | A2151CF
---|---|---
z | 0.0368 | 0.0368
$M_{500}$ in $[10^{13}M_{\odot}]$ | $9.08\pm 5.24$ | $3.01\pm 2.11$
$R_{500}$ in $[kpc]$ | $803.38\begin{subarray}{c}+113.18\\\ -172.13\end{subarray}$ | $566.09\begin{subarray}{c}+89.09\\\ -158.26\end{subarray}$
$R_{trunc}$ in $[kpc]$ | 2410.15 | 1698.28
helium mass fraction | 0.2735 | 0.2735
metallicity | 0.0153 | 0.0153
abundance | 0.43 | 0.13
hydrostatic mass bias | 0.2 | 0.2
$X_{cr,p}=U_{cr,p}/U_{th}$ inside $R_{500}$ | 0.1 | 0.1
$X_{cr,e1}=U_{cr,e1}/U_{th}$ inside $R_{500}$ | 0.01 | 0.01
$E_{p,min}$ in [GeV] | 1.21 | 1.21
$E_{p,cut}$ in [TeV] | $30$ | $30$
$E_{p,max}$ in [TeV] | $10^{6}$ | $10^{6}$
Spectral index $\alpha_{p}$ (Model) | 1.5 (PLEC) | 1.5 (PLEC)
$E_{e1,min}$ in [keV] | 511 | 511
$E_{e1,break}$ in [GeV] | - | -
$E_{e1,cut}$ in [TeV] | $10^{6}$ | $10^{6}$
$E_{e1,max}$ in [TeV] | $10^{6}$ | $10^{6}$
Spectral index $\alpha_{e1}$ (Model) | 2.3 (PL) | 2.3 (PL)
Density $CR_{p}$ model |  |
$n_{CR,p}(r)\propto n_{e}(r)^{\eta_{CR,p}}$ | $\eta_{CR,p}=1.0$ | $\eta_{CR,p}=1.0$
Density $CR_{e1}$ model |  |
$n_{CR,e}(r)\propto n_{e}(r)^{\eta_{CR,e}}$ | $\eta_{CR,e}=1.0$ | $\eta_{CR,e}=1.0$
Pressure gas model (GNFW): |  $P_{0}$+PUP |  $P_{0}$+PUP
$P_{0}$ $[keV/cm^{3}]$ | $0.009^{*}$ | $0.0077^{*}$
$a_{p}$ | 1.33 | 1.33
$b_{p}$ | 4.13 | 4.13
$c_{p}$ | 0.31 | 0.31
$c_{500}$ | 1.81 | 1.81
Density gas model (beta ) |  |
$n_{0}$ $[cm^{-3}]$ | 0.00875 | 0.0049
$r_{c}$ [kpc] | 19.35 | 10.43
$\beta_{dens}$ | 0.38 | 0.28
Magnetic field (Eq.(LABEL:eqn:beta-magfield)) |  |
$B_{0}$ $[\mu G]$ | 5 | 5
$\eta_{B}$ | 2/3 | 2/3

Main results of gamma-ray and neutrino emission for A2151CB and A2151CF
subclumps are presented in Fig 1-5. The most promising for CTA-detection cases
correspond to hard CR spectrum (spectral index $\alpha_{p}<2$). In particular,
Fig. 4 demonstrates expected gamma-ray flux from the central brightest
subclump A2151CB for $\alpha_{p}=1.5$ and for three values of cluster mass -
average mass and $\pm\Delta m$ from Table 1. Meantime, there is no significant
increase in flow due to more compact CR distribution (a result of
magnification of $\eta_{CR,p}$ twice is shown in Fig. 4).

For comparing different models of CR distribution in ICM, we have simulated
gamma-ray flux for three values of spectral index - see Fig. 4 and Fig. 4. As
we can see from these figures, there is a possibility for CTA to detect the
brighest subclump A2151CB in case of hard CR spectrum, instead of A2151CF,
that has relatively low flux for all CR distribution models (Fig. 4.
Calculated neutrino flux from the brightest subclump A2151CB together with
IceCube discovery potential at significance level 5$\sigma$ is shown in Fig.
5. As we can see from this figure, neutrinos do not suffer from energy losses
as photons do due to EBL absorption. This fact can make neutrino emission to
be a good probe for GC in the future.

Figure 1: Spectral flux from A2151CB for three values of cluster mass
$M_{500}$ and $M_{500}\pm\Delta m$. Other parameters as in Table 1

Figure 2: Spectral flux from A2151CB for three values of spectral index. CRs
distribution $CRp\propto n_{e}(r)^{2}$. Other parameters as in Table 1

Figure 3: Spectral flux from A2151CB for three values of spectral index. Other
parameters as in Table 1

Figure 4: Spectral flux from A2151CF for three values of spectral index. Other
parameters as in Table 1

Figure 5: Neutrino flux from the brighest subclump A2151CB with IceCube
$5\sigma$ discovery potential at 1-1000 TeV [14]

## conclusions

Due to a long time for cosmic rays diffusion escape, GCs should be a luminous
extragalactic sources of neutrino and non-thermal gamma-rays, but such
emission has not been detected yet. Using the recent data from [27] about
thermal X-ray emission of brightest subclumps A2151CB and A2151CF in GC A2151
we have carried out a modelling of non-thermal hadronic gamma-ray and neutrino
emission of these subclumps using MINOT code [2]. Results of our simulations
show that under the typical parameters of cosmic ray distribution (cosmic ray
proton to thermal energy ratio $X_{cr.p}\approx 0.04-0.06$, spectral index of
proton power-law energy spectrum $\gamma=2.5$) both non-thermal hadronic
gamma-ray and neutrino emission of subclumps A2151CB and A2151CF are still
undetected by existing and planned detectors. Meantime, backreaction of 7 AGN-
type galaxies in subclumps A2151CB and A2151CF and other unaccounted for
sources of cosmic rays (merging and accretion flows, turbulence etc.) can
increase $X_{cr.p}\approx 0.1$ and provide harder spectral index
$\gamma=1.5-2.0$. In these cases brighter subclump A2151CB can be detected by
CTA at $5\sigma$ level. Hard cosmic ray proton spectrum is promising also for
detection of neutrino fluxes from GCs in future neutrino detectors (IceCube-
Gen2 etc.). Contrary to gamma-ray fluxes, neutrino fluxes do not attenuate by
interaction with the extragalactic background light (EBL), therefore, there
are promising possibilities to detect PeV- neutrinos in case of GCs - cosmic
PeVatrons with hard ($\gamma<2.0$) spectra.

## References

  * [1] Ackermann M., Ajello A., Allafort A. et al., 2014, ApJ, 787, 18
  * [2] Adam R., Goksu H., Leingartner-Goth A. et al., 2020, A&A, 644, A70
  * [3] Agulli I., Aguerri A. L., Diaferio A., Dominguez Palmero L., Sanchez-Janssen R., 2017, MNRAS, 467, 4410
  * [4] Allen S., Evrard A., Mantz A., 2011, ARA&A, 49, 409
  * [5] Arnaud M., Pratt G. W., Piffaretti R. et al., 2010, A&A, 517, A92
  * [6] Barmby P., Huchra J., 1998, ApJ, 115, 1, 6-25
  * [7] Berezinsky V., Blasi P., Ptuskin V., 1997, ApJ, 487, 529
  * [8] Bonafede A, Feretti L., Murgia M. et al., 2010, A&A, 513, A30
  * [9] Dwek E., Krennrich F., 2013, Astroparticle Physics, 43, 112
  * [10] Cavaliere A., Fusco-Femiani R., 1978, A&A, 70
  * [11] Einasto M., Einasto J., Tago E., Müller V., Andernach H., 2001, ApJ, 122, 5
  * [12] Gong Y., Ma Y. Z., Tanimura H., 2019, MNRAS, 486, 4
  * [13] Hurier, G., Adam, R., Keshet, U., 2019, A&A, 622, A136
  * [14] Ice Cube Collaboration et al., The European Physical Journal C, 2019, 79, 234
  * [15] Mohr J., Mathiesen B., Evrard A., 1999, ApJ, 517, 627–649
  * [16] Murgia M., Govoni F., Feretti L. et al., 2004, A&A 424, 2
  * [17] Ma Y. Z., Gong Y. et al, 2021, MNRAS, 500, 2
  * [18] Nagai D., Kravtsov A. V., Vikhlinin A., 2007, ApJ, 668, 1
  * [19] Navarro J., Frenk C., White S., 1996, ApJ 462, 563
  * [20] Pfrommer C., EnBlin T., 2004, A&A, 413, 17–36
  * [21] Planck Collaboration et al., 2012, A&A, 550, A131
  * [22] Planck Collaboration et al., 2014, A&A, 571, A20
  * [23] Planck Collaboration et al., 2016, A&A, 594, A13
  * [24] Piffaretti R., Valdarnini R., 2008, A&A, 491, 1
  * [25] Pinzke A., Pfrommer C., 2010, MNRAS, 277, 33
  * [26] Springel V., Frenk C., White S., 2006, Nature, 440, 1137–1144
  * [27] Tiwari J, Pal Singh K., [arXiv:2011.08850v1]
  * [28] van Weeren R.J., de Gasperin F., Akamatsu H., Brüggen M., et al., 2019, Space Sci. Rev., 215, 16
  * [29] Voit G. M., 2005, Reviews of Modern Physics, 77, 207
  * [30] Wittor D., 2021, New Astronomy, 85, 101550
  * [31]