Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neutron/Gamma Pulse-Shape Discrimination with ML

Classifying scintillation-detector pulses into neutron / gamma / noise with physics-informed features — Random Forest reaches 99% validation accuracy; includes the accompanying research paper.

Русская версия

Python scikit--learn Physics License

Digitised waveforms from a stilbene organic scintillator (2,034 labelled training pulses × 496 samples; 33,932-event test set in CAEN digitizer format) are classified by exploiting the physics of scintillation: neutron-induced recoil protons populate triplet states and produce a long slow tail, gammas decay fast, noise looks like neither. Applied context: separating neutrons from gammas while monitoring a D–D fusion reaction on an accelerator setup.

results

What you're looking at: five models, one dot each — the share of detector flashes classified correctly on held-out data. The axis is zoomed to 0.97–1.00 because all models are strong; Random Forest (dark) leads at 99.02%.

In plain words — from zero

A scintillator is a crystal that flashes when a particle hits it. Different particles flash differently: a neutron's flash has a long "afterglow tail", a gamma-ray's dies out fast, electronic noise looks like neither. Telling them apart matters when you monitor a fusion reaction and need to count neutrons specifically.

  • Each flash is recorded as 496 numbers (voltage over time) — a little curve.
  • We compute ~40 descriptive properties of each curve: how tall, how fast it rises, how much charge sits in the tail vs the head, how it rings in frequency terms. These are the exact quantities physicists use, just measured automatically.
  • A Random Forest — hundreds of decision trees voting — learns which property combinations mean "neutron", "gamma" or "noise". 99 flashes out of 100 are labelled correctly.
  • Honest footnote: the "noise" class had only 9 validation examples, so its perfect score rests on very few events — stated in the paper, not hidden.
flowchart LR
    A[detector flash =<br/>496-point waveform] --> B[~40 physics features:<br/>tail charge, decay, spectrum]
    A --> C[PCA of raw curve]
    B --> D[Random Forest + 4 rivals]
    C --> D
    D --> E([neutron / gamma / noise<br/>99% accuracy])
Loading

features

Above: from the notebook — distributions of basic pulse statistics per class: neutron, gamma and noise flashes really do live in different ranges.

Results

Model Validation accuracy
Random Forest 0.9902
Gradient Boosting 0.9902
XGBoost 0.9877
LightGBM 0.9853
MLP (200-100-50) 0.9754

Neutron recall 99%, gamma recall ~99%, noise 100% (on the validation split); one-vs-rest AUC 0.99–1.00; t-SNE shows clean class separation. Honest caveat: the noise class is tiny (46 train / 9 validation events), so its perfect score rests on very few samples.

Highlights

  • PulseFeatureExtractor — ~40 features in six physically motivated groups: amplitude, timing (rise/fall/FWHM), charge (prompt/delayed/tail-to-total — the classic charge-comparison PSD observables), shape statistics, FFT band energies, and PSD-specific features (CCM ratio, exponential decay constant via curve_fit).
  • Hybrid representation: engineered features + PCA(50) of the raw waveform — feature importances show both halves contribute.
  • Confusion matrices, ROC/PR curves, top-15 importances, t-SNE — the full evaluation kit.
  • Deliverables include a fitted model bundle and test-set predictions (77.8% neutron / 21.4% gamma / 0.8% noise on 33,932 events).

Repository structure

notebooks/pulse-discrimination.ipynb   # full pipeline, outputs saved
docs/paper-ru.pdf                      # 27-page research paper (Russian)
docs/img/

Getting started

pip install -r requirements.txt
jupyter lab notebooks/pulse-discrimination.ipynb

Raw detector data is not distributed. Expected formats — train: label column + 0…495 waveform samples; test: CAEN BOARD;CHANNEL;TIMETAG;ENERGY;ENERGYSHORT;FLAGS;SAMPLE_0…SAMPLE_495 (semicolon-separated).

Notes

The research paper in docs/paper-ru.pdf was co-authored with two colleagues; the ML pipeline and this notebook are the repository owner's individual contribution.


Keywords: machine learning, nuclear physics, pulse-shape discrimination, scintillator, neutron detection, signal processing, random forest, feature engineering

Ключевые слова: машинное обучение, ядерная физика, дискриминация формы импульса, сцинтиллятор, детектор нейтронов, обработка сигналов, классификация

About

ML pulse-shape discrimination for stilbene scintillator signals: ~40 physics features + PCA, Random Forest 99% accuracy; research paper included (RU)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages