Random Forests for Gamma Hadron Separation

93 concepts82 papers3 proposals

Ground-based gamma-ray astronomy relies on catching the faint, fleeting flashes of Cherenkov light produced when a high-energy photon strikes the Earth's upper atmosphere. This interaction triggers an extensive air shower—a cascade of secondary particles moving faster than the speed of light in air. Imaging Atmospheric Cherenkov Telescopes (IACTs) capture these cascades as faint, elliptical shapes on their pixelated cameras.

However, gamma rays are exceedingly rare. The sky is flooded with hadronic cosmic rays (mostly protons and helium nuclei) that also smash into the atmosphere, generating their own extensive air showers. For every genuine gamma-ray event, an observatory might record tens of thousands of hadronic background events. To discover faint cosmic sources, physicists must separate the gamma-ray needles from the hadronic haystack.

The Limits of Geometric Cuts

Historically, this discrimination relied on "Hillas parameters"—simple geometric descriptions of the shower image's shape and orientation, such as its length, width, and alignment with the target source position. Because electromagnetic showers (induced by gamma rays) tend to be compact and symmetric, while hadronic showers are messy, fragmented, and wide, physicists could apply box cuts to these parameters to filter out the background.

But simple geometric cuts throw away valuable information. The boundaries between gamma and hadron showers are highly non-linear and deeply intertwined with both the particle's energy and its impact parameter (the distance from the telescope to the shower core). A small, faint hadron shower can easily mimic a low-energy gamma shower. Furthermore, as telescopes evolved to incorporate timing information—measuring the nanosecond-scale arrival front of the light—the dimensionality of the data grew, making manual parameter tuning impractical.

Mapping Complexity to Hadronness

To exploit the full multi-dimensional correlation of these features, researchers turned to tree-based machine learning ensembles, primarily Random Forests and Boosted Decision Trees (BDTs).

A single decision tree splits data by choosing a threshold for a single feature (e.g., width < 0.15°), then splitting the resulting subsets by another feature, and so on. This architecture naturally captures non-linear interactions between variables without requiring an explicit analytical model. However, individual decision trees are notoriously unstable and prone to overfitting the statistical fluctuations of training data.

By combining hundreds of trees into an ensemble, algorithms like the Random Forest overcome this limitation. In a Random Forest classifier, each tree is trained on a random bootstrap sample of the data and evaluates a random selection of features at each split. When an unclassified event is fed into the forest, every tree casts a vote. The fraction of trees that classify the event as a hadron defines a continuous metric known as hadronness (ranging from 0 for a pure gamma ray to 1 for a pure hadron).

As demonstrated by J. Albert et al. in Observation of Very High Energy Gamma‐Ray Emission from the Active Galactic Nucleus 1ES 1959+650 Using the MAGIC Telescope and Detection of Very High Energy Radiation from the BL Lacertae Object PG 1553+113 with the MAGIC Telescope, optimizing these parameters via a Random Forest collapses a high-dimensional space of shape and timing characteristics into this single, highly discriminative variable. Incorporating the precise timing of the Cherenkov signal front into the Random Forest, as shown by the authors in Improving the performance of the single-dish Cherenkov telescope MAGIC through the use of signal timing, doubled the background rejection power at low energies by exploiting the fact that electromagnetic showers develop more smoothly in time than hadronic ones.

Regression for Energy and Direction

The utility of tree ensembles extends beyond binary classification. The same morphological features that reveal a particle's identity also encode its physical properties: its energy and its point of origin in the sky.

Instead of voting on a discrete category, the trees in a Random Forest Regressor can output continuous values. For energy estimation, the forest learns how the total light yield ("size") interacts with the shower's distance from the telescope axis to predict the primary particle's true energy (see Discovery of Very High Energy γ-Rays from Markarian 180 Triggered by an Optical Outburst by J. Albert et al. and SEARCH FOR VHE γ-RAY EMISSION FROM THE GLOBULAR CLUSTER M13 WITH THE MAGIC TELESCOPE by H. Anderhub et al.). Similarly, by training a regressor on the structural asymmetry of the shower image, the algorithm can accurately reconstruct the arrival direction of the incoming photon, significantly improving the angular resolution of the instrument, as detailed by J. Aleksić et al. in Search for an extended VHEγ-ray emission from Mrk 421 and Mrk 501 with the MAGIC Telescope.

Cross-Disciplinary Adoption

While pioneered extensively within the IACT community for telescopes like MAGIC and the upcoming Cherenkov Telescope Array (as discussed by R. López-Coto et al. in Physics Performance of the Large Size Telescope prototype of the Cherenkov Telescope Array and A. Carosi et al. in First follow-up of transient events with the CTA Large Size Telescope prototype), this machine learning paradigm has proven essential across particle physics and cosmic-ray astrophysics.

For ultra-high-energy cosmic ray observatories that utilize surface detector arrays rather than cameras, Boosted Decision Trees are used to analyze the curvature and signal density drop-off of the shower front to isolate rare EeV photons from a dominant proton background (e.g., A SEARCH FOR POINT SOURCES OF EeV PHOTONS by A. Aab et al.; Search for point sources of ultra-high-energy photons with the Telescope Array surface detector by Rasha Abbasi; and Constraints on the diffuse photon flux with energies above 1018 eV using the surface detector of the Telescope Array experiment by Rasha Abbasi et al.).

Meanwhile, in accelerator environments like the BABAR, Belle, and MicroBooNE experiments, bagged and boosted decision trees are standard tools for isolating rare, suppressed particle decays from overwhelming Standard Model backgrounds by aggregating kinematic and event-shape variables (see Search for the decay B+ -> Ks0 Ks0 pi+ by B. Aubert et al.; Search for the rare decay B -> K nu nu-bar by P. del Amo Sanchez et al.; Search for B0 meson decays into \Lambda and missing energy with a hadronic tagging method at Belle by T. Gu; and Search for an anomalous excess of charged-current quasielastic ν_e interactions with the MicroBooNE experiment using Deep-Learning-based reconstruction by R. An et al.).

The enduring success of tree ensembles in these domains stems from their unique balance: they offer the non-linear expressivity required to map complex physical cascades, yet remain computationally efficient and robust against the systematic uncertainties inherent in simulated training data.

Key Foundational Work

Discovery of Very High Energy γ-Rays from Markarian 180 Triggered by an Optical Outburst (2006) — contributed 2 concept elements to this direction.
Flux Upper Limit on Gamma-Ray Emission by GRB 050713a from MAGIC Telescope Observations (2006) — contributed 2 concept elements to this direction.
Detection of Very High Energy Radiation from the BL Lacertae Object PG 1553+113 with the MAGIC Telescope (2006) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_random_forest_classification_276ab40f,
  title = {random forest classification},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/random-forest-classification/rdr_276ab40f9c3f42489085982efaa1dfee},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_random_forest_classification_276ab40f_v1,
  title = {random forest classification},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/random-forest-classification/rdr_276ab40f9c3f42489085982efaa1dfee/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake