An unknown electromagnetic signal clustering method of domain knowledge embedding contrast learning

CN121278411BActive Publication Date: 2026-10-0936TH RES INST OF CETC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511361029.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-10-09
Estimated Expiration
2045-09-23

AI Technical Summary

Technical Problem

[0005]鉴于上述的分析,本发明实施例旨在提供一种领域知识嵌入对比学习的未知电磁信号聚类方法,用以解决现有电磁信号聚类方法对标签依赖强、对信道环境敏感、无法有效利用先验知识的技术问题

Benefits of technology

[0070] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121278411B_ABST
    Figure CN121278411B_ABST
Patent Text Reader

Abstract

The application provides an unknown electromagnetic signal clustering method based on domain knowledge embedding contrast learning, belongs to the field of electromagnetic signal recognition, and solves the problem that existing clustering methods are strongly dependent on labels and cannot effectively utilize prior knowledge.The unknown electromagnetic signal clustering method comprises the following steps: extracting an IQ signal from a collected unknown electromagnetic signal; inputting the IQ signal into a trained clustering model to obtain a clustering result of the unknown electromagnetic signal; wherein the trained clustering model comprises a first shared feature extraction network and a first clustering projection head; the first shared feature extraction network is constructed based on a one-dimensional ResNet18 network and is used for extracting deep features of enhanced features; the first clustering projection head is constructed based on a multilayer perception mechanism and is used for mapping the deep features to a clustering space, outputting clustering assignment probabilities of the unknown electromagnetic signal, and obtaining a clustering result based on the clustering assignment probabilities.The unknown electromagnetic signal clustering method improves the clustering precision and robustness of the label-free electromagnetic signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electromagnetic signal recognition, and in particular to a clustering method for unknown electromagnetic signals based on domain knowledge embedding and comparative learning. Background Technology

[0002] With the rapid development of wireless technology and the surge in IoT devices, spectrum resources are becoming increasingly scarce. Effective identification of electromagnetic signals has become a crucial link in ensuring the stable operation of electromagnetic systems and the rational allocation of spectrum resources. Traditional supervised identification methods rely on large amounts of labeled signal data for model training. However, in practical applications, the electromagnetic signal acquisition environment is complex and variable, with numerous signal types and frequent changes, making the acquisition of high-quality labeled data costly and inefficient. Furthermore, labeled data typically only covers known signal types and cannot encompass novel, abnormal, or bursty signals, causing supervised models to fail when faced with unknown types, severely limiting their adaptability and generalization ability. Therefore, there is an urgent need to develop an electromagnetic signal clustering method that can automatically extract signal features and classify signals without labels.

[0003] Existing unsupervised electromagnetic signal clustering methods mainly include two types: statistical feature-based clustering and deep learning-based clustering methods. The former relies heavily on features designed by experts, such as higher-order cumulants and cyclic spectra, and combines them with algorithms such as K-means and spectral clustering for signal classification. However, these methods are sensitive to channel conditions and noise, making them difficult to adapt to the diverse signals in real-world scenarios. The latter introduces methods such as autoencoders and contrastive learning to improve feature representation capabilities and directly learns clustering labels from the data. However, most of these methods remain purely data-driven and lack the utilization of prior knowledge in the electromagnetic domain, resulting in severe degradation of clustering performance under complex channel conditions.

[0004] Therefore, existing clustering methods generally suffer from poor generalization ability, insufficient stability, and weak domain adaptability, making it difficult to meet the clustering requirements in dynamic and complex electromagnetic scenarios. Summary of the Invention

[0005] Based on the above analysis, the embodiments of the present invention aim to provide a clustering method for unknown electromagnetic signals by embedding domain knowledge into comparative learning, in order to solve the technical problems of existing electromagnetic signal clustering methods, such as strong dependence on labels, sensitivity to channel environment, and inability to effectively utilize prior knowledge.

[0006] The objective of this invention is mainly achieved through the following technical solutions:

[0007] This invention provides a method for clustering unknown electromagnetic signals using domain knowledge embedding and contrastive learning, comprising the following steps:

[0008] Extract IQ signals from the acquired unknown electromagnetic signals;

[0009] The IQ signal is input into the trained clustering model to obtain the clustering results of the unknown electromagnetic signal;

[0010] The trained clustering model includes a first shared feature extraction network and a first clustering projection head. The first shared feature extraction network is constructed based on a one-dimensional ResNet18 network and is used to extract deep features of the IQ signal. The first clustering projection head is constructed based on a multilayer perceptron and is used to map the deep features of the IQ signal to the clustering space, output the clustering assignment probability of the unknown electromagnetic signal, and obtain the clustering result based on the clustering assignment probability.

[0011] Furthermore, the trained clustering model is obtained through the following training process:

[0012] Electromagnetic signals of various modulation types are collected and corresponding IQ signals are generated to form a training signal dataset;

[0013] Construct an initial clustering model that includes the first clustering branch and the second clustering branch;

[0014] The first clustering branch includes a first shared feature extraction network and a first clustering projection head;

[0015] The second clustering branch includes a second shared feature extraction network and a second clustering projection head;

[0016] The first and second shared feature extraction networks have the same structure, both built on a one-dimensional ResNet18 network;

[0017] The first and second clustering projection head network structures are identical, both based on multilayer perceptrons;

[0018] The enhanced feature x is obtained by performing data augmentation on each IQ signal in the signal dataset. s , will x s The first clustering branch is input, and x is obtained after passing through the first shared feature extraction network. s Corresponding deep features; x s The corresponding deep features are obtained by the first clustering projection head to obtain y s ;

[0019] Extract the expert knowledge feature x for each IQ signal in the training signal dataset. f Extract x using a trained auxiliary encoder f The deep features of each IQ signal in the x f Nearest neighbor search is performed on the deep features to obtain the nearest neighbor expert knowledge feature x for each IQ signal. nn , will x nnThe input to the second clustering branch, after passing through the second shared feature extraction network, yields the corresponding deep features, x. nn The corresponding deep features are processed by the second clustering projection head to obtain y. nn ;

[0020] Construct y s and y nn Clustering assignment loss between them, based on y s and y nn The clustering assignment loss and the information entropy regularization term are used to construct a contrastive fine-tuning loss function L. KS Continue until the comparison and fine-tuning loss function converges, and a well-trained initial clustering model is obtained;

[0021] Extract the first clustering branch from the trained initial clustering model and use it as the trained clustering model.

[0022] Furthermore, for a training batch, the y obtained s and y nn The allocation matrix is ​​obtained. It is expressed as follows:

[0023]

[0024] Where K is the number of modulation types; B is the batch size;

[0025] calculate and The similarity of sample pairs formed by the column vectors is as follows:

[0026]

[0027] in, and Allocation matrix and Column vector elements;

[0028] structure and The clustering assignment loss is as follows:

[0029]

[0030] Where k1,k2∈{s,nn};

[0031] The information entropy regularization term is used to prevent all samples from clustering into a single cluster. This information entropy regularization term is as follows:

[0032]

[0033] in,

[0034] based on and The clustering assignment loss, along with the information entropy regularization term, is used to construct a contrastive fine-tuning loss function L. KS The process continues until the fine-tuned loss function converges, resulting in a well-trained clustering model.

[0035] Furthermore, the contrastive fine-tuning loss function L KS As shown below:

[0036]

[0037] in, The enhanced feature x corresponding to the i-th IQ signal in the training signal data structure. s Its expert knowledge characteristics x nn Clustering assignment loss; Let x be the i-th expert knowledge feature. nn Clustering assignment loss of the i-th IQ signal in the training signal data.

[0038] Furthermore, the pre-trained auxiliary encoder is used to extract the expert knowledge features x of each IQ signal in the training signal dataset. f The deep features;

[0039] The pre-trained auxiliary encoder, as well as the first and second shared feature extraction networks, are all obtained through pre-trained models.

[0040] Furthermore, the pre-trained model includes a first data augmentation branch, a second data augmentation branch, and an expert knowledge branch;

[0041] The first data augmentation branch includes a rotation transformation data augmentation module, a first pre-trained shared feature extraction network, and a first instance head;

[0042] The second data augmentation module includes an amplitude variation data augmentation module, a second pre-trained shared feature extraction network, and a second instance head;

[0043] The expert knowledge branch includes an expert knowledge extraction module, an auxiliary encoder, and a third instance header;

[0044] Each IQ signal in the training signal dataset is input into the first data augmentation branch, and after passing through the rotation transformation data augmentation module, a rotation-enhanced feature x is obtained. a ;x a x is obtained after the first pre-trained shared feature extraction network. a The deep features of x a The deep features are processed by the first instance head to obtain the enhanced feature z. a ;

[0045] Each IQ signal in the training signal dataset is input into the second data augmentation branch, and after passing through the amplitude flipping data augmentation module, a rotational augmentation feature x is obtained. b ;x b x is obtained after the second pre-trained shared feature extraction network. b The deep features of x b The deep features are processed by the second instance head to obtain the enhanced feature z. b ;

[0046] Each IQ signal in the training signal dataset is input into the expert knowledge branch, and the corresponding expert knowledge feature x is obtained through the expert knowledge extraction module. f x f x is obtained after the auxiliary encoder f The deep features of x f After the deep features are processed by the third instance head, the knowledge features z are obtained. f ;

[0047] The pre-trained model is trained using the training signal dataset until the pre-training loss function converges to obtain the trained pre-trained model.

[0048] Extract the first pre-trained shared feature extraction network from the trained pre-trained model, and use it as the first and second shared feature extraction networks in the initial clustering model;

[0049] The first, second, and third instance heads have the same structure, all being multilayer perceptron networks; the first and second pre-trained shared feature extraction networks have the same structure, both being one-dimensional ResNet18 networks.

[0050] Furthermore, during the training process of the pre-trained model, feature pairs z are calculated separately. a and z f z f and z a z b and z f and z f and z b Similarity;

[0051] The similarity between sample pairs is calculated using cosine similarity, as follows:

[0052]

[0053] in, For feature pairs used to calculate similarity; k1,k2∈{a,b,f}; z a ,z b Enhanced features generated for the corresponding data augmentation branch; z fThe expert knowledge features extracted for embedding expert knowledge into branches;

[0054] The loss for each sample pair is derived based on the similarity between the sample pairs, as shown below:

[0055]

[0056] Where i is the sample index. Let B be the feature pair of the i-th sample, B be the batch size, and τ1 be the temperature coefficient.

[0057] The pre-training loss function is constructed based on the loss of each sample pair.

[0058] Furthermore, the pre-training loss function L KE As shown below:

[0059]

[0060] in, z a and z f z f and z a z b and z f z f and z b The characteristics of loss.

[0061] Furthermore, for each IQ signal x in the training signal dataset, a nearest neighbor search is performed on the expert knowledge features to obtain the K of each IQ signal. top The nearest neighbor expert knowledge features are as follows:

[0062] N(x)=p xz (KNN(p zx (x),K top ))

[0063] Where KNN(·) represents the k-nearest neighbors algorithm, p xz : Represents the IQ signal x to the expert knowledge feature z f index mapping; p zx : This indicates that the expert knowledge feature z f Inverse index mapping back to IQ signals; K top This is the preset number of nearest neighbors.

[0064] Furthermore, the expert knowledge feature x f This includes the instantaneous amplitude characteristics, higher-order moments, and higher-order cumulants of the IQ signal; x f It is expressed as follows:

[0065] x f =[K,M 2,0 M 2,1 M 3,0 M 4,0 M 4,1 M 4,2 M 6,1 M 6,3 M 8,0 M 8,1 M 8,2 ,

[0066] M 8,3 M 8,4 C 4,0 C 4,1 C 4,2 C 6,0 C 6,1 C 6,2 C 6,3 C 8,0 C 8,1 C 8,2 C 8,3 C 8,4 ]

[0067] Where K represents the instantaneous amplitude characteristic, and M... 2,0 M is a second-order unconjugate mixing moment. 2,1 M is a second-order mixed moment containing one conjugate; 3,0 M is a third-order unconjugate mixed moment; 4,0 M is a fourth-order unconjugate mixing moment. 4,1 M is a 4th-order mixed moment containing one conjugate. 4,2 M is a fourth-order mixed moment containing two conjugates; 6,1 M is a 6th-order mixed moment containing one conjugate. 6,3 It is a 6th-order mixed moment containing 3 conjugates;

[0068] M 8,0 M 8,1 M 8,2 M 8,3 These are the 8th order mixed moments containing 0, 1, 2, 3, and 4 conjugates, respectively; C 4,0 C is a fourth-order non-conjugate cumulant. 4,1 C is a 4th-order cumulant containing one conjugate. 4,2 It is a 4th-order cumulant containing two conjugates; C 6,0 C 6,1 C 6,2 C 6,3 These are the cumulants of order 6 containing 0, 1, 2, and 3 conjugates, respectively; C 8,0 C 8,1 C 8,2 C8,3 C 8,4 These are the cumulative quantities of order 8, containing 0, 1, 2, 3, and 4 conjugates, respectively.

[0069] This invention also discloses a clustering system for unknown electromagnetic signals based on domain knowledge embedding comparative learning, comprising:

[0070] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0071] 1. This invention breaks through the limitations of traditional unsupervised clustering which is "purely data-driven". By embedding electromagnetic domain expert knowledge features such as instantaneous amplitude and higher-order moments / cumulative quantities, and combining nearest neighbor search to establish the association between data features and knowledge features, it effectively reduces the impact of complex channel conditions and noise interference on clustering performance, solves the problem of poor generalization ability of existing methods in dynamic electromagnetic scenarios, adapts to more diverse signal types and application environments, and improves clustering generalization ability and scenario adaptability.

[0072] 2. This invention designs a contrastive learning framework with two clustering branches (data augmentation branch + knowledge feature branch). By constructing clustering assignment loss, similarity loss, and information entropy regularization term, it ensures the consistency of data features and knowledge features in the clustering space while avoiding excessive concentration of samples in a single cluster. Simultaneously, it extracts deep signal features based on one-dimensional ResNet18, which, compared to traditional statistical features (such as cyclic spectrum), better captures the essential patterns of signals, significantly improving the stability and accuracy of clustering results for unknown electromagnetic signals. By integrating electromagnetic domain expert knowledge with the contrastive learning mechanism, it enhances the accuracy and robustness of electromagnetic signal clustering under unlabeled conditions.

[0073] 3. This invention does not rely on a large amount of labeled electromagnetic signal data. Through a model training process of "pre-training (data augmentation + knowledge guidance) - fine-tuning (contrast loss optimization)," it achieves clustering of unknown signals in unsupervised scenarios. It not only solves the pain points of traditional supervised methods, such as high label acquisition costs and inability to cover new signals, but also has greater domain specificity than existing unsupervised methods. It provides a low-cost and efficient technical solution for practical electromagnetic signal identification (such as spectrum monitoring and abnormal signal detection), reducing label dependence and application costs.

[0074] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0075] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0076] Figure 1 This is a flowchart of an unknown electromagnetic signal clustering method based on domain knowledge embedding and comparative learning in an embodiment of the present invention.

[0077] Figure 2 This is a schematic diagram of pre-training and clustering training in an embodiment of the present invention. Detailed Implementation

[0078] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0079] This invention proposes a clustering method for unknown electromagnetic signals that integrates prior knowledge in the electromagnetic domain with a deep contrastive learning mechanism, enabling high-precision clustering of complex electromagnetic signals even in the absence of sample labels. The method first constructs a unified knowledge embedding representation, injecting electromagnetic prior information such as instantaneous and statistical features into the model to guide signal enhancement strategies and the contrastive pre-training process, thereby obtaining feature representations aligned with prior knowledge. Subsequently, in the fine-tuning stage, a sample selection mechanism based on pre-trained features and knowledge similarity is introduced to construct a semantically consistent set of positive and negative samples to improve the model's discriminative ability, ultimately achieving adaptive clustering of unknown electromagnetic signals. Compared to traditional methods, this invention overcomes the performance bottleneck of single-data-driven clustering methods, exhibiting stronger robustness, generalization, and clustering accuracy in complex electromagnetic environments. It provides a novel technical approach for clustering unknown electromagnetic signals in complex electromagnetic scenarios, offering strong support for related research and practice.

[0080] A specific embodiment of the present invention discloses a clustering method for unknown electromagnetic signals based on domain knowledge embedding contrastive learning, such as... Figure 1 As shown, it includes the following steps:

[0081] Step S1: Extract the IQ signal from the acquired unknown electromagnetic signal;

[0082] Step S2: Input the IQ signal into the trained clustering model to obtain the clustering results of the unknown electromagnetic signal;

[0083] The trained clustering model includes a first shared feature extraction network and a first clustering projection head. The first shared feature extraction network is constructed based on a one-dimensional ResNet18 network and is used to extract deep features of the IQ signal. The first clustering projection head is constructed based on a multilayer perceptron and is used to map the deep features of the IQ signal to the clustering space, output the clustering assignment probability of the unknown electromagnetic signal, and obtain the clustering result based on the clustering assignment probability.

[0084] Step S1, specifically.

[0085] Extracting the IQ signal representation of unknown electromagnetic signals.

[0086] Real-time acquisition of unknown electromagnetic signal data r(n), of length L, and extraction of its real and imaginary parts to obtain the corresponding in-phase I(n) and quadrature Q(n), as shown below:

[0087]

[0088] Where real(·) and imag(·) represent the extraction of the real and imaginary parts of the IQ signal, respectively.

[0089] The purpose of step S1 is to extract the IQ signal from the unknown electromagnetic signal acquired in real time.

[0090] Step S2 includes steps S21-S24.

[0091] Step S21: Construct the training signal dataset and the test signal dataset.

[0092] Electromagnetic signals of various modulation types are collected to obtain the corresponding IQ signals.

[0093] For example, various modulation types include 2ASK, BPSK, QPSK, 16QAM, etc.; in practical applications, these can be changed according to specific needs.

[0094] The number of modulation types of the collected electromagnetic signals determines the number of cluster categories K obtained, which is equal to the number of modulation types of the collected electromagnetic signals.

[0095] The training signal dataset contains N train The test signal dataset contains N samples. test One sample.

[0096] For example, the training signal dataset includes 3,000 sample data, which are used for subsequent expert knowledge extraction, pre-training, construction of the nearest neighbor set, and comparative fine-tuning;

[0097] The test signal dataset includes 1000 sample data points, used to verify the clustering performance of the clustering model.

[0098] Step S22: Construct a pre-trained model and pre-train it using the training signal dataset.

[0099] like Figure 2 As shown, the pre-trained model includes a first data augmentation branch, a second data augmentation branch, and an expert knowledge branch;

[0100] The first data augmentation branch includes a rotation transformation data augmentation module, a first pre-trained shared feature extraction network, and a first instance head;

[0101] The second data augmentation module includes an amplitude variation data augmentation module, a second pre-trained shared feature extraction network, and a second instance head;

[0102] The expert knowledge branch includes an expert knowledge extraction module, an auxiliary encoder, and a third instance header;

[0103] Each IQ signal in the training signal dataset is input into the first data augmentation branch, and after passing through the rotation transformation data augmentation module, a rotation-enhanced feature x is obtained. a ;x a x is obtained after the first pre-trained shared feature extraction network. a The deep features of x are obtained a The deep features are processed by the first instance head to obtain the enhanced feature z. a ;

[0104] Each IQ signal in the training signal dataset is input into the second data augmentation branch, and after passing through the amplitude flipping data augmentation module, a rotational augmentation feature x is obtained. b ;x b x is obtained after the second pre-trained shared feature extraction network. b The deep features of x b The deep features are processed by the second instance head to obtain the enhanced feature z. b ;

[0105] Each IQ signal in the training signal dataset is input into the expert knowledge branch, and the corresponding expert knowledge feature x is obtained through the expert knowledge extraction module. f x f x is obtained after the auxiliary encoder f The deep features of x f After the deep features are processed by the third instance head, the knowledge features z are obtained. f ;

[0106] The pre-trained model is trained using the training signal dataset until the pre-training loss function converges to obtain the trained pre-trained model.

[0107] Extract the first pre-trained shared feature extraction network from the trained pre-trained model, and use it as the first and second shared feature extraction networks in the initial clustering model;

[0108] The first, second, and third instance heads have the same structure, all being multilayer perceptron networks; the first and second pre-trained shared feature extraction networks have the same structure, both being one-dimensional ResNet18 networks.

[0109] First pre-trained shared feature extraction network E A (·) is used to extract high-level features from the augmented samples. Through the first and second data augmentation branches, sample pairs (x) are obtained. a ,x b ).

[0110] Data augmentation features are obtained by performing rotation transformation or amplitude inversion on the IQ signal.

[0111] Data augmentation methods include rotation transformation and amplitude flipping.

[0112] The rotational transform data enhancement of the IQ signal is shown below:

[0113]

[0114] Where β is the rotation angle, representing a counterclockwise rotation between 0 and π, and I = real(x) and Q = imag(x) represent the real and imaginary parts of the IQ signal x, respectively.

[0115] The amplitude inversion transformation data enhancement of the IQ signal is shown below:

[0116]

[0117] Here, i and j are values ​​randomly sampled from the set {0,1}. When i = 0 or j = 0, the corresponding component remains unchanged; when i = 1 or j = 1, the corresponding component undergoes a sign flip.

[0118] Data augmentation features are obtained by performing random rotation transformations or amplitude flipping on IQ signals.

[0119] The expert knowledge embedding branch includes the auxiliary encoder E K (·), which extracts expert knowledge samples x f It contains high-level features and aligns them with IQ signal features.

[0120] Enhanced feature x a ,x b The dimension is (2, n), where n is the signal length.

[0121] First and second pre-trained shared feature extraction networks E A (·) represents a one-dimensional ResNet18 network; the auxiliary encoder E K (·) represents a fully connected network. The first and second pre-trained shared feature extraction networks E A (·) and auxiliary encoder E K (·) represents different networks with different input feature dimensions but the same output feature dimension.

[0122] From raw, unlabeled IQ signals, a set of mathematical features is extracted that characterize the signal's essential modulation properties and statistical regularities. These features represent the prior knowledge that domain experts (such as communications engineers) would focus on when identifying signals.

[0123] The extracted expert knowledge includes the instantaneous amplitude characteristics, higher-order moments, and higher-order cumulants of the IQ signal. This prior information can provide semantic guidance that traditional data augmentation cannot capture.

[0124] The instantaneous amplitude characteristic of the IQ signal r(n) is represented by the number of instantaneous amplitudes of the received signal within a given range:

[0125]

[0126] Where K is the instantaneous amplitude characteristic of the IQ signal, E(·) represents the mean amplitude of all sampling points within the IQ signal segment, and std(·) represents the standard deviation of the amplitude of all sampling points within the IQ signal segment.

[0127] r(n) represents the nth complex IQ sampling point;

[0128] The amplitude of each sampling point is standardized (subtract the mean and divide by the standard deviation), and the absolute value is taken; this eliminates the influence of the absolute power magnitude and focuses only on the relative distribution shape of the amplitude.

[0129] This represents the number of sampling points that satisfy the condition 0.2 ≤ standardized amplitude ≤ 0.6. Then, it is divided by the total sampling point length L to obtain the proportion value, which is the instantaneous amplitude feature K.

[0130] Higher-order moments represent higher-order mixing moments of the IQ signal, where for a k-th order mixing moment with q conjugate terms... It is expressed as follows:

[0131] M k,q =E(r(n) p ·(r(n) * ) q ) Formula (5)

[0132] Where k is the total order of the moments, q is the number of conjugate terms, and p is the number of non-conjugate terms; p + q = k, r(n) * It is the conjugate of r(n). E(·) is used to calculate the expected mean.

[0133] Higher-order cumulants are defined using the joint cumulant function; for example, the 6th-order cumulant C 6,3 , means as follows:

[0134] C 6,3 =cum[r(n),r(n),r(n),r(n)] * ,r(n) * ,r(n) * ] Formula (6)

[0135] Where cum[·] denotes the joint cumulative function.

[0136] Ultimately, expert knowledge x is obtained f x f It includes 1 instantaneous amplitude feature, 14 higher-order moment features, and 11 higher-order cumulant features, totaling 26 expert knowledge features.

[0137] The expert knowledge feature x f This includes the instantaneous amplitude characteristics, higher-order moments, and higher-order cumulants of the IQ signal; x f It is expressed as follows:

[0138] x f =[K,M 2,0 M 2,1 M 3,0 M 4,0 M 4,1 M 4,2 M 6,1 M 6,3 M 8,0 M 8,1 M 8,2 ,

[0139] M 8,3 M 8,4 C 4,0 C 4,1 C 4,2 C 6,0 C 6,1 C 6,2 C 6,3 C 8,0 C 8,1 C 8,2 C 8,3 C 8,4 ]

[0140] Formula (7)

[0141] Where K represents the instantaneous amplitude characteristic, and M... 2,0 M is a second-order unconjugate mixing moment. 2,1 M is a second-order mixed moment containing one conjugate; 3,0 M is a third-order unconjugate mixed moment; 4,0 M is a fourth-order unconjugate mixing moment. 4,1 M is a 4th-order mixed moment containing one conjugate. 4,2 M is a fourth-order mixed moment containing two conjugates; 6,1 M is a 6th-order mixed moment containing one conjugate. 6,3 M is a 6th-order mixed moment containing 3 conjugates; 8,0 M 8,1 M 8,2 M 8,3 These are the 8th order mixed moments containing 0, 1, 2, 3, and 4 conjugates, respectively; C 4,0 C is a fourth-order non-conjugate cumulant. 4,1 C is a 4th-order cumulant containing one conjugate. 4,2 It is a 4th-order cumulant containing two conjugates; C 6,0 C 6,1 C 6,2 C 6,3 These are the cumulants of order 6 containing 0, 1, 2, and 3 conjugates, respectively; C 8,0 C 8,1 C 8,2 C 8,3 C 8,4 These are the cumulative quantities of order 8, containing 0, 1, 2, 3, and 4 conjugates, respectively.

[0142] The dimension of the expert knowledge feature vector is (1, 26).

[0143] M 2,1 Used to characterize the second-order statistical properties of IQ signals;

[0144] M 3,0 Used to reflect the third-order statistical properties of a signal (such as asymmetry);

[0145] M 4,0 M 4,1 M 4,2 This is used to describe the fourth-order statistical properties of a signal (such as kurtosis);

[0146] M 6,1 M 6,3 6 is used to characterize the sixth-order statistical properties of the IQ signal;

[0147] M 8,0 M 8,1 M 8,2 M 8,3 , used to capture the eighth-order statistical properties of the signal;

[0148] C 4,0 C 4,1 and C 4,2 This is used to eliminate the effects of Gaussian noise and highlight the non-Gaussian nature of the signal;

[0149] C 6,0 C 6,1 C 6,2 C 6,3 These are 6th-order cumulants containing 0, 1, 2, and 3 conjugates, further characterizing the higher-order non-Gaussian properties of the signal;

[0150] C 8,0 C 8,1 C 8,2 C 8,3 C 8,4 It is used to capture more complex signal statistical characteristics.

[0151] Extracting expert knowledge from a raw, seemingly random IQ signal. f It is compressed into a low-dimensional feature vector rich in semantic information.

[0152] After constructing the pre-trained model, a contrastive learning strategy is used to pre-train the training signal dataset. This involves using augmented samples x of the IQ signal x. a and x b With expert knowledge sample x f Input the shared feature extraction network E respectively A (·) and auxiliary encoder E K (·) Obtain the feature representation z a z b and z f , means as follows:

[0153]

[0154] During the training process of the pre-trained model, feature pairs z are calculated respectively. a and z f z f and z a z b and z f and z f and z b Similarity;

[0155] The similarity between sample pairs is calculated using cosine similarity, as follows:

[0156]

[0157] Among them, z k1 ,z k2For feature pairs used to calculate similarity; k1,k2∈{a,b,f}; z a ,z b Enhanced features generated for the corresponding data augmentation branch; z f The expert knowledge features extracted for embedding expert knowledge into branches;

[0158] The loss for each sample pair is derived based on the similarity between the sample pairs, as shown below:

[0159]

[0160] Where i is the sample index. Let B be the feature pair of the i-th sample, B be the batch size, and τ1 be the temperature coefficient.

[0161] The pre-training loss function is constructed based on the loss of each sample pair.

[0162] for and The cosine similarity between them; k1,k2∈{a,b,f}, that is, the features come from augmented samples or expert knowledge samples; The dot product of two eigenvectors reflects the degree of overlap between the vectors in a direction. respectively, feature vectors and The length of the module.

[0163] τ1 is a temperature coefficient used to control the smoothness of similarity; it is a hyperparameter.

[0164] Formula (9) quantifies the degree of correlation between data augmentation features and expert knowledge features by using cosine similarity.

[0165] During the pre-training phase, if two features belong to the same type of electromagnetic signal (such as signals of the same modulation type, enhanced by different methods or described from the perspective of expert knowledge), the cosine similarity is close to 1, and the pre-trained model will strengthen this similarity; if two features belong to different types of electromagnetic signals, the cosine similarity is close to 0, and the pre-trained model will weaken the similarity between the two.

[0166] In the feature space, the pre-trained model retains both the diversity of data-driven data (from augmented samples) and the certainty of domain prior knowledge (from expert knowledge features), providing a more robust feature foundation for subsequent clustering of unknown signals.

[0167] The pre-training loss function L KE As shown below:

[0168]

[0169] in, z a and z f z f and z a z b and z f z f and z b The characteristics of loss.

[0170] The reason for calculating z a and z f z f and z a The sample pair loss, z a and z f z f and z a The two are asymmetrical;

[0171] And calculate z b and z f z f and z b The sample pair loss, z b and z f z f and z b The two are asymmetrical.

[0172] Pre-training loss L KE Used to optimize the feature alignment capability and alignment effect of pre-trained models.

[0173] The pre-trained auxiliary encoder is used to extract expert knowledge features x for each IQ signal in the training signal dataset. f The deep features;

[0174] The pre-trained auxiliary encoder, as well as the first and second shared feature extraction networks, are all obtained through pre-trained models.

[0175] Step S23: Construct an initial clustering model, train it, and obtain a trained clustering model.

[0176] The trained clustering model is obtained through the following training process:

[0177] Electromagnetic signals of various modulation types are collected and corresponding IQ signals are generated to form a training signal dataset;

[0178] Construct an initial clustering model that includes the first clustering branch and the second clustering branch;

[0179] The first clustering branch includes a first shared feature extraction network and a first clustering projection head;

[0180] The second clustering branch includes a second shared feature extraction network and a second clustering projection head;

[0181] The first and second shared feature extraction networks have the same structure, both built on a one-dimensional ResNet18 network;

[0182] The first and second clustering projection head network structures are identical, both based on multilayer perceptrons;

[0183] The enhanced feature x is obtained by performing data augmentation on each IQ signal in the signal dataset. s , will x s The first clustering branch is input, and x is obtained after passing through the first shared feature extraction network. s Corresponding deep features; x s The corresponding deep features are obtained by the first clustering projection head to obtain y s ;

[0184] Extract the expert knowledge feature x for each IQ signal in the training signal dataset. f Extract x using a trained auxiliary encoder f The deep features of each IQ signal in the x f Nearest neighbor search is performed on the deep features to obtain the nearest neighbor expert knowledge feature x for each IQ signal. nn , will x nn The input to the second clustering branch, after passing through the second shared feature extraction network, yields the corresponding deep features, x. nn The corresponding deep features are processed by the second clustering projection head to obtain y. nn ;

[0185] Construct y s and y nn Clustering assignment loss between them, based on y s and y nn The clustering assignment loss and the information entropy regularization term are used to construct a contrastive fine-tuning loss function L. KS Continue until the comparison and fine-tuning loss function converges, and a well-trained initial clustering model is obtained;

[0186] Extract the first clustering branch from the trained initial clustering model and use it as the trained clustering model.

[0187] Using the pre-trained model and expert knowledge, sample selection is performed. For each sample in the training signal dataset, the nearest neighbor sample set is formed by finding the several most similar samples in the expert knowledge space.

[0188] Iterate through all signal samples in the training signal dataset;

[0189] For each IQ signal x in the training signal data, the auxiliary encoder E in the pre-trained model is used. K (·) Extracted expert knowledge features z f Perform nearest neighbor search to obtain the top K neighbors. top The nearest neighbor samples N(x) are used to filter the samples. Using features for nearest neighbor search yields good results. The goal is to find the sample most similar to the input IQ signal from the training signal dataset.

[0190] For each IQ signal x in the training signal dataset, perform a nearest neighbor search on the expert knowledge features to obtain the K of each IQ signal. top The nearest neighbor expert knowledge features are as follows:

[0191] N(x)=p xz (KNN(p zx (x),K top )) Formula (12)

[0192] Where KNN(·) represents the k-nearest neighbors algorithm, p xz : Represents the IQ signal x to the expert knowledge feature z f index mapping; p zx : This indicates that the expert knowledge feature z f Inverse index mapping back to IQ signals; K top This is the preset number of nearest neighbors.

[0193] The nearest neighbor samples selected are associated with the original samples to facilitate subsequent comparison, fine-tuning, and cluster analysis.

[0194] The nearest neighbor expert knowledge feature in N(x) is similar to the semantics of x.

[0195] For example, K top The default value is 5 or 10;

[0196] If the number of samples in the training signal dataset is 3000-5000, K top Setting it to 5 captures the core similarity between samples while avoiding the introduction of too many redundant samples.

[0197] If the training signal dataset has a richer sample size, such as tens of thousands or more samples, K top Set to 10 to make fuller use of the correlation information between samples.

[0198] The sample selection was completed, resulting in a set of nearest-neighbor samples similar to the input signal. This set will serve as an important input for the subsequent comparative fine-tuning stage, helping to optimize the performance of the clustering model.

[0199] A contrastive clustering model is constructed using a pre-trained model, and then fine-tuned using the training signal dataset and the nearest neighbor sample set to obtain a trained clustering model. The contrastive clustering model consists of a pre-trained network E that extracts shared features from both the pre-trained and nearest neighbor models. A (·) and clustering projection head composition. This is a multi-layer MLP structure that maps the feature space to the clustering space. A (·)and Seriesd in sequence, E A The output of (·) is Input.

[0200] Comparative fine-tuning is performed on sample x and its nearest neighbor sample x. nn For each ∈N(x), calculate the cluster assignment. and Perform a comparison and alignment.

[0201] For a training batch, the obtained y s and y nn The allocation matrix is ​​obtained. It is expressed as follows:

[0202]

[0203] Where K is the number of modulation types; B is the batch size;

[0204] calculate and The similarity of sample pairs formed by the column vectors is as follows:

[0205]

[0206] in, and Allocation matrix and Column vector elements;

[0207] structure and The clustering assignment loss is as follows:

[0208]

[0209] Where k1,k2∈{s,nn};

[0210] The information entropy regularization term is used to prevent all samples from clustering into a single cluster. This information entropy regularization term is as follows:

[0211]

[0212] in,

[0213] based on and The clustering assignment loss, along with the information entropy regularization term, is used to construct a contrastive fine-tuning loss function L. KS The process continues until the fine-tuned loss function converges, resulting in a well-trained clustering model.

[0214] Wherein, the contrast-adjusted loss function L KS As shown below:

[0215]

[0216] in, The enhanced feature x corresponding to the i-th IQ signal in the training signal data structure. s Its expert knowledge characteristics x nn Clustering assignment loss; Let x be the i-th expert knowledge feature. nn Clustering assignment loss of the i-th IQ signal in the training signal data.

[0217] By using this comparative fine-tuning loss to train the initial clustering model using the training signal dataset, a well-trained initial clustering model can be obtained.

[0218] Extract the first clustering branch from the trained initial clustering model and use it as the trained clustering model.

[0219] Step S24: Based on the trained clustering model, input the IQ signal of the unknown electromagnetic signal into the trained clustering model to obtain the clustering result of the unknown electromagnetic signal.

[0220] For an unknown electromagnetic signal acquired in real time, its IQ signal is extracted to obtain x. u , will x u Input the trained clustering model (first feature extraction network E) A (·) and the first clustering projection head The clustering results are as follows:

[0221]

[0222] The purpose of step S2 is to construct training and testing signal datasets, build a pre-trained model with data augmentation branches and expert knowledge branches and train it to obtain the basis for feature extraction, then construct an initial clustering model with dual clustering branches and fine-tune it by comparison to obtain a trained clustering model, input the data augmentation features of the unknown electromagnetic signal into the clustering model, and obtain the clustering result of the unknown electromagnetic signal.

[0223] In summary, the domain knowledge-embedded contrastive learning-based clustering method for unknown electromagnetic signals according to embodiments of the present invention has the following beneficial effects:

[0224] 1. This invention breaks through the limitations of traditional unsupervised clustering which is "purely data-driven". By embedding electromagnetic domain expert knowledge features such as instantaneous amplitude and higher-order moments / cumulative quantities, and combining nearest neighbor search to establish the association between data features and knowledge features, it effectively reduces the impact of complex channel conditions and noise interference on clustering performance, solves the problem of poor generalization ability of existing methods in dynamic electromagnetic scenarios, adapts to more diverse signal types and application environments, and improves clustering generalization ability and scenario adaptability.

[0225] 2. This invention designs a contrastive learning framework with two clustering branches (data augmentation branch + knowledge feature branch). By constructing clustering assignment loss, similarity loss, and information entropy regularization term, it ensures the consistency of data features and knowledge features in the clustering space while avoiding excessive concentration of samples in a single cluster. Simultaneously, it extracts deep signal features based on one-dimensional ResNet18, which, compared to traditional statistical features (such as cyclic spectrum), better captures the essential patterns of signals, significantly improving the stability and accuracy of clustering results for unknown electromagnetic signals. By integrating electromagnetic domain expert knowledge with the contrastive learning mechanism, it enhances the accuracy and robustness of electromagnetic signal clustering under unlabeled conditions.

[0226] 3. This invention does not rely on a large amount of labeled electromagnetic signal data. Through a model training process of "pre-training (data augmentation + knowledge guidance) - fine-tuning (contrast loss optimization)," it achieves clustering of unknown signals in unsupervised scenarios. It not only solves the pain points of traditional supervised methods, such as high label acquisition costs and inability to cover new signals, but also has greater domain specificity than existing unsupervised methods. It provides a low-cost and efficient technical solution for practical electromagnetic signal identification (such as spectrum monitoring and abnormal signal detection), reducing label dependence and application costs.

[0227] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0228] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A clustering method for unknown electromagnetic signals using domain knowledge embedding contrastive learning, characterized in that, include: Extract IQ signals from the acquired unknown electromagnetic signals; The IQ signal is input into the trained clustering model to obtain the clustering results of the unknown electromagnetic signal; The trained clustering model includes a first shared feature extraction network and a first clustering projection head. The first shared feature extraction network is constructed based on a one-dimensional ResNet18 network and is used to extract deep features of the IQ signal. The first clustering projection head is constructed based on a multilayer perceptron and is used to map the deep features of the IQ signal to the clustering space, output the clustering assignment probability of the unknown electromagnetic signal, and obtain the clustering result based on the clustering assignment probability. The trained clustering model is obtained through the following training process: Electromagnetic signals of various modulation types are collected and corresponding IQ signals are generated to form a training signal dataset; Construct an initial clustering model that includes the first clustering branch and the second clustering branch; The first clustering branch includes a first shared feature extraction network and a first clustering projection head; The second clustering branch includes a second shared feature extraction network and a second clustering projection head; The first and second shared feature extraction networks have the same structure, both built on a one-dimensional ResNet18 network; The first and second clustering projection head network structures are identical, both based on multilayer perceptrons; Enhanced features are obtained by performing data augmentation on each IQ signal in the signal dataset. ,Will The first clustering branch is input, and the result is obtained through the first shared feature extraction network. Corresponding deep features; The corresponding deep features are obtained through the first clustering projection head. ; Extract expert knowledge features from each IQ signal in the training signal dataset. Extract using a trained auxiliary encoder The deep features of each IQ signal in the Nearest neighbor search is performed on the deep features to obtain the nearest neighbor expert knowledge features of each IQ signal. ,Will The input to the second clustering branch, after passing through the second shared feature extraction network, yields the corresponding deep features. The corresponding deep features are obtained through the second clustering projection head. ; structure and Clustering assignment loss between them, based on and The clustering assignment loss and the information entropy regularization term are used to construct a contrastive fine-tuning loss function. Continue until the comparison and fine-tuning loss function converges, and a well-trained initial clustering model is obtained; Extract the first clustering branch from the trained initial clustering model and use it as the trained clustering model.

2. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 1, characterized in that, For a training batch and The allocation matrix is ​​obtained. , , means as follows: in, Number of modulation types; Batch size; calculate and The similarity of sample pairs formed by the column vectors is as follows: in, and Allocation matrix and Column vector elements; structure and The clustering assignment loss is as follows: in, ; For sample index; The information entropy regularization term is used to prevent all samples from clustering into a single cluster. This information entropy regularization term is as follows: in, , ; Number of modulation types; based on and The clustering assignment loss and the information entropy regularization term are used to construct a contrastive fine-tuning loss function. The process continues until the fine-tuned loss function converges, resulting in a well-trained clustering model.

3. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 2, characterized in that, The comparison fine-tuning loss function As shown below: in, For the training signal dataset, the first Enhancement features corresponding to each IQ signal Its expert knowledge characteristics Clustering assignment loss; For the first Expert knowledge characteristics With the training signal dataset, the first Clustering assignment loss for IQ signals.

4. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 1, characterized in that, The pre-trained auxiliary encoder is used to extract expert knowledge features for each IQ signal in the training signal dataset. The deep features; The pre-trained auxiliary encoder, as well as the first and second shared feature extraction networks, are all obtained through pre-trained models.

5. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 4, characterized in that, The pre-trained model includes a first data augmentation branch, a second data augmentation branch, and an expert knowledge branch; The first data augmentation branch includes a rotation transformation data augmentation module, a first pre-trained shared feature extraction network, and a first instance head; The second data augmentation branch includes an amplitude variation data augmentation module, a second pre-trained shared feature extraction network, and a second instance head; The expert knowledge branch includes an expert knowledge extraction module, an auxiliary encoder, and a third instance header; Each IQ signal in the training signal dataset is input into the first data augmentation branch, and after passing through the rotation transformation data augmentation module, rotation-enhanced features are obtained. ; After obtaining the first pre-trained shared feature extraction network, The deep features, The deep features are processed by the first instance head to obtain enhanced features. ; This represents the branch after data enhancement via rotation transformation; Each IQ signal in the training signal dataset is input into the second data augmentation branch, and after passing through the amplitude inversion data augmentation module, a rotational augmentation feature is obtained. ; After obtaining the second pre-trained shared feature extraction network The deep features, The deep features are processed by the second instance head to obtain enhanced features. ; This indicates the branch after amplitude inversion data augmentation; Each IQ signal in the training signal dataset is input into the expert knowledge branch, and the corresponding expert knowledge feature is obtained through the expert knowledge extraction module. , Obtained through the auxiliary encoder The deep features, After the deep features are processed by the third instance head, knowledge features are obtained. ; This indicates that expert knowledge is embedded in the branch; The pre-trained model is trained using the training signal dataset until the pre-training loss function converges to obtain the trained pre-trained model. Extract the first pre-trained shared feature extraction network from the trained pre-trained model, and use it as the first and second shared feature extraction networks in the initial clustering model; The first, second, and third instance heads have the same structure, all being multilayer perceptron networks; the first and second pre-trained shared feature extraction networks have the same structure, both being one-dimensional ResNet18 networks.

6. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 5, characterized in that, During the training process of the pre-trained model, feature pairs are calculated separately. and , and , and ,as well as and Similarity; The similarity between sample pairs is calculated using cosine similarity, as follows: in, Feature pairs for calculating similarity; ; Enhanced features generated for the corresponding data augmentation branches; The expert knowledge features extracted for embedding expert knowledge into branches; The loss for each sample pair is derived based on the similarity between the sample pairs, as shown below: in, For sample index, For the first Feature pairs of a sample Batch size; Temperature coefficient; The pre-training loss function is constructed based on the loss of each sample pair.

7. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 6, characterized in that, The pre-training loss function As shown below: in, They are respectively and , and , and , and The characteristics of loss.

8. The method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to claim 1, characterized in that, For each IQ signal in the training signal dataset A nearest neighbor search is performed on the expert knowledge features to obtain each IQ signal. The nearest neighbor expert knowledge features are as follows: in, This refers to the k-nearest neighbors algorithm. Indicates IQ signal To expert knowledge characteristics Index mapping; This indicates the characteristics of expert knowledge. The inverse index mapping back to the IQ signal; This is the preset number of nearest neighbors.

9. A method for clustering unknown electromagnetic signals using domain knowledge embedding contrastive learning according to any one of claims 1-8, characterized in that, The characteristics of expert knowledge This includes the instantaneous amplitude characteristics, higher-order moments, and higher-order cumulants of the IQ signal; It is expressed as follows: in, Instantaneous amplitude characteristics, It is a second-order unconjugate mixing moment. It is a second-order mixed moment containing one conjugate; It is a third-order unconjugate mixed moment; It is a fourth-order unconjugate mixing moment. It is a fourth-order mixed moment containing one conjugate. It is a fourth-order mixed moment containing two conjugates; It is a 6th-order mixed moment containing one conjugate. It is a 6th-order mixed moment containing 3 conjugates; These are 8th-order mixed moments containing 0, 1, 2, 3, and 4 conjugates, respectively; It is a fourth-order non-conjugate cumulant. It is a 4th-order cumulant containing one conjugate. It is a 4th-order cumulant containing two conjugates; These are the cumulants of order 6 containing 0, 1, 2, and 3 conjugates, respectively; These are the cumulative quantities of order 8, containing 0, 1, 2, 3, and 4 conjugates, respectively.