Skip to content

Repository files navigation

Gamma-Ray Classification Using Machine Learning

Project Overview

This project focuses on classifying high-energy gamma particles using machine learning techniques. The dataset used is the MAGIC Gamma Telescope dataset, which contains measurements recorded by imaging atmospheric Cherenkov telescopes. The goal is to build a predictive model capable of distinguishing gamma signals from hadronic background noise.

The project covers machine learning workflow including:

  • Data loading and preprocessing
  • Exploratory Data Analysis (EDA)
  • Feature engineering
  • Model training and evaluation
  • Hyperparameter tuning
  • Dashboard visualization

Objectives

  • Clean and preprocess the MAGIC Gamma Telescope dataset
  • Explore relationships between telescope measurement features
  • Train classification models for gamma-ray prediction
  • Evaluate model performance using multiple metrics
  • Save the best-performing model
  • Build an interactive dashboard for visualization

Dataset

Dataset: MAGIC Gamma Telescope Dataset

Features include:

  • fLength
  • fWidth
  • fSize
  • fConc
  • fConc1
  • fAsym
  • fM3Long
  • fM3Trans
  • fAlpha
  • fDist

Target Variable:

  • g → Gamma signal
  • h → Hadron background noise

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • Joblib
  • Tableau
  • Git & GitHub

Data Preprocessing

The preprocessing stage included:

  • Assigning column names
  • Handling missing values
  • Encoding target labels
  • Feature scaling
  • Train-test splitting

Machine Learning Models

The following models were explored:

  • Logistic Regression
  • Random Forest Classifier
  • Decision Tree Classifier
  • Support Vector Machine (SVM)

Hyperparameter tuning was performed to improve performance.


Evaluation Metrics

Models were evaluated using:

  • Accuracy Score
  • Precision
  • Recall
  • F1 Score
  • ROC Curve
  • Confusion Matrix

Example visualization outputs include:

  • Feature importance plots
  • ROC curves
  • Correlation heatmaps
  • Class distribution charts

Model Saving

The best-performing model was saved using Joblib:

import joblib

joblib.dump(model, "best_model.pkl")

Running the Project

Clone Repository

git clone <your-repository-link>
cd gamma-ray-classification

Install Requirements

pip install -r requirements.txt

Run Dashboard

link.md


Dashboard Features

The dashboard includes:

  • Dataset overview
  • Feature visualizations
  • Prediction interface
  • Model performance metrics
  • Interactive charts

Results

The final trained model achieved strong classification performance in distinguishing gamma particles from hadronic events. The project demonstrates how machine learning can support astrophysics research and high-energy particle analysis.


Future Improvements

  • Deep learning implementation
  • Real-time prediction API
  • Cloud deployment

About

End-to-end data science project for gamma-ray event classification, featuring data preprocessing, exploratory analysis, feature engineering, and machine learning model development in Python.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages