Skip to content
5 / 12
2025·AI/ML·View Website

GAMMA

A machine learning pipeline designed to distinguish genuine gamma ray events from background hadron noise using the open source UCI MAGIC Telescope dataset.

PythonTensorflowscikitlearnNumpyMatplotlib
GAMMA — 1

Introduction

As part of the Samsung Innovation Campus Capstone Project, my team developed GAMMA, a machine learning project focused on classifying gamma-ray events using the MAGIC Gamma Telescope dataset.

The goal was to build a reliable binary classification system that could distinguish genuine gamma ray events from background hadron noise. This is important because gamma-ray astronomy helps researchers study high-energy cosmic phenomena such as black holes, supernova explosions, cosmic rays, and potential signs of dark matter.

Problem

Genuine gamma ray events are rare and often hidden inside a large amount of background hadron noise.

Since gamma-ray signals and background noise can look nearly identical, manually filtering them is extremely difficult and unreliable. This creates a strong need for an automated classification system that can separate real cosmic signals from noise with high precision.

Solution

We built an end-to-end machine learning pipeline for gamma-ray event classification.

The pipeline included data acquisition, exploratory data analysis, preprocessing, feature scaling, class balancing, model training, evaluation, and visualization. Instead of relying on a single model, we tested multiple algorithms to compare performance and understand which approach worked best for the dataset.

Dataset

We worked with the UCI MAGIC Gamma Telescope dataset, which contains 19,020 cosmic events and 10 numerical features describing particle shower characteristics.

These features represent properties such as the width, length, concentration, asymmetry, and overall shape of the detected event. Each event is labeled as either a gamma-ray signal or a hadron background event, making it suitable for binary classification.

Methodology

We started by analyzing the dataset through histograms, boxplots, and feature visualizations to understand how gamma and hadron events differed in distribution.

After that, we normalized the features so that large-scale values would not dominate the learning process. We also addressed class imbalance because gamma-ray events were underrepresented compared to hadron events.

For model training, we experimented with several classification models, including K-Nearest Neighbors, Naive Bayes, Logistic Regression, Support Vector Machine, and Neural Networks. We used an 80/20 train-test split and evaluated the models using metrics such as accuracy, precision, recall, F1-score, and ROC-AUC.

Results

The final model achieved strong performance, with around 88% accuracy and a 0.93 ROC-AUC score.

This showed that the system was able to effectively distinguish gamma-ray signals from background noise. More importantly, it gave us a practical understanding of how machine learning can support scientific research by automating complex classification tasks.

Challenges

  1. One of the biggest challenges was handling the class imbalance in the dataset. Since gamma-ray events were rarer, the model could easily become biased toward the majority class.

  2. We addressed this by using oversampling techniques and evaluating the model with metrics beyond accuracy, such as F1-score and ROC-AUC.

  3. We also faced challenges with model generalization, hyperparameter tuning, and understanding which features had the strongest effect on predictions.