<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>ARCHITECTURE OF A GENERATIVE ADVERSARIAL NETWORK AND PREPARATION OF INPUT DATA FOR MODELING GAMMA EVENT IMAGES FOR THE TAIGA-IACT EXPERIMENT</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>J.Yu. Dubenskaya</string-name>
          <email>jdubenskaya@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A.P. Kryukov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A.P. Demichev</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Skobeltsyn Institute of Nuclear Physics, Moscow State University</institution>
          ,
          <addr-line>Moscow 119991</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <fpage>5</fpage>
      <lpage>9</lpage>
      <abstract>
        <p>Very-high-energy gamma ray photons interact with the atmosphere to give rise to cascades of secondary particles - extensive air showers (EASs), which in turn generate very short flashes of Cherenkov radiation. This flashes are detected on the ground with Imaging Air Cherenkov Telescopes (IACTs). In the TAIGA experiment, in addition to images directly detected and recorded by the experimental facilities, images obtained as a result of simulation are used extensively. Earlier we applied a machine learning technique called Generative Adversarial Networks (GAN) to quickly generate images of gamma events for the TAIGA experiment. The initial analysis of the generated images showed the applicability of the method, but revealed some features that require additional refinement of the network. In particular, it was important to teach the network that in our case images have a specific shape and orientation. In this paper we discuss the possibility of improving the generated images by preprocessing the training dataset. We also present an example of a GAN built and trained with these requirements in mind. Testing the results using third-party software showed that more than 95% of the generated images were found to be correct, while the generation is quite fast: after training the network creates about 400 event images in 1 second.</p>
      </abstract>
      <kwd-group>
        <kwd>machine learning</kwd>
        <kwd>GAN</kwd>
        <kwd>gamma events</kwd>
        <kwd>image generation</kwd>
        <kwd>TAIGA experiment</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Very-high-energy gamma ray photons interact with the atmosphere to give rise to cascades of
secondary particles – extensive air showers (EASs), which in turn generate very short flashes of
Cherenkov radiation. This flashes are detected on the ground with Imaging Air Cherenkov Telescopes
(IACTs) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The TAIGA experiment (Tunka Advanced Instrument for cosmic ray physics and
Gamma Astronomy) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] consists of different detector systems and measures air showers, which are
initiated by charged cosmic rays or high energy gamma rays. The TAIGA Cherenkov telescope array
(TAIGA-IACT) is used for gamma astronomy. In the TAIGA-IACT experiment, in addition to images
directly detected and recorded by the experimental facilities, images obtained as a result of simulation
are used extensively [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The problem is that direct modeling of the underlying physical processes
(such as interactions and decays of a cascade of charged particles in the atmosphere) is a
computationally demanding task, since it tracks the type, energy, position, direction and time of arrival
of all secondary particles born in EAS. On average, using direct computational models, one can get
only about 1000 images per hour. This can result in computational bottleneck for the experiment due
to the lack of model data.
      </p>
      <p>
        To address this challenge, we opted for a machine learning technique called Generative
Adversarial Networks (GAN) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] to quickly generate images of gamma events for the TAIGA-IACT
experiment. GANs are an increasingly popular approach to learning a generative model using deep
neural networks, and have shown great promise in generating clear samples from natural images [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
Our previous work [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] outlines the very first results of this study. We checked the quality of the
generated images with the third party software tool that is used for image classification in the
TAIGAIACT experiment [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This software tool determines gamma likelihood – the probability that an image
is a gamma image. Initial analysis of the images generated by our GAN showed the applicability of the
method, but not all the generated images were considered correct. Further analysis showed that the
network was not good enough at capturing the features of the real gamma images. Because of this, the
image validation tool rejected some images that appeared to be good, and the percentage of generated
images recognized as gamma events was only about 90%.
      </p>
      <p>In this paper, we show how we managed to increase the percentage of correctly generated
images by preprocessing the training set. We also provide a detailed description of the network
architecture used to generate gamma images in the TAIGA-IACT experiment.</p>
    </sec>
    <sec id="sec-2">
      <title>2. GAN architecture for gamma events</title>
      <p>
        Each classical GAN [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is a system of two neural networks that are trained simultaneously in
an adversarial game: a generative network (Generator) that captures the data distribution, and a
discriminative network (Discriminator) that estimates the probability that a sample came from the
training data rather than Generator. The training procedure for Generator is to maximize the
probability of Discriminator making a mistake. The system as a whole corresponds to a minimax
twoplayer game.
      </p>
      <p>The following is a description of the features of the network for generating gamma event
images for the TAIGA-IACT experiment.</p>
      <p>The generator takes as input a point in the latent space – a random vector of 8192 (128x8x8)
entries, and outputs a single 32x32 grayscale image. The generator has 4 layers of convolution. All
layers except the output layer use 4x4 filters and a leaky ReLU function with alpha=0.2 as the
activation function. The output layer has one 6x6 filter and uses a sigmoid for its activation. We also
apply batch normalization (BN) [9] in the generator. The main advantage of this technique is that it
greatly speeds up the learning process. In our case, BN makes the generator and, as a result, the entire
GAN more stable. We adopted BN between convolutional layers before each activation function.</p>
      <sec id="sec-2-1">
        <title>The architecture of the generator for gamma events is shown in Figure 1. 271</title>
        <p>The discriminator takes as input one 32x32 grayscale image and outputs a binary prediction as
to whether the image is real or fake. It uses a 2x2 stride to downsample, and the Adam version of
stochastic gradient descent with a learning rate of 0.0002 and a momentum of 0.5. In the convolutional
layers, the convolution filter size is 4x4; the leaky ReLU function with alpha=0.2 is used for the
activation. The output layer uses a sigmoid function for its activation.</p>
      </sec>
      <sec id="sec-2-2">
        <title>The architecture of the generator for gamma events is shown in Figure 2.</title>
        <p>Also worth mentioning are two more hyperparameters of the GAN learning process: a batch
size and a number of epochs. The batch size is a number of training images that need to be processed
before updating the network weights. The number of epochs controls the number of complete passes
through the training dataset. During training, we used the batch size of 128 images and 300 epochs.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Training set preprocessing</title>
      <p>The real images of gamma events are small, and usually we have only a few light pixels (event
track) on a black background. An event track is usually elliptical in shape. When observing gamma
events, the telescope is pointing towards the source of gamma quanta, so the recorded ellipses can
come from different directions, but all must be pointed towards the center of the image. Our basic
GAN has learned very well to reproduce the elliptical shape of the image, but some generated images
had problems with the position of the ellipse within the image. To address this issue we had to modify
our training set to force our network to learn the rotational symmetry of the images.</p>
      <p>To account for rotational symmetry, each image of the training set was flipped horizontally,
and then both images were flipped vertically. Thus, in addition to the original image, we get three
rotated copies of it. An example of the original image and its copies is shown in Figure 1.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>
        In our previous work [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], we selected 25,000 gamma events as the training sample. The
training on the Tesla P100 GPU took about 6 hours. Accordingly, now we took the same images and
applied the aforementioned flipping procedure to them. This procedure increased the sample size by 4
times, respectively increasing the training time of our GAN: it took about 22 hours to train the network
on the resulting dataset using the same server. At the same time, the image generation rate has not
changed, and the network creates about 400 event images in 1 second.
      </p>
      <p>
        For verification, we generated a sample of 4000 gamma images and classified them using the
third party software tool that is used for classification in the TAIGA-IACT experiment [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] that
determines the probability that an image is a gamma image.
      </p>
      <p>The plot in Figure 4 shows the results of the classification – the distribution of the number of
generated gamma events by probabilities. The X-axis in the plot represents the probability that the
image is a gamma event and the Y-axis is the number of generated gamma events classified as gamma
events with a given probability. The plot shows that for more than half of the generated events, the</p>
    </sec>
    <sec id="sec-5">
      <title>6. Acknowledgements References</title>
      <p>This work was carried out in the framework of R&amp;D State Assignment No.115041410196.
calculated probability is 90-100%. Moreover, for 97% of generated events, the probability exceeds
50%, thus, these events are recognized as gamma events. So, the quality of generating gamma images
has improved: about 3% of the generated gamma images, which were previously highly likely to be
recognized as non-gamma events, became highly likely to be recognized as gamma events.</p>
    </sec>
    <sec id="sec-6">
      <title>5. Conclusions</title>
      <p>Summarizing the above, we can conclude that additional preprocessing of the input image set
used for training can further improve the accuracy of modeling event images for the TAIGA-IACT
experiment. On the other hand, the training time increases significantly, but the network learns the
rotational symmetry better, which is important specifically for gamma images. As a result, the number
of correctly generated images increased by approximately 3% and reached 97%. At the same time, the
preprocessing of the input set does not affect the image generation speed.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>T.</given-names>
            <surname>Weekes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cawley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Fegan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Gibbs</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hillas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Kowk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Lamb</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lewis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Macomb</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Porter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Reynolds</surname>
          </string-name>
          ,
          <string-name>
            <surname>G. Vacanti.</surname>
          </string-name>
          <article-title>Observation of TeV gamma rays from the Crab Nebula using the atmospheric Cerenkov imaging technique // Astrophysical Journal</article-title>
          , vol.
          <volume>342</volume>
          , р.
          <volume>379</volume>
          ,
          <year>1989</year>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Budnev</surname>
          </string-name>
          et al.
          <article-title>The TAIGA experiment: From cosmic-ray to gamma-ray astronomy in the Tunka valley //Nuclear Instruments and</article-title>
          Methods in Physics, vol.
          <source>A845</source>
          , pp.
          <fpage>330</fpage>
          -
          <lpage>333</lpage>
          ,
          <year>2017</year>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.H.</given-names>
            <surname>Kunnas</surname>
          </string-name>
          et al.
          <article-title>Simulation of imaging air shower Cherenkov telescopes as part of the TAIGA Project //</article-title>
          <source>Proceedings of Magellan Workshop (DESY-PROC-2016-05)</source>
          ,
          <year>2016</year>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>I.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pouget-Abadie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mirza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Warde-Farley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ozair</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Courville</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          . Generative Adversarial Networks // ArXiv e-prints,
          <source>arXiv: 1406.2661</source>
          ,
          <year>2014</year>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Radford</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Metz</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Chintala</surname>
          </string-name>
          .
          <article-title>Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks /</article-title>
          / ArXiv e-prints,
          <source>arXiv:1511.06434</source>
          ,
          <year>2015</year>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Dubenskaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kryukov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Demichev</surname>
          </string-name>
          .
          <article-title>Fast Simulation of Gamma/Proton Event Images for the TAIGA-IACT Experiment using Generative Adversarial Networks //</article-title>
          <source>Proceedings of the 37th International Cosmic Ray Conference PoS (ICRC2021) 874</source>
          ,
          <fpage>2021</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>E.</given-names>
            <surname>Postnikov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kryukov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Polyakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhurov</surname>
          </string-name>
          .
          <article-title>Deep Learning for Energy Estimation and Particle Identification in Gamma-ray</article-title>
          <source>Astronomy // Proceedings of the 3rd International Workshop DLC-2019, CEUR-WS Proceedings</source>
          , vol.
          <volume>2406</volume>
          , pp.
          <fpage>90</fpage>
          -
          <lpage>99</lpage>
          ,
          <year>2019</year>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>