Hybrid Attention Mechanism and Adaptive Grey Wolf Optimization Based Stacked Ensemble for Reliable Software Defect Prediction
Prashanth Kumar BolisettyResearch Scholar, School of AI Computing and Multimedia, Lincoln University College, Petaling Jaya, Malaysia. bolisetty.phdscholar@lincoln.edu.my0000-0003-1190-0402
Dr. MidhunchakkaravarthyProfessor & Dean, School of AI Computing and Multimedia, Lincoln University College, Petaling Jaya, Malaysia midhun@lincoln.edu.my0000-0002-0107-885X
Dr.D. ShanthiProfessor & Head, Department of Information Technology, Vignan's Institute of Management and Technology for Women, Hyderabad, India. drshanthicse@gmail.com0000-0001-8472-0694
Keywords: Software Defect Prediction, Stacked Ensemble Learning, Adaptive Grey Wolf Optimization, Softmax Mutual Information Attention, Isotonic Probability Calibration, NASA PROMISE, Machine Learning.
Abstract
Software defects cause system failures, high maintenance costs, and operational risks in safety-critical applications. Despite significant advances in machine learning-based defect prediction, existing approaches remain constrained by reliance on single classifiers, suboptimal hyperparameter tuning, uniform treatment of features that ignores the variable predictive power of software metrics, and uncalibrated probability outputs that limit operational usability. This research gap motivates the development of HADES (Hybrid Attention-Driven Ensemble System), a reliability-oriented framework that addresses all four limitations within a unified, reproducible pipeline. HADES is evaluated on an 11,540-module synthetic NASA PROMISE-schema dataset with 22 static code metrics using an 80:20 stratified train/test split. The methodology integrates four key innovations: (1) a Softmax Mutual-Information Attention Layer that computes data-driven importance weights for all 22 metrics and produces a weighted feature vector; (2) an Adaptive Multi-Strategy Grey Wolf Optimizer (AMGWO) employing opposition-based learning initialisation, Lévy-flight exploration, and a sigmoid adaptive control schedule to efficiently search a 10-dimensional hyperparameter space; (3) a stacked generalisation ensemble combining Gradient Boosting Machine, Extra Trees, Random Forest, and Multilayer Perceptron with Logistic Regression as meta-learner; and (4) isotonic probability calibration that converts ensemble scores into actionable defect probabilities for risk-based inspection prioritisation. Experimental results on the 2,308-sample held-out test set achieve Accuracy = 98.44%, AUC-ROC = 99.80%, Precision = 98.29%, Recall = 98.91%, and F1-score = 98.60%, outperforming all individual baselines by at least 2.51 percentage points in accuracy. These outcomes confirm HADES as a remarkably efficient model for predicting software defects in controlled synthetic environments, with while validation on real NASA PROMISE datasets remains a crucial next step.