Abstract
In the Internet of Things, openness significantly increases security risks. Therefore, detecting such attacks through anomaly traffic monitoring is crucial for ensuring network security. Although existing intrusion detection systems (IDSs) have made some progress in detection performance using deep learning techniques (e.g., graph learning and meta-learning), the class imbalance problem remains a major challenge that needs to be addressed. To this end, we propose a double-anchor contrastive learning (DACL) framework. First, we introduce a positive–negative sample construction module. Compared to traditional contrastive learning methods, this module directly constructs sample pairs, preserving more flow information and thereby enhancing the effectiveness. Second, we design a feature embedding and extraction module. By utilizing convolutional neural networks (CNNs) to extract spatial correlations among raw features, we generate more discriminative feature representations. Subsequently, we propose the DACL module, introducing a double-anchor mechanism to impose double constraints on interclass distances, further enhancing feature representation capabilities and clustering effects. Finally, we map the learned features to a low-dimensional space via a classification network, achieving precise detection of abnormal traffic. Extensive experiments demonstrate that DACL outperforms existing works in terms of accuracy on datasets such as CIC-DDoS2017, CIC-IDS2018, and CIC-DDoS2019.
Funding Information
  • National Natural Science Foundation of China (61971178)
  • National Natural Science Foundation of China (62372149)
  • National Natural Science Foundation of China (U23A20303)
  • National Natural Science Foundation of China (62572168)
  • Ordos Science and Technology Major “Open Bidding for Selecting the Best Candidates” Project (JBGS-2023-002)
  • National Natural Science Foundation of China (5500-202140127A)
  • National Natural Science Foundation of China (5500-202440171A-1-1-ZN)
  • Anhui Provincial Water Conservancy Science and Technology Project (slky202501-06)
  • Natural Science Foundation of Anhui Province (2508085MF151)
  • Key Laboratory of Knowledge Engineering with Big Data (BigKEOpen2025-04)
  • Open Foundation of State Key Laboratory of Networking and Switching Technology (SKLNST-2025-1-12)