Unmanned aerial vehicle cluster type identification and quantity prediction method based on spectrum analysis
Patent Information
- Application Number
- CN202611391181.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-10-09
AI Technical Summary
[0012]本发明的目的就在于提供一种基于频谱分析的无人机集群类型识别与数量预测方法,解决复杂电磁环境中因多型号无人机通信频谱混杂、噪声干扰剧烈等情况导致的高相似度无人机机型区分精度低、数量预测不准确的缺陷,以及通信协议相近、频谱特征高度相似的同品牌不同系列无人机辨识能力不足的缺陷
[0028]关于S6:对S5训练好的识别模型的输出的一批次pi进行L2归一化再密度聚类,后续推理、识别过程中,一批次无人机数据的频谱图像先按S11~S12处理为一批次信息图,再送入识别模型中,读取识别模型输出的低维投影矩阵p,再L2归一化、HDBSCAN密度聚类,输出无人机群的预测类别和各类别数量。
Smart Images

Figure CN122885631A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of drone swarm type identification technology, and in particular to a method for drone swarm type identification and quantity prediction based on spectrum analysis. Background Technology
[0002] The low-altitude industry continues to expand, and the application scenarios for consumer and industrial drones are constantly broadening. However, incidents of illegal flights, such as unauthorized flights and intrusions into restricted areas, are frequent. In unlabeled scenarios, high-precision identification technology for drone models has significant shortcomings, making it difficult to quickly classify drone models and determine their level of danger. Unsupervised feature clustering analysis based on the spectrum signals of low-altitude drones collected by monitoring can automatically group different drone signals without the need for manual sample labeling. This is a key technical support for air situation assessment, risk intent determination, and the design of graded control schemes.
[0003] Clustering is a core technology in unsupervised data mining and electromagnetic signal analysis. Currently, clustering techniques for area spectrum datasets can be categorized into three main approaches: (1) Traditional clustering schemes driven by artificial features: This type of method first extracts the modulation features, power spectrum features, and time-frequency statistical features of the spectrum manually through signal processing, and then performs linear dimensionality reduction such as PCA, and completes the clustering division using algorithms such as K-Means and Fuzzy C-means (FCM). For example, the UAV radio frequency signal classification method based on PCA feature dimensionality reduction combined with K-Means achieves preliminary clustering by extracting artificial features such as signal strength and frequency distribution. This type of method is simple in principle and has low computational cost, but it is highly dependent on artificial feature engineering experience. It is only suitable for clustering datasets with obvious class differences and low dimensionality, and it requires knowledge of the number of clusters. It cannot perform effective clustering on image datasets such as spectrograms, and its generalization ability is very poor. It is not only unable to perform parameterless clustering tasks, but its representation ability on high-dimensional and noisy electromagnetic data is also limited.
[0004] (2) Deep clustering schemes: To overcome the limitations of manual features, the academic community has proposed methods such as deep embedding clustering (DEC) based on deep autoencoders. These methods automatically learn the low-dimensional representation of data through neural networks and then combine clustering loss to complete unsupervised classification. For example, the deep clustering spectrum sensing method for wireless access technology identification uses an autoencoder to map high-dimensional spectrum data to a low-dimensional latent space before performing clustering, reducing the dependence on manual annotation. However, this type of method has the following problems: (2.1) It generally uses a single-branch autoencoder to construct a single potential feature space, which cannot simultaneously achieve the dual goals of "instance-level subtle radio frequency fingerprint capture" and "cluster-level category commonality aggregation". If the feature dimension is set too high, it is easy to retain too much individual noise, resulting in the feature of the same model being discrete and the intra-class spacing being too large. If the feature dimension is set too low, the key fingerprint details that distinguish highly similar models will be lost, resulting in the blurring of the boundaries between different models and insufficient inter-class spacing. (2.2) Most of them rely only on reconstruction loss and single-target clustering loss for optimization, which makes it difficult to simultaneously take into account the subtle fingerprint differences of individual signals and the common features at the category level. As a result, the ability to distinguish highly similar UAV models is insufficient in the complex electromagnetic environment where the communication spectrum of multiple UAV models is mixed and the noise interference is severe.
[0005] (3) Density clustering scheme: For scenarios where the number of clustered targets is unknown, density-based algorithms such as DBSCAN and Density Peak Clustering (DPC) have been introduced into UAV target clustering tasks to automatically divide the cluster structure based on the sample density distribution. For example, the automatic aerial target clustering method based on DPC determines the cluster center by local density and neighborhood distance, which reduces the preset requirement for the number of clusters to a certain extent. However, density clustering algorithms are very sensitive to sample density distribution. UAV test datasets generally have problems such as unbalanced cluster samples and large density differences between clusters. Complex electromagnetic noise can destroy the sample density distribution, which can easily lead to cluster splitting or excessive merging. The clustering performance of UAVs with similar communication protocols drops significantly. In addition, this type of algorithm still relies on manual tuning of hyperparameters such as density threshold, which has poor generalization in scenarios with dynamic changes in the spectral signal-to-noise ratio and is difficult to effectively separate effective signals from electromagnetic clutter.
[0006] Explanation of the name: Feature Information Segment: In this invention, this refers to an image segment in the spectrum that contains radio frequency fingerprint features. Due to minute differences in the manufacturing process, such as antenna impedance and oscillator deviation, each drone's radio frequency transmitter leaves a unique "fingerprint" feature in its transmitted signal, known as "radio frequency fingerprint features." These features are highly unique and difficult to forge, thus exhibiting a unique advantage in drone identification. Furthermore, due to different sample acquisition durations set by the acquisition device, a single spectrum may contain multiple image segments with radio frequency fingerprint features.
[0007] SimCLR (Simple Framework for Contrastive Learning of Visual Representations) is a self-supervised contrastive learning framework proposed in 2020. Its core principle is to learn robust visual representations using NT-Xent loss by treating different augmented views of the same image as positive samples and other views within a batch as negative samples, without requiring manual annotation. The structure includes data augmentation (applying strong augmentations twice randomly to each original image), an encoder (mapping augmented views into high-dimensional feature vectors), and a projection head (projecting high-dimensional feature vectors into a low-dimensional space using a small nonlinear MLP; this head is discarded after training, retaining only the encoder features for downstream tasks). The loss function uses normalized temperature-scaled cross-entropy loss (NT-Xent).
[0008] Cluster-level Contrastive Head: This is one of the core components in the Contrastive Clustering (CC) model. It is specifically designed to perform contrastive learning in the column space (class distribution space) to optimize the consistency of cluster assignments.
[0009] Instance-level Contrastive Head (ICH): It is one of the core components in deep clustering models (such as Contrastive Clustering, CC), and is mainly used to construct instance-level feature representations through contrastive learning under unlabeled conditions.
[0010] DCSS (Deep Clustering with Self-supervision using Pairwise DataSimilarities) is a self-supervised deep clustering framework based on pairwise data similarity, aiming to address the problem of traditional deep clustering methods ignoring pairwise relationships between data points. This method progressively optimizes the data representation through two contiguous subspaces (u-space and q-space).
[0011] L ne Cluster-assignment negative entropy regularization is used to regularize the cluster assignment probability to prevent cluster collapse. It is widely used in deep clustering, contrastive clustering, DEC, IDEC, DeepCluster, and SwAV. Summary of the Invention
[0012] The purpose of this invention is to provide a method for identifying and predicting the number of drone swarms based on spectrum analysis. This method addresses the shortcomings of low accuracy in distinguishing highly similar drone models and inaccurate number prediction caused by the mixed communication spectrum and severe noise interference of multiple drone models in complex electromagnetic environments, as well as the insufficient ability to identify different series of drones from the same brand with similar communication protocols and highly similar spectrum characteristics.
[0013] To achieve the above objectives, the technical solution adopted by this invention is as follows: a method for identifying and predicting the type and number of unmanned aerial vehicle (UAV) swarms based on spectrum analysis, comprising the following steps: S1, Construct a dataset D for drone swarm type identification and prediction, including S11~S12; S11, Collect spectrum images of different UAV models under different communication bandwidths. There are C types of UAV models, and a total of N spectrum images. S12, Extract all feature information segments from the nth spectral image, splice them together, and convert them to grayscale to form an information image x. n Then label the model category b. n Construct sample n as (I n ,b n ), and combine all samples to form a dataset D, 1≤n≤N; S2, construct a one-stage training network M1, including S21~S22; S21, Obtain the data augmentation module and encoder of the SimCLR network. The data augmentation module is used to input x. n Output two enhanced images x na x nb The encoder is used to input x n x na x nb Generate a high-dimensional vector h corresponding to the three. n h na h nb ; S22, the encoder output is connected to the cluster branch and the instance branch. The cluster branch is a cluster-level comparison head and a first decoder connected in sequence. The instance branch is an instance-level comparison head and a second decoder connected in sequence. The cluster-level comparison head is used to input h. n h na h nb Output the clustering projection z corresponding to the three. n z na z nb Instance-level comparison header is used for input h n h na h nb Output the instance projection y corresponding to the three.n y na y nb The first decoder and the second decoder are used for z n Decode and generate x respectively n Cluster branch reconstruction graph and instance branch refactoring graph ; S3, construct the total loss L1 for one-stage training based on the reconstruction loss and contrast loss of the two branches, and train M1 by minimizing L1 using the dataset D until convergence, thus obtaining the one-stage model M. F1 ; S4, M F1 The encoder is connected to a fully connected network via a cluster-level contrast head to obtain a two-stage training network M2. In M2, the encoder takes a batch of samples as input, generates corresponding high-dimensional vectors, and constructs a high-dimensional matrix H from these high-dimensional vectors. The clustering-level comparison head in M2 takes H as input and outputs a clustering projection matrix q', which is then normalized to a probability distribution matrix q. The fully connected network maps q' to a low-dimensional projection matrix p, where the i-th row vector p... i Let be the membership degree of the i-th sample in a batch of samples to each cluster; S5, based on the DCSS algorithm, processes p and q and trains M2 until convergence to obtain the recognition model; S6, will a batch of p i L2 normalization is performed, followed by HDBSCAN density clustering, to output the predicted categories of the drone swarm and the number of each category.
[0014] Preferably, the communication bandwidth includes 2M, 8M, and 20M.
[0015] Preferably, in S3, L1 is constructed according to the following formula: L1=L r +w c L c , , , In the formula, L r L c Reconstruction loss and contrast loss are respectively used, MSE(∙,∙) is the MSE loss, L inst For y na y nb The NT-Xent loss of the instance branch, L, is calculated. clus For z-based na z nb The NT-Xent loss of the cluster branch was calculated, L ne w is the entropy regularization term for cluster branches.c w inst w clus These are the weights of the corresponding multiplication terms.
[0016] As a preferred embodiment, in S5, when training M2 based on the DCSS algorithm, the number of training rounds T and the number of segmented rounds T are preset. s , where the t-th training session includes S51~S54; S51, preset training rounds T, and segmented rounds T s ; S52, if the current round t < T s The target similarity matrix S = q⋅q TR Otherwise, S = p⋅p TR ⋅ represents matrix multiplication, and TR represents the transpose operation; S53, set values greater than 0.99 in p to 1 and values less than 0.01 to 0 to obtain the boundary cutoff distribution of p. And calculate the predicted similarity matrix S q , ; S54, Calculate the pairing loss L based on the DCSS algorithm PW If t < T s To minimize L PW Update M2 parameters, otherwise update the fully connected network parameters.
[0017] Preferably, the low-dimensional projection matrix p∈R B×K B is the batch size, and K is the total number of clusters.
[0018] As a preferred option, the clustering projection matrix q' is normalized to a probability distribution matrix q using the softmax function.
[0019] In this invention: Regarding the centralized sample construction of the S1 dataset: The original spectrum image of the UAV is filled with a large area of redundant background pixels with no discriminative value. Only two types of information, radio frequency fingerprint features and communication protocol features, can support aircraft type differentiation. This invention processes the original spectrum image into an information map containing only radio frequency fingerprint features by cropping, stitching, and grayscale processing. This removes invalid information and enhances clustering-sensitive features.
[0020] Regarding S2: The goal is to construct a one-stage training network M1. M1 consists of a cluster branch and an instance branch, forming a two-branch structure. The number of neurons in the cluster-level comparison head output layer is K, where K is a common binary number such as 32 or 64, representing a total of K clusters. When the low-dimensional projection matrix p is output later, the vector p in the i-th row of p... i p represents the membership degree of the i-th sample in a batch of samples to each cluster. iThe dimension is K, and each dimension corresponds to the membership degree of one cluster. The number of neurons in the output layer of the instance-level contrast head is D1, where D1 > K in this invention.
[0021] In S2, both the data augmentation module and the encoder are based on the existing SimCLR network. The data augmentation module performs X... n Generate two enhanced images x na x nb Image enhancement techniques include: brightness and contrast adjustment, adding Gaussian noise, and adding Gaussian blur. (Three images x) n x na x nb The cluster projection z of the cluster branch is obtained by passing through the shared encoder, cluster branch, and instance branch. n z na z nb and the instance projection y of the instance branch n y na y nb Two decoders are used to generate the reconstruction graph of the two branches. and .
[0022] Regarding S3: Construct the total one-stage training loss L1 for training M1, including the reconstruction loss L for both branches. r And contrast loss L c .
[0023] L r It consists of two parts, namely and The MSE loss between the two branches, also known as the relative reconstruction loss, aims to align the reconstructed spectral distributions of instance branches and cluster branches, ensuring that both branches are based on the extraction of common underlying features and avoiding representation fragmentation. To prevent this loss from interfering with cluster space clustering optimization, the cluster branch reconstruction graph is optimized. Perform gradient truncation and backpropagate constraints only through instance branches.
[0024] L c It consists of three parts: the NT-Xent loss L for instance branches and cluster branches. inst L clus and the entropy regularization term L of the cluster branch ne The NT-Xent loss is the core loss function for SimCLR's self-supervised contrastive learning, where L in the instance branch... inst This is used to constrain different enhanced view representations of the same spectral sample to be close to each other, increase the feature distance between different sample instances, and mine fine-grained RF fingerprints of single samples; L of cluster branches clusThis involves applying comparative constraints at the cluster level, causing cluster prototypes belonging to the same UAV model to cluster together, while cluster prototypes of different models separate, thus achieving cluster-level discriminative learning. ne This is to prevent the network from allocating all samples to at least a few clusters, constrain the sample allocation probability of each cluster to tend to be balanced, ensure that each cluster can be fully utilized, and prevent a large number of invalid idle clusters.
[0025] In summary, the total loss L1 of the first-stage training in S3 is equivalent to the fusion of spectrum reconstruction loss, two-layer contrastive loss, and cluster balance regularization constraint for collaborative training. It simultaneously learns two types of low-dimensional latent features: instance representation space and cluster representation space, mapping high-dimensional noisy spectral signals to cluster-friendly low-dimensional manifolds. After training, the optimal parameters from the first-stage training are retained for subsequent training. The core objective of this training stage is to preserve the original spectral information through the reconstruction task, while simultaneously uncovering subtle radio frequency differences in the UAV spectrum under unlabeled conditions through two-layer contrastive learning of instance and cluster branches. This addresses the challenges of strong noise interference in complex electromagnetic environments, high similarity of spectral features among different UAV models, and the tendency of ordinary autoencoders to learn invalid features and distinguish between similar models, providing high-quality pre-trained weights for the second-stage cluster space fine-tuning.
[0026] Regarding S4: Based on M1 and the optimal parameters obtained during training, a two-stage training network M2 is constructed by adding optimal parameters. This step borrows the idea of the DCSS algorithm, introducing a fully connected network and pairwise similarity loss to further refine the cluster feature space, and making optimizations for the characteristics of small differences and large noise in the UAV spectrum signal map. In S4, two projection matrices are constructed. One is a high-dimensional matrix H composed of a batch of high-dimensional vectors, which is output as a clustering projection matrix q' by a clustering-level comparison head. q' is processed in two ways: one is normalized by the softmax function to obtain a probability distribution matrix q, and the other is mapped to a low-dimensional projection matrix p by a fully connected network. Since q and p are both obtained based on the features output by the clustering-level comparison head, they are both cluster space features, but the two projection matrices have different dimensions and belong to two different cluster space features.
[0027] Regarding S5: M2 is trained based on the DCSS algorithm for processing the probability distribution matrix q and the low-dimensional projection matrix p. Unlike the original DCSS algorithm, which requires continuous maintenance of cluster centers, resulting in a cumbersome process and the potential for introducing unstable noise during cluster center iteration, this invention combines the structure and method of S4 and S5 with matrices p and q, eliminating the need for explicit definition of cluster centers and avoiding the time overhead and spatial instability associated with updating them. Similarity is directly calculated using matrices p and q, simplifying the training process. A two-stage update training strategy is also employed, with t < T in the early stages of training. sAt that time, the target similarity matrix S is constructed based on q, and all parameters of M2 are updated, including the parameters of the encoder, cluster-level contrast head, and fully connected network, to jointly optimize the feature representation; when t≥T s In this approach, the target similarity matrix S is constructed based on p and only updates the fully connected network, finely adjusting the probability distribution of the cluster space to optimize the final feature space. This strategy enables feature learning to proceed gradually, avoiding oscillations caused by synchronous updates of global parameters and improving the stability of cluster representations.
[0028] Regarding S6: a batch of p outputs from the recognition model trained on S5. i L2 normalization and density clustering are performed. In the subsequent inference and recognition process, the spectral image of a batch of UAV data is first processed into a batch information image according to S11~S12, and then sent into the recognition model. The low-dimensional projection matrix p output by the recognition model is read, and then L2 normalization and HDBSCAN density clustering are performed to output the predicted category of the UAV swarm and the number of each category.
[0029] Compared with existing technologies, the advantages of this invention are as follows: This invention addresses the task of UAV swarm type identification and quantity prediction, proposing a spectrum analysis-based method for UAV swarm type identification and quantity prediction that utilizes dual-space prototype comparison clustering and two-stage joint optimization. Compared to traditional manual feature clustering, single deep clustering, and fixed-category clustering schemes, it possesses core advantages such as strong anti-electromagnetic interference capability, stable training convergence, no need for prior knowledge of the number of UAV types, automatic filtering of spectral clutter, and lightweight edge deployment. It can provide a complete and reliable technical solution for unsupervised situational awareness assessment of UAVs in complex low-altitude electromagnetic scenarios. Specifically, it is reflected in: (1) Construct a dual-branch autoencoder of instance space + cluster space, namely the first stage of this invention to construct model M1, with clear division of labor: the high-dimensional instance-level comparison head captures the unique radio frequency fingerprint of a single UAV, and the low-dimensional cluster-level comparison head focuses on the common spectral features of the same model, realizing "the same model is gathered together and different models are separated", solving the defect that a single representation space cannot take into account both individual differences and category commonalities.
[0030] (2) A one-stage training total loss L1, consisting of multiple loss constraints including the reconstruction loss of the two branches, the contrastive loss of the two branches, and the cluster equilibrium entropy regularization, was designed for M1. This invention designs the reconstruction loss into two parts, one part being... and The MSE loss is used to constrain the complete reconstruction of the original spectral texture in the cluster space, part of which is The MSE loss is used as a cross-branch relative reconstruction loss to align the underlying signal distributions of the two latent spaces. The contrastive loss is designed as two parts, with each branch using the features corresponding to the enhanced image for contrastive analysis with the NT-Xent loss, and an entropy regularization term L is introduced into the cluster branch. neThe L1 loss constructed based on these components in the first-stage training can compensate for the feature fidelity deficiency of pure contrastive learning on noisy spectral data. It ensures that instance branches retain fine-grained RF fingerprints that distinguish different models, and allows cluster branches to stably capture common spectral patterns of the same model. This significantly improves the separability and robustness of cluster representations in low signal-to-noise ratio and multi-bandwidth mixed scenarios, providing high-quality representations for the subsequent second-stage cluster boundary refinement optimization and final clustering.
[0031] (3) In the second stage of this method, a lightweight fully connected network is embedded in the back end of the cluster representation space to construct model M2, using the pairing loss L in the DCSS algorithm. PW The cluster boundaries are finely optimized to further improve the separability between classes in the potential space. Finally, hierarchical density clustering is performed based on the obtained excellent representation space to complete the task of UAV swarm type identification and quantity prediction. The low-dimensional projection matrix p obtained by M2 has great clustering advantages of low dimensionality, high separability, and low noise.
[0032] (4) This invention does not require explicit definition of cluster centers. Following step S3 of this invention, a one-stage model M is obtained. F1 Subsequently, in step S4, network M2 is trained in conjunction with the fully connected network construction phase, and a clustering projection matrix q' is generated. Based on q', a probability distribution matrix q and a low-dimensional projection matrix p are generated. In step S5, the recognition model can be obtained by directly processing p and q using the DCSS algorithm. Since the DCSS algorithm directly processes p and q, there is no need to explicitly define cluster centers, and it avoids the unstable noise that can be easily introduced by iterating through cluster centers. This eliminates the time overhead and spatial jitter caused by updating cluster centers, and directly relies on the normalized cluster space features to calculate similarity, simplifying the training process.
[0033] (5) For the low-dimensional projection matrix p trained at the M2 output, this invention uses the HDBSCAN algorithm for the final clustering task. It can identify clusters of arbitrary shapes and has good clustering performance in feature spaces with a lot of noise and data anomalies. This algorithm does not require manual pre-setting of the number of clusters and simultaneously completes the automatic classification of UAV models, identification of electromagnetic interference noise, and statistics of the number of cluster targets.
[0034] Experiments show that the present invention can significantly improve the accuracy of type identification and quantity prediction of spectrum signals of multiple UAV models. Compared with mainstream deep clustering algorithms, it has stronger noise resistance and discrimination ability, and can provide reliable technical support for UAV swarm model identification and swarm target quantity prediction in complex electromagnetic scenarios. Attached Figure Description
[0035] Figure 1 This is a flowchart of the present invention; Figure 2 This is a schematic diagram for generating an information map based on a spectral image. Figure 3 This is a diagram of the network structure for the first stage of training. Figure 4 This is a diagram of the network structure for two-stage training. Detailed Implementation
[0036] The present invention will be further described below with reference to the embodiments and accompanying drawings.
[0037] Example 1: See Figures 1-4 A method for identifying and predicting the number of drone swarms based on spectrum analysis includes the following steps: S1, Construct a dataset D for drone swarm type identification and prediction, including S11~S12; S11, Collect spectrum images of different UAV models under different communication bandwidths. There are C types of UAV models, and a total of N spectrum images. S12, Extract all feature information segments from the nth spectral image, splice them together, and convert them to grayscale to form an information image x. n Then label the model category b. n Construct sample n as (I n ,b n ), and combine all samples to form a dataset D, 1≤n≤N; S2, construct a one-stage training network M1, including S21~S22; S21, Obtain the data augmentation module and encoder of the SimCLR network. The data augmentation module is used to input x. n Output two enhanced images x na x nb The encoder is used to input x n x na x nb Generate a high-dimensional vector h corresponding to the three. n h na h nb ; S22, the encoder output is connected to the cluster branch and the instance branch. The cluster branch is a cluster-level comparison head and a first decoder connected in sequence. The instance branch is an instance-level comparison head and a second decoder connected in sequence. The cluster-level comparison head is used to input h. n h na h nb Output the clustering projection z corresponding to the three. n z na z nb Instance-level comparison header is used for input h n h na h nb Output the instance projection y corresponding to the three. n yna y nb The first decoder and the second decoder are used for z n Decode and generate x respectively n Cluster branch reconstruction graph and instance branch refactoring graph ; S3, construct the total loss L1 for one-stage training based on the reconstruction loss and contrast loss of the two branches, and train M1 by minimizing L1 using the dataset D until convergence, thus obtaining the one-stage model M. F1 ; S4, M F1 The encoder is connected to a fully connected network via a cluster-level contrast head to obtain a two-stage training network M2. In M2, the encoder takes a batch of samples as input, generates corresponding high-dimensional vectors, and constructs a high-dimensional matrix H from these high-dimensional vectors. The clustering-level comparison head in M2 takes H as input and outputs a clustering projection matrix q', which is then normalized to a probability distribution matrix q. The fully connected network maps q' to a low-dimensional projection matrix p, where the i-th row vector p... i Let be the membership degree of the i-th sample in a batch of samples to each cluster; S5, based on the DCSS algorithm, processes p and q and trains M2 until convergence to obtain the recognition model; S6, will a batch of p i L2 normalization is performed, followed by HDBSCAN density clustering, to output the predicted categories of the drone swarm and the number of each category.
[0038] In this embodiment, the communication bandwidth includes 2M, 8M, and 20M.
[0039] In S3, L1 is constructed according to the following formula: L1=L r +w c L c , , , In the formula, L r L c Reconstruction loss and contrast loss are respectively used, MSE(∙,∙) is the MSE loss, L inst For y na y nb The NT-Xent loss of the instance branch, L, is calculated. clus For z-based na z nb The NT-Xent loss of the cluster branch was calculated, L ne w is the entropy regularization term for cluster branches. c w instw clus These are the weights of the corresponding multiplication terms.
[0040] In S5, when training M2 based on the DCSS algorithm, the preset training epochs T and segment epochs T are used. s , where the t-th training session includes S51~S54; S51, preset training rounds T, and segmented rounds T s ; S52, if the current round t < T s The target similarity matrix S = q⋅q TR Otherwise, S = p⋅p TR ⋅ represents matrix multiplication, and TR represents the transpose operation; S53, set values greater than 0.99 in p to 1 and values less than 0.01 to 0 to obtain the boundary cutoff distribution of p. And calculate the predicted similarity matrix S q , ; S54, Calculate the pairing loss L based on the DCSS algorithm PW If t < T s To minimize L PW Update M2 parameters, otherwise update the fully connected network parameters.
[0041] Low-dimensional projection matrix p∈R B×K B is the batch size, and K is the total number of clusters. The clustering projection matrix q' is normalized using the softmax function to obtain the probability distribution matrix q.
[0042] Figure 2 The process of generating infographics from spectral images is demonstrated. Figure 2 The left image is a spectrum image. Green represents large areas of redundant background pixels with no discriminative value, while yellow represents frequency bands containing RF fingerprint features and communication protocol features. Zooming in on the yellow area reveals two RF fingerprint feature segments, annotated as feature information in the text. Cropping, piecing together, and then converting to grayscale yields an infographic containing only RF fingerprint features. Since the grayscale image can be directly represented using grayscale, in... Figure 2 Below, a series of matrices with numerical values represent the grayscale infographic. Figure 2 An infographic showing a batch is displayed.
[0043] Figure 3 The diagram shows the structure of the one-stage training network M1. As can be seen from the diagram, it includes a data augmentation module and an encoder connected in sequence. The encoder is divided into two paths: one path connects to the first decoder via a cluster-level comparison head, and the other path connects to the second decoder via an instance-level comparison head. At this time, the cluster-level comparison head and the first decoder form a cluster branch, and the instance-level comparison head and the second decoder form an instance branch.
[0044] Figure 4 The structure diagram of the two-stage training network M2 is shown in the figure. It includes an encoder, a cluster-level contrast head, and the output of the cluster-level contrast head is divided into two paths, which are connected to the softmax function layer and the fully connected network, respectively. The softmax function layer is used to process q' into q, and the fully connected network is used to process q' into p.
[0045] Example 2: See Figures 1-4 To verify the effectiveness of this invention, we conducted extensive field measurements on real signals under various electromagnetic environments and selected two nearly unobstructed open areas to reduce the impact of multipath effects. The experiment used 10 identical Xino Wheatfield Lite radios as transmitters to collect signals from the UAV, employing TDMA-OFDM modulation. Over a period of one month, on eight different dates, a large number of spectral images with signal bandwidths of 2MHz, 8MHz, and 20MHz and a class size of 10 were collected to construct the dataset SN00X. Specific parameters are shown in Table 1. Through a series of rigorous experiments on the self-built dataset SN00X, we demonstrated the effectiveness of the proposed framework. The clustering performance of this invention was compared with that of four benchmark clustering methods on this dataset. The relevant parameters and platform configuration for the algorithm experiments are shown in Table 1.
[0046] Table 1. Signal Acquisition and Experimental Configuration , This embodiment uses three standard metrics to evaluate clustering performance: Cluster Accuracy (ACC), Normalized Mutual Information (NMI), and Adjusted RAND Index (ARI). ACC finds the optimal mapping between the ground truth and predicted labels. NMI finds a normalized similarity measure between two different labels for the same data point. ARI measures the similarity between the predicted and ground truth labels by considering all sample pairs and calculating the logarithm of consistent assignments in both partitions.
[0047] Four representative algorithms in the field of image clustering were selected for comparative experiments with this invention: k-means, PCA+k-means, VAE, and CC. The sources for each method are as follows: kmeans:S. Lloyd, “Least squares quantization in pcm,” IEEETransactions on Information Theory, vol. IT-28, no. 2, pp. 129–137, 3 1982. CC: Y. Li, P. Hu, Z. Liu, D. Peng, JT Zhou, and X. Peng, “Contrastive clustering,” in Proceedings of the AAAI Conference on ArtificialIntelligence, vol. 35, 2021, pp. 8547–8555.
[0048] VAE:DP Kingma and M. Welling, “Auto-encoding variational bayes,” 2013. PCA+k-means: This method uses k-means clustering after dimensionality reduction via PCA. It is often used as a benchmark algorithm in this field for comparison with other algorithms.
[0049] The dataset consists of three sets of SN00X spectrum images of UAVs at various bandwidths, collected by ourselves: 2MHz, 8MHz, and 20MHz. The input data, learning rate, batch size, and other related settings for all methods were standardized. Other parameters not covered adopted the settings that yielded best performance under their respective experimental environments. Experimental performance metrics are shown in Table 2 below. Table 2. Comparison of experimental indicators for each method , This experiment compared our proposed algorithm with four baseline methods—k-means, PCA+k-means, VAE, and CC—on the 2MHz, 8MHz, and 20MHz frequency bands of our self-built UAV spectrum dataset SN00X, using ACC, NMI, and ARI as the core evaluation metrics. The results show that our second-stage algorithm outperforms all three metrics across all frequency bands. In the 2MHz band, the accuracy reaches 0.8565. In the most interference-prone 20MHz band, it improves accuracy by over 11 percentage points compared to the optimal baseline CC algorithm, demonstrating superior clustering accuracy and anti-interference capabilities. It also exhibits significantly better clustering performance than traditional and similar algorithms across various bandwidth spectrum maps. Our algorithm's first stage, relying on dual-space representation and dual-layer contrastive loss, already surpasses all baselines. The second stage further improves performance by finely optimizing cluster boundaries through pairwise similarity constraints, validating the effectiveness of the dual-branch architecture and two-stage progressive training strategy. This demonstrates our ability to stably adapt to unsupervised clustering tasks on UAV spectrums with different bandwidths.
[0050] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for identifying and predicting the number of unmanned aerial vehicle (UAV) swarms based on spectrum analysis, characterized in that, Includes the following steps: S1, Construct a dataset D for drone swarm type identification and prediction, including S11~S12; S11, Collect spectrum images of different UAV models under different communication bandwidths. There are C types of UAV models, and a total of N spectrum images. S12, Extract all feature information segments from the nth spectral image, splice them together, and convert them to grayscale to form an information image x. n Then label the model category b. n Construct sample n as (I n ,b n ), and combine all samples to form a dataset D, 1≤n≤N; S2, construct a one-stage training network M1, including S21~S22; S21, Obtain the data augmentation module and encoder of the SimCLR network. The data augmentation module is used to input x. n Output two enhanced images x na x nb The encoder is used to input x n x na x nb Generate a high-dimensional vector h corresponding to the three. n h na h nb ; S22, the encoder output is connected to the cluster branch and the instance branch. The cluster branch is a cluster-level comparison head and a first decoder connected in sequence. The instance branch is an instance-level comparison head and a second decoder connected in sequence. The cluster-level comparison head is used to input h. n h na h nb Output the clustering projection z corresponding to the three. n z na z nb Instance-level comparison header is used for input h n h na h nb Output the instance projection y corresponding to the three. n y na y nb The first decoder and the second decoder are used for z n Decode and generate x respectively n Cluster branch reconstruction graph and instance branch refactoring graph ; S3, construct the total loss L1 for one-stage training based on the reconstruction loss and contrast loss of the two branches, and train M1 by minimizing L1 using the dataset D until convergence, thus obtaining the one-stage model M. F1 ; S4, M F1 The encoder is connected to a fully connected network via a cluster-level contrast head to obtain a two-stage training network M2. In M2, the encoder takes a batch of samples as input, generates corresponding high-dimensional vectors, and constructs a high-dimensional matrix H from these high-dimensional vectors. The clustering-level comparison head in M2 takes H as input and outputs a clustering projection matrix q', which is then normalized to a probability distribution matrix q. The fully connected network maps q' to a low-dimensional projection matrix p, where the i-th row vector p... i Let be the membership degree of the i-th sample in a batch of samples to each cluster; S5, based on the DCSS algorithm, processes p and q and trains M2 until convergence to obtain the recognition model; S6, will a batch of p i L2 normalization is performed, followed by HDBSCAN density clustering, to output the predicted categories of the drone swarm and the number of each category.
2. The method for identifying and predicting the number of UAV swarms based on spectrum analysis according to claim 1, characterized in that, Communication bandwidths include 2M, 8M, and 20M.
3. The method for identifying and predicting the type and number of UAV swarms based on spectrum analysis according to claim 1, characterized in that, In S3, L1 is constructed according to the following formula: L1=L r +w c L c , , , In the formula, L r L c Reconstruction loss and contrast loss are respectively used, MSE(∙,∙) is the MSE loss, L inst For y na y nb The NT-Xent loss of the instance branch, L, is calculated. clus For z-based na z nb The NT-Xent loss of the cluster branch was calculated, L ne w is the entropy regularization term for cluster branches. c w inst w clus These are the weights of the corresponding multiplication terms.
4. The method for identifying and predicting the type and number of UAV swarms based on spectrum analysis according to claim 1, characterized in that, In S5, when training M2 based on the DCSS algorithm, the preset training epochs T and segment epochs T are used. s , where the t-th training session includes S51~S54; S51, preset training rounds T, and segmented rounds T s ; S52, if the current round t < T s The target similarity matrix S = q⋅q TR Otherwise, S = p⋅p TR ⋅ represents matrix multiplication, and TR represents the transpose operation; S53, set values greater than 0.99 in p to 1 and values less than 0.01 to 0 to obtain the boundary cutoff distribution of p. And calculate the predicted similarity matrix S q , ; S54, Calculate the pairing loss L based on the DCSS algorithm PW If t < T s To minimize L PW Update M2 parameters, otherwise update the fully connected network parameters.
5. The method for identifying and predicting the type and number of UAV swarms based on spectrum analysis according to claim 1, characterized in that, Low-dimensional projection matrix p∈R B×K B is the batch size, and K is the total number of clusters.
6. The method for identifying and predicting the number of UAV swarms based on spectrum analysis according to claim 1, characterized in that, The clustering projection matrix q' is normalized by the softmax function to become the probability distribution matrix q.