CNN-based neutrino classification using CVN

This material is based on Bannanje Nitish Nayak, Tingjun Yang and Varuna Meddage’s work presented at the LArSoft Coordination meeting. CVN Integration into LArSoft.

Some of the DUNE Machine Learning (ML) reconstruction code could be of use to other Liquid Argon experiments such as SBND and MicroBooNE. Similarly, ML code from these experiments could also be of use to DUNE.

A key step for DUNE ML training is pre-processing, which typically runs as art modules over simulated DUNE data. This produces processed information in the form of clusters of hits, images etcetera. Commonly used ML frameworks such as TensorFlow and PyTorch can then use this information to train.

The DUNE Convolutional Visual Network (CVN) “classifies neutrino interactions in the DUNE FD through image recognition techniques. In general terms it is a convolutional neural network (CNN). The main feature of CNNs is that they apply a series of filters (using convolutions, hence the name of the CNN) to the images to extract features that allow the CNN to classify the images. Each of the filters consists of a set of values that are learned by the CNN through the training process. 

“CNNs are typically deep neural networks that consist of many convolutional layers, with the output from one convolutional layer forming the input to the next. Similar techniques have been demonstrated to outperform traditional event reconstruction-based methods to classify neutrino interactions…The characteristic translational invariance of CNN methods also represents an advantage.”

From: Neutrino interaction classification with a convolutional neural network in the DUNE far detector” by the DUNE collaboration.

The overall scheme is to have art modules to process simulated DUNE files (hits, clusters etc contained in the data product recob::Hit) in order to produce gzip-compressed binaries (.gz) of the images (called pixel maps). The images are 2D maps of WireID and Tick (time coordinate) and there are typically 3 of them representing the 3 readout views from the DUNE LArTPC geometry. These images are then read by standalone python code and the CNN is trained using a Keras-based TensorFlow package. Once trained, other art modules read in the trained results from Tensorflow, PyTorch and store them as new data products in order to make them accessible to other reconstruction and analysis algorithms within the DUNE software stack.

From: CVN Integration into LArSoft presented at October 18, 2022 LArSoft Coordination Meeting.

The main class that handles the creation of pixel map objects takes in a cluster of hits and sorts them into 2D wire-tick space for each view. A global wire coordinate is assigned for interactions spanning multiple APAs, drift vols, wrapped wires, etc. It handles different geometries within DUNE (HD, VD, ProtoDUNE-SP).

  • Producer module (CVNMapper) uses the PixelMapProducer class to write out pixel map data products
  • Analyzer module (CVNZlibMaker) uses these to written out pixel map objects as compressed binary files for each event. It also writes out some auxiliary information needed for training (true flavor, neutrino energy etc) 
  • Producer module (CVNEvaluator) reads in the TensorFlow model weight file after training to write out data products that store the result of the inference of CVN on any given interaction. It utilizes the TFNetHandler class to read the TensorFlow graph representing the architecture of the network. 

A lot of this code can also be made geometry agnostic if one wants to adapt it for other LAr experiments. There exists a common repository to do this — larrecodnn. The CVN specific code in larrecodnn handles the inputs more rationally and improves upon the DUNE code in order to make it accessible for other experiments and geometries. In particular, there is an interface for the PixelMapProducer class that needs the user to assign a global wire coordinate based on the experiment-specific geometry. PixelMapProducer is a class template that can take as input multiple options of cluster information such as recob::Hit, recob::Wire format (for hits, full waveforms etc). Examples are provided here and here for the default case of 1 APA and 1 drift volume and no wrapped wires. Geometry specific handling of wire, tick co-ordinates can be done by deriving from the base type and then overriding ConvertLocaltoGlobal or ConvertLocaltoGlobalTDC. 

Additionally, some improvements are made to how CVNZlibMaker can store different kinds of auxiliary training data along with the gzip-compressed images. The Evaluator part also has some improvements in terms of the kinds of TensorFlow graph formats it can read in, in particular it can now read graphs in the SavedModel format.

Most of the DUNE CVN code is now ported over to larrecodnn and the CVN algorithm can be trained and used on various geometries such as SBND. 

Sources:

CVN Integration into LArSoft presentation.

https://www.wm.edu/as/physics/documents/seniorstheses/class2020theses/gnasso_i.pdf 

https://arxiv.org/pdf/2006.15052.pdf