Skip to main content

NuGraph2: A Graph Neural Network for neutrino physics event reconstruction

Project description

NuGraph: a Graph Neural Network (GNN) for neutrino physics event reconstruction

This repository contains a GNN architecture for reconstructing particle interactions in neutrino physics detector environments. Its primary function is the classification of detector hit particle type through semantic segmentation, with additional secondary functions such as background hit rejection, event classification, clustering and vertex reconstruction.

Installation

This repository can be installed in Python via pip, although using Anaconda to install dependencies is strongly recommended. Detailed instructions on how to easily install all necessary dependencies are available here.

Once dependencies are installed, you can simply clone this repository and installing it via pip – if you intend to carry out any development on the code, installing in editable mode is recommended:

git clone git@github.com:exatrkx/NuGraph
pip install --no-deps -e ./NuGraph

Training a model

You can train the model using a processed graph dataset as input by executing the train.py script in the scripts subdirectory. This script accepts many arguments to configure your training – for a complete summary of all available arguments, you can simply run

scripts/train.py --help

As an example, to train the network for semantic segmentation on the Heimdall cluster, one might run

scripts/train.py --data-path /raid/uboone/NuGraph2/NG2-paper.gnn.h5 \
                 --logdir /raid/$USER/logs --name default --version semantic-filter \
                 --semantic --filter

This command would start a network training using the requested input dataset, training with the semantic head enabled, and writing network parameters and metrics to the directory /raid/$USER/logs/default/semantic-filter.

Training on SLURM clusters

If you're working on a cluster that uses the SLURM batch submission system, such as the Wilson cluster at Fermilab, then you'll need to submit training via a batch script instead. An example batch script train_batch.sh is included in the scripts subdirectory. If you're training on the Wilson cluster, you can submit a training job by running

sbatch scripts/train_batch.sh <args>

where <args> are the same argument you'd pass if you were executing the training script locally.

If you're training on a SLURM environment other than the Wilson cluster, you'll need to edit the SLURM directives in the script appropriately for the cluster you're working on before submitting.

Metric logging

In the above example, training outputs including logging metrics would be written to a subdirectory of /raid/$USER/logs. We can use the Tensorboard interface to visualise these metrics and track the network's training progress. You can start Tensorboard using the following command:

tensorboard --port XXXX --bind_all --logdir /raid/$USER/logs --samples_per_plugin 'images=200'

In the above example, you should replace XXXX with a unique port number of your choosing. Provided you're forwarding that port when working over SSH, you can then access the interface in a local browser at localhost:XXXX.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nugraph-25.4.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nugraph-25.4.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file nugraph-25.4.0.tar.gz.

File metadata

  • Download URL: nugraph-25.4.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for nugraph-25.4.0.tar.gz
Algorithm Hash digest
SHA256 03a3b9a36fe7ab20aea94b9fc52510875c6501a6a9731897f4b1fdaf803d3fb4
MD5 3c6cc2ab933a3722a9107b75942b5c99
BLAKE2b-256 16bd537664f9c59d3d87c3cc0f75d3054dd4a1c4f3d5897796ad50ea8fa5d105

See more details on using hashes here.

File details

Details for the file nugraph-25.4.0-py3-none-any.whl.

File metadata

  • Download URL: nugraph-25.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for nugraph-25.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f99daf53645905b072749f278539ecd461e70402e3b053e6c76473912bb77183
MD5 c430fc5d406e00bac57a0b7450b4abc1
BLAKE2b-256 62d723788a7d4db24342558beb24f91daf6ec345ad9c35906f88cc8cfee7fc91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page