Abstract:In network environments such as cloud computing and the Internet of Things, traditional intrusion detection methods suffer from insufficient generalization and interpretability. To address this issue, this paper proposes a Threat Trend Mapping Method (TTMM) that integrates feature compression and behavior correlation analysis. The method constructs low-dimensional feature representations based on an autoencoder and introduces a contrastive loss function to enhance the aggregation of similar classes and the differentiation of heterogeneous classes. Through cluster analysis, it extracts baseline features of various types of data and generates a trend similarity map between test samples and baselines, thereby achieving visual representation of network threats. Experimental results show that TTMM performs excellently in distinguishing heterogeneous baseline samples and identifying similar trend features, with high accuracy and stability in multi-class attack detection. Moreover, after feature space optimization, the accuracy is improved by up to 24.11% on the KNN model and datasets including CIC-Bell-DNS-2021.