Skip to main content

faster-particles: Pixel Proposal Network (PPN) for particles images and related tools

Introduction

This package includes the following:

  • Toydata generator
  • LArCV data interface (2D and 3D)
  • Base network: VGG(ish) and UResNet
  • Pixel Proposal Network implementation

Contents

  1. Installation 1.1. Dependencies 1.2. Install
  2. Usage 2.1. Dataset

License

This code is released under the MIT License (refer to the LICENSE file for more details).

Installation

Dependencies

You must install larcv2 and its own dependencies (ROOT, OpenCV, Numpy) in order to use LArCV data interface. To install larcv2:

git clone https://github.com/DeepLearnPhysics/larcv2.git
cd larcv2
source configure.sh
make

You will also need Tensorflow.

Install

The easiest way is to use Pip, although you will not get the latest changes:

pip install faster-particles

Alternatively, you can also clone the source if you want the latest updates or participate to its development:

git clone https://github.com/Temigo/faster-particles.git
cd faster-particles

Usage

The following assumes you installed with pip. If you cloned the source, make sure you are in the root directory and replace ppn with python faster_particles/bin/ppn.py.

Dataset

Toydata To use toydata rather than LArCV data in the following sections, use the option --toydata. This is an old option which has not been tested for a while and which should be deprecated soon.

Liquid Argon data files LArCV data files should be specified with --data option which supports regex, e.g. ppn_p[01]*.root. Some data files are publicly available at DeepLearnPhysics data challenge page.

The generic usage is ppn train/demo [directories options] [network architecture] [weights options] [network options] [other options]. train is for training networks, demo is for running inference.

Directories options

The program output is divided between:

  • Output directory (option -o): with all the weights
  • Log directory (option -l): to store all Tensorflow logs (and visualize them with Tensorboard)
  • Display directory (option -d): stores regular snapshots taken during training of PPN1 and PPN2 proposals compared to ground truth. The directories will be created if they do not exist yet. At training time all of them are required. At inference time only the display directory is required.

Network architectures and weights options

Training

Network trained Command to run Pretrained weights (optional)
Base network UResNet `--base-net uresnet --net base -wb uresnet.ckpt
Base network VGG --base-net vgg --net base -wb vgg.ckpt
PPN (w/ UResNet base) --base-net uresnet --net ppn -wp ppn.ckpt
Small UResNet --base-net uresnet --net small_uresnet -ws small_uresnet.ckpt

Inference

Use the command ppn demo -d display/dir -m N_inferences followed by:

Network Commandline options Weights loading
Base (UResNet) --base-net uresnet --net base --wb uresnet.ckpt
PPN (w/ UResNet base) --base-net uresnet --net ppn --wp ppn.ckpt
Small UResNet --base-net uresnet --net small_uresnet --ws model.ckpt
PPN + UResNet --base-net uresnet --net full --wb uresnet.ckpt --wp ppn.ckpt
PPN + Small UResNet --base-net uresnet --net ppn_ext --wp ppn.ckpt --ws small_uresnet.ckpt

Most common options

Option Explanation
-m Number of steps / images to run on
--freeze Freeze base network layers during training.
-N Size of the image
-3d 3D version
-data Path to data files, can use wildcards and bash syntax.

More options such as thresholds are available through ppn train -h and ppn demo -h respectively.

Examples

To train PPN on 1000 steps use:

ppn train -o output/dir/ -l log/dir/ -d display/dir --net ppn -m 1000 --data path/to/data

To train the base network (currently VGG and UResNet available) on track/shower classification task use:

ppn train -o output/dir/ -l log/dir/ -d display/dir --net base --base-net vgg -m 1000

To train on 3D data, use the argument -3d and don't forget to specify the image size with -N argument (e.g. 192 for a compression factor of 4, see larcvdata_generator.py for more details).

To train PPN with UResNet base network pretrained weights, while freezing the base (pre-trained) layers, a more complete command line would be

ppn train -o output/dir/ -l log/dir/ -d display/dir --net ppn --base-net uresnet -wb /path/to/uresnet/weights --freeze -N 512 -m 100

To run inference with a minimal score of 0.5 for predicted points:

ppn demo weights_file.ckpt -d display/dir/ -ms 0.5

The display directory will contain snapshots of the results.

Authors

K.Terao, J.W. Park, L.Domine

Metadata

Release files for faster-particles 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faster-particles 0.3.0
File Size Uploaded Provenance Actions
faster-particles-0.3.0.tar.gz 46.2 kB Without provenance Details for faster-particles-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for faster-particles 0.3.0
File Interpreter ABI Platform Actions
faster_particles-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for faster_particles-0.3.0-py2.py3-none-any.whl

Total release size: 105.5 kB

Release files / faster-particles-0.3.0.tar.gz

Download URL faster-particles-0.3.0.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c8ca13f11d02c1455a5be26d185d491f94807acb8b9f17d9c1eb073bac68acc0
BLAKE2b-256 checksum
How to use checksums
6ac3124a3fa425f284e0692f47864aba04ee2f70bf823655733b18e86077da5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/2.7.6

Release files / faster_particles-0.3.0-py2.py3-none-any.whl

Download URL faster_particles-0.3.0-py2.py3-none-any.whl
Size 59.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ca2fb960994feac8a40759ecd6ba00ebc84233137c0e13a88eaa0cb1462b8dfc
BLAKE2b-256 checksum
How to use checksums
48ec7cc8a3029a54b7a180113be38ee260e9450506068d1b2a3d08750726d0a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/2.7.6

Security for faster-particles 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page