1. INTRODUCTION
Very-high-energy (VHE) gamma-ray astronomy is a central pillar of contemporary high-energy astrophysics and astroparticle physics because it provides a direct observational channel to the most extreme particle-acceleration environments in the Universe. Unlike charged cosmic rays, gamma rays propagate essentially undeflected by interstellar and intergalactic magnetic fields, thereby preserving directional information about their production sites. VHE observations therefore provide a uniquely informative probe of compact objects and energetic transients, including pulsars and their nebulae, active galactic nuclei, and supernova remnants.
Ground-based atmospheric Cherenkov gamma telescopes provide highly sensitive measurements in the VHE regime by using the Earth’s atmosphere as a calorimetric detection medium. When a primary gamma ray enters the upper atmosphere, it initiates an electromagnetic cascade whose relativistic charged secondaries emit Cherenkov radiation. The resulting nanosecond-scale optical signal is recorded by fast photodetector cameras mounted on large reflectors. Imaging atmospheric Cherenkov telescopes (IACTs) reconstruct event properties by analyzing the spatial and intensity distribution of Cherenkov light in the camera plane.
A persistent bottleneck in IACT analysis is the gamma– hadron discrimination problem. Hadronic cosmic rays vastly outnumber astrophysical gamma rays and produce air-shower images that can partially resemble electromagnetic cascades. This overlap is especially problematic at low energies, where images are faint, fluctuations are larger, and image-parameter distributions become less separable. Classical cut-based methods based on Hillas parameters are interpretable and computationally efficient, but their linear or manually tuned boundaries are often insufficient for exploiting nonlinear correlations among image descriptors.
Machine learning and deep learning have improved event classification by learning nonlinear decision functions from Cherenkov image parameters or camera images. However, non-optimized architectures can still suffer from redundant features, suboptimal hyperparameters, and limited sensitivity to the most discriminative attributes. This work addresses these limitations by integrating an attention-guided recurrent classifier with adaptive metaheuristic optimization.
The main contributions are: (i) an enhanced attention-based LSTM model for gamma–hadron classification, (ii) an Adaptive Balanced Greylag Goose Optimization (ABGGO) strategy for feature selection and hyperparameter tuning, (iii) a systematic comparison with ANN, CNN, LSTM, and several optimized EALSTM variants, and (iv) a multi-metric evaluation covering accuracy, sensitivity, specificity, PPV, NPV, and F-score.
2. LITERATURE REVIEW
Gamma-ray astronomy has benefited from both physical modeling and data-driven classification. Early IACT pipelines relied heavily on image moments, directional reconstruction, and manually optimized selection cuts. These approaches remain useful because Hillas parameters encode physically meaningful information such as image length, width, size, orientation, asymmetry, and concentration. Nevertheless, the overlap between gamma and hadron distributions limits the discriminative power of fixed thresholds.
Machine learning methods such as decision trees, random forests, support vector machines, and ensemble classifiers have been widely adopted to improve background rejection. More recently, deep learning models have been explored for gamma-ray event classification, including CNNs trained on camera images, LSTMs and recurrent structures applied to ordered features, and hybrid approaches that combine physical descriptors with learned representations. Attention mechanisms are particularly attractive because they can weight the relative importance of features and focus the model on discriminative components of the event representation.
Metaheuristic optimization has also become important for model design. Genetic algorithms, particle swarm optimization, grey wolf optimization, and related population-based methods have been used to search high-dimensional spaces where gradient-based optimization is inconvenient or nondifferentiable. In gamma–hadron separation, such methods can tune hyperparameters and select informative subsets of Cherenkov descriptors, reducing redundancy while improving generalization.
3. MATERIALS AND METHODS
3.1 Dataset Description
The study uses a Monte Carlo–generated MAGIC gamma telescope dataset containing continuous-valued event descriptors. Each event is represented by image parameters extracted from Cherenkov shower images and assigned to either the gamma class or the hadron class. The features include image size, length, width, concentration measures, asymmetry, higher-order moments, and source-position descriptors. These variables encode the geometry, intensity distribution, and orientation of shower images in the camera plane. Figure 1 illustrates the class-wise distributions of the ten commonly used MAGIC features, while Figure 2 summarizes their central tendency and tail behavior. Figure 3 focuses on the distributions of fSize, fLength, and fWidth, which show substantial overlap but still contain useful discriminative structure.
3.2 Data Preprocessing
Data preprocessing is critical because the extracted image parameters are physically correlated, span different numerical ranges, and are affected by shower fluctuations and detectorrelated noise. All input variables are continuous descriptors derived after standard image cleaning procedures. Since the data are generated by Monte Carlo simulation, conventional missing values are not expected; however, preprocessing is still required to address differences in scale, variance, and distribution shape.
Feature scaling is applied uniformly across continuous attributes so that variables with large magnitudes do not dominate gradient updates. Scaling parameters are fitted exclusively on the training subset and then applied to validation and testing subsets to avoid information leakage. Class labels are encoded numerically as y ∈{0,1}, and the dataset is partitioned into stratified training, validation, and testing subsets. This pipeline ensures that all models and optimizers receive consistent input representations.
3.3 Deep Learning Models
Let x ∈Rd denote the input feature vector for one Cherenkov event, and let y ∈{0,1} denote its class label. A generic neural classifier estimates
where θ contains trainable parameters. For binary classification, the output probability is produced with a sigmoid activation,
Model parameters are trained by minimizing binary crossentropy,
N ∑ i=1
L = −1
[yi log( ˆpi)+(1−yi)log(1−ˆpi)]. (3)
Four models are compared. ANN provides a fully connected baseline; CNN captures local feature interactions; LSTM models ordered dependencies across the feature sequence; and EALSTM extends LSTM with attention to emphasize informative components. In an LSTM cell, the gates are defined as it = σ(Wixt +Uiht−1 +bi), (4) ft = σ(W f xt +Uf ht−1 +bf ), (5) ot = σ(Woxt +Uoht−1 +bo), (6) ˜ct = tanh(Wcxt +Ucht−1 +bc), (7)
ht = ot ⊙tanh(ct). (9)
The attention layer computes normalized weights αt = exp(et) ∑j exp(ej), et = vT tanh(Waht +ba), (10) and forms the context vector
3.4 Metaheuristic Optimization
The optimization stage searches for feature subsets and hyperparameters that maximize validation performance. A candidate solution encodes selected features and model-control parameters. The objective function rewards strong classification performance while discouraging unnecessarily complex solutions:
F(s) = λ1 Accuracy(s)+λ2 F1(s)−λ3 where S is the selected feature subset and d is the total feature count.
3.5 Greylag Goose Optimization
Greylag Goose Optimization (GGO) is a population-based search method inspired by cooperative movement and role allocation in greylag goose groups. A population Yi, i = 1,2,...,n, represents feasible solutions. The best individual Z guides the population while exploration and exploitation groups are dynamically balanced. At iteration t, the population is divided as
Pt = Pexplore t ∪Pexploit t , |Pexplore t |+|Pexploit
The algorithm increases exploration when improvement stagnates and shifts toward exploitation as promising regions emerge.
Algorithm 1: GGO Algorithm Require population Yi, size n, maximum iterations tmax, objective function Fn, and parameters b,B,D,... Ensure best agent position Z Initialize the population and calculate the objective function for each agent. Determine the best position Z and divide agents into exploration and exploitation groups. For each iteration t = 1 to tmax, update exploration agents using stochastic search equations. Update exploitation agents based on iteration conditions and random parameters. Evaluate the objective function and update Z if a better solution is found. If no improvement occurs over successive iterations, adapt the sizes of the exploration and exploitation groups. Return the best agent position Z.
3.6 Dynamic Optimization and ABGGO
Dynamic optimization considers objectives or feasible regions that vary with time:
where F(L,t) is time-dependent and S(t) is a feasible region. The proposed ABGGO extends GGO with an adaptive balance between exploration and exploitation, preserving di-versity when the search stagnates and intensifying the search near strong candidate solutions. This dynamic mechanism is well suited to feature selection and hyperparameter optimiza-tion because the effective search landscape changes as model validation performance evolves.
3.7 Evaluation Metrics
Performance is assessed with six complementary metrics. Accuracy measures overall correctness; sensitivity or TPR measures gamma-event detection; specificity or TNR mea-sures hadron rejection; PPV and NPV quantify predictive
Algorithm 2: BCGGO/ABGGO Algorithm Initialize population, solution encodings, optimizer parameters, and the EALSTM search space. Evaluate all candidates using validation metrics and identify the current best solution. Partition the population into balanced exploration and exploitation subgroups. Perform exploration using multiple guide solutions to maintain population diversity. Perform exploitation around sentry or elite solutions to refine high-quality candidates. Adapt the subgroup sizes when objective values stagnate. Continue until the maximum number of iterations is reached, then return the selected features and optimized hyperparameters.
reliability; and F-score summarizes precision–recall balance.
Accuracy = TP+TN TP+TN +FP+FN , (15)
Sensitivity = TP TP+FN , (16)
Specificity = TN TN +FP, (17)
PPV = TP TP+FP, (18)
NPV = TN TN +FN , (19)
F1 = 2PPV×Sensitivity
PPV+Sensitivity . (20)
Metric Interpretation Accuracy Overall proportion of correctly classified events Sensitivity (TPR) Fraction of gamma events correctly retained Specificity (TNR) Fraction of hadron events correctly rejected PPV Reliability of positive gamma predictions NPV Reliability of negative hadron predictions F-score Harmonic mean of precision and recall
4. EXPERIMENTAL RESULTS
4.1 Baseline Model Performance Before Optimization
Four deep learning architectures are evaluated in baseline form: ANN, CNN, LSTM, and EALSTM. The results show a clear hierarchy. EALSTM achieves the highest accuracy of 0.9294 and the highest F-score of 0.9266, outperforming LSTM, CNN, and ANN. The attention mechanism helps the model emphasize physically informative Cherenkov descriptors and improves both signal retention and background rejection. Table 4 reports the numerical comparison, and Figures 4–6 provide the corresponding visual comparisons across the same metrics. Table 4. Baseline performance of deep learning models before optimization.
Model Accuracy TPR TNR PPV NPV F-score EALSTM 0.9294 0.9231 0.9353 0.9302 0.9286 0.9266 LSTM 0.9091 0.9009 0.9167 0.9091 0.9091 0.9050 CNN 0.8980 0.8950 0.9009 0.8991 0.8969 0.8970 ANN 0.8915 0.8889 0.8940 0.8930 0.8899 0.8910
The ANN model exhibits the weakest baseline performance, while CNN improves local nonlinear modeling but remains less effective than recurrent methods. LSTM captures ordered dependencies among input features but lacks explicit attention. EALSTM provides the most balanced performance across accuracy, sensitivity, specificity, PPV, NPV, and Fscore.
4.2 Optimized Model Analysis
Metaheuristic optimization is applied to the EALSTM framework using GA, GWO, PSO, and the proposed ABGGO. The optimized models improve over the baseline configuration, confirming that feature selection and hyperparameter tuning are important for reducing redundancy and improving generalization. ABGGO+EALSTM achieves the best overall results. Table 5 gives the optimized model comparison, while Figures 7–9 visualize the metric balance and stability of the optimized configurations.
Model Accuracy TPR TNR PPV NPV F-score ABGGO+EALSTM 0.9718 0.9694 0.9740 0.9715 0.9721 0.9704 GA+EALSTM 0.9532 0.9533 0.9531 0.9554 0.9510 0.9544 GWO+EALSTM 0.9470 0.9456 0.9484 0.9504 0.9435 0.9480 PSO+EALSTM 0.9426 0.9402 0.9449 0.9442 0.9410 0.9422
The ABGGO+EALSTM model consistently obtains the largest and most balanced metric profile. Its accuracy of
0.9718, sensitivity of 0.9694, specificity of 0.9740, and Fscore of 0.9704 indicate strong gamma-event retention and hadronic background suppression. Compared with baseline EALSTM, these values represent absolute improvements exceeding four percentage points in the principal metrics.
The radar, bar, and heatmap visualizations show that ABGGO not only improves peak performance but also stabilizes the model across repeated evaluations. The close agreement between mean and median metric values and the low standard deviation indicate reliable and reproducible behavior.
5. CONCLUSION AND FUTURE WORK
This study presented a deep learning and metaheuristic optimization framework for gamma–hadron discrimination in atmospheric Cherenkov telescope data. Starting from baseline ANN, CNN, LSTM, and EALSTM models, EALSTM established the strongest non-optimized performance, achieving an accuracy of 0.9294 and an F-score of 0.9266. Its attention mechanism enabled more effective exploitation of physically meaningful image parameters.
The integration of metaheuristic optimization produced substantial gains. The proposed ABGGO+EALSTM configuration achieved the best results, with accuracy of 0.9718 and F-score of 0.9704, outperforming GA+EALSTM, GWO+EALSTM, and PSO+EALSTM. These gains show that adaptive feature selection and hyperparameter tuning can significantly improve background rejection and signal retention.
Future work will focus on validating the framework on real observational data, extending the approach to multi-telescope array analysis, improving real-time event filtering, and integrating camera-image representations with physically interpretable Hillas parameters. Further investigation may also explore uncertainty quantification and deployment on nextgeneration Cherenkov observatories.