Attention-Enhanced CNN–ResNet with XGBoost Ensemble and DAMCE Loss for Intrusion Detection
摘要
Intrusion detection is a critical component of modern cybersecurity yet building systems that are both accurate and generalisable remains a significate challenge due to diverse attack types, imbalanced datasets, and evolving threat patterns. This study proposes a hybrid intrusion detection framework evaluated on the UNSW-NB15, CICIDS2017, and NSL-KDD datasets. The framework combines a one-dimensional convolutional neural network enhanced with attention and residual blocks for feature generalisation, with an XGBoost classifier tailored for tabular decision boundaries. The preprocessing pipeline integrates categorical encoding, mutual information feature selection, synthetic oversampling, and feature standardisation. To address the limitations of conventional objective functions, we introduce the Difficulty-Aware MSE + CE (DAMCE) loss, which adaptively balances cross-entropy and mean squared error based on sample difficulty. Experimental results demonstrate that the proposed ensemble consistently outperforms standalone models, while DAMCE improves stability and class-wise calibration compared to standard loss functions. These findings underline the value of integrating deep learning with boosting and highlight the importance of adaptive loss design in developing robust and generalisable intrusion detection systems. Code link on GitHub: IRICT/CNN-Xgboost.ipynb at main · BillBs-13/IRICT