Radio frequency fingerprint identification method based on twin network and negative prototype and related equipment
By using a radio frequency fingerprinting method based on twin networks and negative prototypes, a rotating constellation diagram is generated and combined with a dynamic rejection threshold, which solves the problem of misjudgment of unknown devices in device identification and achieves high-precision device classification and identification.
Patent Information
- Application Number
- CN202511308347.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies struggle to effectively distinguish unknown devices, especially when devices have similar hardware characteristics or complex channel conditions, leading to decreased accuracy and stability in identification.
A radio frequency fingerprinting method based on Siamese networks and negative prototypes is adopted. By generating a rotating constellation diagram and extracting feature vectors using Siamese networks, and combining dynamic rejection thresholds for device classification, the method can accurately distinguish between known and unknown categories.
It significantly improves the accuracy and reliability of recognition in open set recognition scenarios, effectively addresses device similarity and signal interference, and reduces the misjudgment rate of unknown devices.
Smart Images

Figure CN121327652A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information security, in particular to a radio frequency fingerprinting method based on a twin network and a negative prototype and related equipment. BACKGROUND
[0002] Radio frequency fingerprinting (RFF) utilizes the non-reproducible characteristics of devices due to hardware differences during signal transmission, and has become a potential and efficient device identification method. Radio frequency fingerprints can reflect the hardware level differences of devices through signal characteristics such as modulation mode, frequency offset, power amplifier characteristics, etc. This technology has important application value in device authentication, Internet of Things security and spectrum management scenarios. However, the similarity of device hardware characteristics and the interference of channel conditions make it very challenging to distinguish different devices in actual scenarios. The traditional closed set model cannot distinguish unknown devices and will usually misclassify them into known categories, thereby affecting the security and stability of the system.
[0003] To address the above problems, in recent years, some research works on open set identification have emerged. For example, the probability distribution based method (such as OpenMax) improves the open set identification ability by estimating the distribution of unknown categories in the post-processing stage. However, the performance of such methods in high-dimensional feature space is often limited, especially in the case of similar device hardware characteristics or complex channel conditions. In addition, the application of deep learning methods in RFF, such as convolutional neural networks (CNN) and long short-term memory networks (LSTM), although they can extract time or spatial features of signals, still have deficiencies in capturing weak hardware characteristic differences between devices. SUMMARY
[0004] Therefore, the purpose of the embodiments of the present application is to provide a radio frequency fingerprinting method based on a twin network and a negative prototype and related equipment to solve one or more technical problems existing in the prior art and provide at least one beneficial option or create conditions.
[0005] In one aspect, the embodiments of the present application provide a radio frequency fingerprinting method based on a twin network and a negative prototype, which comprises the following steps: Obtaining radio frequency signals of a to-be-identified category and radio frequency signals of a known category, and generating corresponding rotated constellation diagrams; forming a constellation diagram pair by combining the rotated constellation diagram of the to-be-identified category with the rotated constellation diagram of the known category, inputting the constellation diagram pair into a feature extraction model based on a twin network, processing the constellation diagram pair through two VGG16 networks in the twin network, and outputting a prototype vector of the known category and a feature vector of the to-be-identified category; the two VGG16 networks have the same structure and share parameters; calculating a Euclidean distance between the two feature vectors, determining a class attribute of the radio frequency signal to be identified based on the Euclidean distance and the adjusted dynamic rejection threshold, the class attribute being a known class or an unknown class.
[0006] Optionally, the generating the corresponding rotating constellation diagram based on the radio frequency signal comprises: acquiring a radio frequency signal, and pre-processing the radio frequency signal to obtain a group of subcarriers; the pre-processing comprises energy detection, position detection of short and long preambles, symbol alignment, time-frequency domain conversion, and subcarrier equalization; extracting IQ points of all subcarriers from a Data field of each frame of the radio frequency signal, and drawing the extracted IQ points on a complex plane according to an increasing radius to generate a rotating constellation diagram corresponding to the radio frequency signal; wherein the Data field contains a plurality of symbols, each symbol contains a group of subcarriers, and each subcarrier corresponds to an IQ point, which is a complex data point composed of an in-phase component and a quadrature component of the subcarrier of the radio frequency signal in the frequency domain.
[0007] Optionally, the adjusted dynamic rejection threshold is obtained by the following method: constructing a data set containing a plurality of samples of known classes, a plurality of samples of pseudo-unknown classes, and a plurality of samples of real unknown classes; the samples of known classes contain the same number of positive samples and negative samples; the positive sample pairs are formed by combining radio frequency data of each radio frequency device in pairs, and the negative sample pairs are formed by combining radio frequency data of different radio frequency devices in pairs; constructing a twin network, inputting the data set into the twin network for training to obtain a feature extraction model; extracting prototype vectors of the known classes by using the feature extraction model, and forming a known class prototype set, and generating a negative prototype representing an unknown class feature mode based on the known class prototype set; setting a dynamic rejection threshold based on distances between feature vectors of the samples of real unknown classes and the negative prototype, and determining a class attribute of the sample to be identified based on the dynamic rejection threshold, the class attribute being a known class or an unknown class; adjusting the dynamic rejection threshold according to the class attribute of the sample until a loss value converges to a predetermined threshold to obtain an adjusted dynamic rejection threshold; the loss value is determined based on distances between the sample and the prototype vector and distances between the sample and the negative prototype vector.
[0008] Optionally, the constructing the twin network, inputting the constellation diagram pair into the twin network for training to obtain the feature extraction model comprises: constructing two VGG16 networks in the twin network, inputting the constellation diagram pair into the twin network to obtain feature vectors output by the two VGG16 networks respectively; Euclidean distance of the two feature vectors is calculated, the twin network is iteratively trained using a cross-entropy loss function, and the cross-entropy loss is minimized to obtain the feature extraction model.
[0009] Optionally, the prototype vectors of the known categories are extracted using the feature extraction model, and a known category prototype set is formed, and a negative prototype representing the feature mode of the unknown category is generated based on the known category prototype set, including: The prototype vectors of the known categories are extracted using the feature extraction model, and a known category prototype set is formed; The attention weight matrix between each prototype vector in the known category prototype set is calculated using the self-attention mechanism of the Transformer, and the attention weight matrix is normalized by the Softmax function to obtain a weighted prototype set; The mean of the weighted prototype set is calculated, and a nonlinear transformation is performed on it by a multilayer perceptron to generate a negative prototype, which represents the feature mode of the unknown category.
[0010] Optionally, the dynamic rejection threshold is adjusted according to the category attribute of the sample until the loss value converges to a predetermined threshold to obtain an adjusted dynamic rejection threshold, including: The dynamic rejection threshold is set based on the distance between the feature vector of the to-be-identified sample and the negative prototype, and the category attribute of the to-be-identified sample is determined based on the dynamic rejection threshold, the category attribute being a known category or an unknown category; The loss value is calculated by the rejection loss function based on the distance between the sample and the prototype vector and the distance between the sample and the negative prototype vector; In a case where the loss value is higher than a predetermined loss threshold, the dynamic rejection threshold is adjusted according to the category attribute of the sample, so that the distance between the sample of the known category and the prototype vector becomes closer and closer, and the distance between the sample of the unknown category and the prototype vector becomes farther and farther, until the newly determined loss value converges to the predetermined loss threshold, and an adjusted dynamic rejection threshold is obtained.
[0011] Optionally, the rejection loss function is defined as follows:
[0012] wherein, is a boundary optimization loss, is a boundary optimization parameter, used to dynamically adjust the weight distribution of the distance between the known category and the unknown category in the rejection loss function, is a sample index, is the total number of samples, and represent the prototype vector and the negative prototype vector, respectively, is the distance between the sample i and the prototype vector, is the distance from sample i to the negative prototype vector.
[0013] In another aspect, the embodiments of the present application provide a radio frequency fingerprint identification device based on a twin network and a negative prototype, comprising: A first module is configured to acquire radio frequency signals of a to-be-identified category and radio frequency signals of a known category, and generate corresponding rotated constellation diagrams. A second module is configured to form a constellation diagram pair by using the rotated constellation diagram of the to-be-identified category and the rotated constellation diagram of the known category, input the constellation diagram pair into a feature extraction model based on a twin network, process the constellation diagram pair by using two VGG16 networks in the twin network, and output a prototype vector of the known category and a feature vector of the to-be-identified category; the two VGG16 networks have the same structure and share parameters. A third module is configured to calculate the Euclidean distance between the two feature vectors, determine the category attribute of the radio frequency signal of the to-be-identified category based on the Euclidean distance and an adjusted dynamic rejection threshold, and the category attribute is a known category or an unknown category.
[0014] In another aspect, the embodiments of the present application provide a radio frequency fingerprint identification system based on a twin network and a negative prototype, comprising: At least one processor; At least one memory configured to store at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0015] In another aspect, the embodiments of the present application provide a computer readable storage medium, which stores a processor executable program, and the processor executable program is used to execute the above method when executed by a processor.
[0016] The embodiments of the present application have the following beneficial effects: the present application provides a radio frequency fingerprint identification method and related equipment based on a twin network and a negative prototype, The present application relates to the technical field of vehicles, in particular to a radio frequency fingerprint identification method and related equipment based on a twin network and a negative prototype. The present application forms a constellation diagram pair by using the rotated constellation diagram of the to-be-identified category and the rotated constellation diagram of the known category, and inputs the constellation diagram pair into a feature extraction model based on a twin network. The model uses two VGG16 networks with the same structure and sharing parameters to process the constellation diagram pair. Through the design of sharing parameters, the subtle hardware feature differences contained in the rotated constellation diagram of the radio frequency signal can be effectively extracted, and the prototype vector of the known category and the feature vector of the to-be-identified category are output. Then, the Euclidean distance between the two feature vectors is calculated, and the known category and the unknown category are accurately distinguished by combining the adjusted dynamic rejection threshold, which significantly improves the identification accuracy and reliability in the open set identification scene. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a step flow diagram of a radio frequency fingerprint identification method based on a twin network and a negative prototype provided by an embodiment of the present application; Figure 2 is a schematic diagram of a rotating constellation in an embodiment of the present application; Figure 3 is a rotating constellation of different radio frequency devices under the same receiving distance in an embodiment of the present application; Figure 4 is a rotating constellation of the same radio frequency device under different receiving distances in an embodiment of the present application; Figure 5 is a structural block diagram of a twin network in an embodiment of the present application; Figure 6 is a specific architecture diagram of a twin network in an embodiment of the present application; Figure 7 is a structural block diagram of a radio frequency fingerprint identification device based on a twin network and a negative prototype provided by an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0019] It should be noted that although the module division is made in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0021] In addition, the described features, structures or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to give a sufficient understanding of the embodiments of the present application. However, one skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be used. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid obscuring the aspects of the present application.
[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0023] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0024] The technical terms used in this application will be explained below: Radio frequency fingerprinting (RF fingerprinting) is a technology that uses unique "hardware characteristics" left at the physical layer when wireless devices (such as Wi-Fi routers, mobile phones, and IoT devices) transmit signals to uniquely identify the device. Minor differences (process variations) in the manufacturing process of electronic components (such as oscillators, power amplifiers, and filters) will give the transmitted signal unique characteristics such as noise, phase shift, frequency shift, and modulation distortion. These characteristics are inherent "defects" in the hardware and cannot be modified or reset by software (unlike MAC addresses / IP addresses), thus possessing strong anti-counterfeiting capabilities.
[0025] Siamese networks are a deep learning architecture characterized by using two or more structurally identical, parameter-shared sub-networks to solve tasks requiring "relationship determination" by comparing the similarity of input samples. Two input samples are fed into two structurally identical networks, which share weight parameters. The feature vectors output by the networks are then used to calculate similarity using distance functions (such as Euclidean distance or cosine similarity). For tasks with few samples or requiring relationship determination (such as determining whether two faces belong to the same person), directly using classification networks is inefficient. Siamese networks focus on learning "similarity and difference."
[0026] Rotated Constellation Figure (RCF) is a method of converting the I / Q (in-phase / quadrature) data of radio frequency signals into a two-dimensional image representation with rotation invariance.
[0027] like Figure 1 As shown, Figure 1 A radio frequency fingerprinting method based on Siamese networks and negative prototypes is provided in this application embodiment. The method includes the following steps: S100: Acquire the radio frequency signal of the category to be identified and the radio frequency signal of the known category, and generate the corresponding rotating constellation diagram; S200, forming a constellation pair by taking the rotating constellation of the to-be-identified category and the rotating constellation of the known category, inputting the constellation pair into a feature extraction model based on a twin network, processing the constellation pair through two VGG16 networks in the twin network, and outputting a prototype vector of the known category and a feature vector of the to-be-identified category; the two VGG16 networks are of the same structure and share parameters; S300, calculating the Euclidean distance between the two feature vectors, determining the category attribute of the radio frequency signal of the to-be-identified category based on the Euclidean distance and the adjusted dynamic rejection threshold, the category attribute being a known category or an unknown category.
[0028] In the steps S100 to S300 shown in the embodiments of the present application, the original I / Q data is mapped to a two-dimensional image feature with rotation invariance through rotating constellation conversion of the radio frequency signal, the signal distortion information caused by the device hardware difference is effectively retained, and the interference of channel fading and noise on the feature stability is reduced. In the feature extraction stage, the twin network processes the rotating constellations of the to-be-identified and known categories through two parameter-shared VGG16 sub-networks, the learning of subtle feature differences is strengthened by using the shared weight mechanism, and the output prototype vector and feature vector can accurately depict the unique radio frequency fingerprint of the device. The calculation of the dynamic rejection threshold combines the modeling of the category boundary by the negative prototype, adjusts the judgment threshold of the Euclidean distance in real time through the distance distribution of the negative prototype vector and the prototype vector of the known category, and determines that it is an unknown device when the distance between the to-be-identified feature vector and all known prototypes exceeds the dynamic threshold, thereby realizing adaptive classification and rejection decision in an open set scenario.
[0029] The present application realizes high-precision identification of known devices and accurate detection of unknown devices in an open set scenario through rotating constellation representation, twin network feature extraction, and dynamic threshold rejection mechanism driven by negative prototypes. It effectively deals with the challenges of device similarity, signal interference, and unknown categories, and significantly improves the identification robustness and security. The fixed threshold method in the related art is difficult to adapt to the complexity of the open set scenario due to static setting, often leading to misjudgment of unknown devices as known categories. However, the dynamic threshold of the present application models the category relationship by using negative prototypes, optimizes the detection boundary in real time, and compared with the traditional fixed threshold method, the dynamic threshold mechanism adjusts the rejection boundary adaptively through negative prototypes, can dynamically distinguish known and unknown devices according to signal variation and device characteristics, and significantly reduces the misclassification rate.
[0030] In some embodiments, the generating a corresponding rotating constellation based on the radio frequency signal comprises: S110, acquiring a radio frequency signal, and pre-processing the radio frequency signal to obtain a group of subcarriers; the pre-processing includes energy detection, position detection of short and long preambles, symbol alignment, time-frequency domain conversion, and subcarrier equalization; S120, extract the IQ points of all subcarriers from the Data field of each frame of the radio frequency signal, and draw the extracted IQ points on the complex plane with an increasing radius to generate a rotating constellation diagram corresponding to the radio frequency signal; wherein, the Data field contains multiple symbols, each symbol contains a set of subcarriers; each subcarrier corresponds to an IQ point, and the IQ point is a complex data point composed of the in-phase component and the quadrature component corresponding to the subcarrier in the frequency domain of the radio frequency signal.
[0031] like Figure 2 As shown, in this embodiment, the process of generating the Rotating Constellation Chart (RCF) is as follows: Step 1-1: Preprocess the received RF signal, including energy detection, short preamble detection, symbol alignment, FFT, and subcarrier equalization. Coarse correction, fine correction, and pilot correction steps are not performed during this step.
[0032] Specifically, the expressions of the acquired signals are shown in formulas (1)-(3): ; ; ; in, Let I(i) represent the complex form of the i-th received symbol, where I(i) is the in-phase component, Q(i) is the quadrature component, A is the signal amplitude, ω is the angular frequency, and Δt is the sampling interval. For the initial phase, , These represent the serial number and the imaginary unit, respectively.
[0033] Energy detection filters out the portion of the signal whose real part is greater than a set threshold, as shown in formula (4): ; in, represents the real part of the signal, and threshold represents the preset energy detection threshold.
[0034] The positions of the short and long preambles can be obtained by calculating the autocorrelation and cross-correlation using formulas (5) and (6), respectively:
[0035]
[0036] in, Let N represent the autocorrelation at position i, and N be the signal length. For the i-th symbol, This is a signal that lags behind by 16 symbols; This represents the cross-correlation at position i. is the accumulated number of times in the cross-correlation calculation, is the locally stored long preamble sequence, is the i+kth symbol of the received signal.
[0037] According to the autocorrelation degree and the cross-correlation degree , the starting positions of the short preamble and the long preamble in the signal can be determined respectively. Specifically, when the autocorrelation degree reaches the preset autocorrelation threshold, it is determined that the position is the starting point of the short preamble; similarly, when the cross-correlation degree exceeds the set cross-correlation threshold, the corresponding position is the starting position of the long preamble. By accurately identifying the preamble position, the synchronization of the signal frame structure can be realized, laying a foundation for subsequent symbol extraction and processing. After completing the preamble detection, the symbol alignment operation is performed to ensure that the extracted symbol sequence is accurately matched with the standard symbol period, reducing the constellation point position error caused by time offset.
[0038] Next, the FFT operation of formula (7) is performed to convert the signal from the time domain to the frequency domain:
[0039] wherein, is the kth subcarrier signal in the frequency domain, is the symbol sequence after preprocessing in the time domain, m is the time domain sampling point index, and k is the subcarrier index.
[0040] Then, the channel gain (H[i]) is calculated and the above is normalized to according to the polarity L[i] of the LTS sequence, as shown in formulas (8)-(10):
[0041] wherein, is the channel gain of the ith subcarrier, , are the ith subcarrier signals of the first and second LTSs (Long Training Sequences) respectively, and L[i] is the polarity parameter of the LTS sequence.
[0042] The polarity parameter takes the value of ±1 and is used to distinguish between the two LTS sequences, to correct the polarity of the frequency domain signal and ensure the phase consistency of different subcarrier signals. Through the above preprocessing steps, channel distortion, noise interference and time offset in the signal transmission process can be effectively eliminated, providing high-quality I / Q data basis for the generation of the rotated constellation diagram.
[0043]
[0044] (9);
[0045] wherein, is the i-th subcarrier in frequency domain, is the i-th subcarrier after equalization.
[0046] After the above preprocessing steps, the in-phase component I(i) and the quadrature component Q(i) of the equalized signal are extracted and mapped to the complex plane to obtain the constellation point S(i)=I(i)+jQ(i), as shown in equation (1).
[0047] Step 1-2, taking WiFi signal as an example, the IQ points of all subcarriers are extracted from the Data field of each frame of WiFi signal and stored in array y in turn; wherein the Data field contains multiple symbols, each symbol contains multiple subcarriers, and each subcarrier corresponds to an IQ point in complex form. The IQ point of the subcarrier refers to the complex data point composed of the in-phase component and the quadrature component of the subcarrier of the WiFi signal in the frequency domain.
[0048] Specifically, after completing the FFT transform and subcarrier equalization, the Data field contains multiple symbols, each symbol is composed of multiple subcarriers (such as 52 subcarriers of -26 to -1, 1 to 26 in IEEE802.11n protocol), and each subcarrier corresponds to an IQ point in complex form, which is expressed as y[i]=I[i]+jQ[i], wherein i is the subcarrier index. These IQ points directly reflect the physical layer characteristics of the signal after modulation and channel transmission. By traversing the symbol sequence of the Data field, the I component and the Q component of each subcarrier are extracted in turn according to the subcarrier index order, combined into a complex form and stored in array y to form the original IQ data set. Each element in the array y contains the amplitude and phase information of the corresponding subcarrier signal, providing basic data support for the generation of the rotated constellation diagram. By extracting the IQ points of the Data field, the interference of non-data parts such as the preamble can be excluded, and the effective signal components carrying the device hardware fingerprint can be focused on. The length of the array y is determined by the number of symbols in the Data field and the number of effective subcarriers contained in each symbol, ensuring that the key feature information in the signal transmission process can be completely covered.
[0049] Step 1-3, the extracted IQ points are plotted on the complex plane according to the increasing radius to generate a rotated constellation diagram (RCF).
[0050] Each drawn point is the coordinate of the current IQ point multiplied by the square of its corresponding array index. Each frame of signal corresponds to an image containing 5520 IQ points. The drawing points for each IQ point are shown in formula (11):
[0051] in, Let represent the coordinates of the IQ point after rotation, and i be the index of the IQ point in the array y.
[0052] Figure 3 This is a rotating constellation diagram for different devices at the same receiving distance. Figure 3 In this context, (a), (b), and (c) represent different radio frequency devices. Figure 4 RCF for the same device at different receiving distances. Figure 4 (d) is the constellation diagram at 2ft; (e) is the RCF at 26ft; (f) is the RCF at 50ft.
[0053] from Figure 3 and Figure 4 As can be seen, by multiplying the coordinates of each IQ point by the square of its index, the distribution on the complex plane is achieved according to an increasing radius. This results in IQ points at different positions exhibiting a layered structure from the inside out in the rotating constellation diagram, effectively distinguishing the signal features corresponding to different indices. This enhances the constellation diagram's ability to represent the sequence order of signals. Furthermore, the increasing radius design avoids overlap of IQ points with different indices on the complex plane, improving the accuracy of subsequent feature extraction. After the above processing, each frame of signal generates a rotating constellation diagram containing 5520 IQ points. The position of each point retains both the amplitude and phase information of the original I / Q components and incorporates the sequence features corresponding to the index, providing rich input data dimensions for the Siamese network based on the VGG16 network.
[0054] refer to Figure 5 and Figure 6 In some embodiments, the adjusted dynamic rejection threshold is obtained in the following way: S201, construct a dataset containing samples of multiple known categories, multiple samples of multiple pseudo-unknown categories, and multiple samples of multiple truly unknown categories; the samples of the known categories contain the same number of positive samples and negative samples; the positive sample pairs are combinations of radio frequency data within each radio frequency device, and the negative sample pairs are combinations of radio frequency data from different radio frequency devices. S202, Construct a Siamese network, input the dataset into the Siamese network for training, and obtain a feature extraction model; S203, use a feature extraction model to extract prototype vectors of known categories and form a set of known category prototypes, and generate a negative prototype representing the feature pattern of unknown categories based on the set of known category prototypes; S204, set a dynamic rejection threshold based on the distance between the feature vector of the sample of the true unknown category and the negative prototype, and determine the category attribute of the sample to be identified based on the dynamic rejection threshold, wherein the category attribute is a known category or an unknown category; S205, adjust the dynamic rejection threshold according to the category attribute of the sample until the loss value converges to the predetermined threshold to obtain the adjusted dynamic rejection threshold; the loss value is determined based on the distance from the sample to the prototype vector and the distance from the sample to the negative prototype vector.
[0055] In this embodiment, the construction of positive and negative samples ensures that the training data covers both the internal differences of similar devices and the category differences between different devices, laying the foundation for the Siamese network to learn effective distinguishing features. During the dataset construction phase, positive sample pairs are formed by combining radio frequency signals collected by the same radio frequency device at different times and under different environments to simulate the subtle changes in the device itself in real-world applications; negative sample pairs are formed by combining radio frequency signals from different radio frequency devices in pairs, fully reflecting the hardware feature differences between devices. After converting these sample pairs into corresponding constellation diagram pairs, they form the input data required for model training. The constructed Siamese network uses two VGG16 networks with identical structures and shared parameters as feature extraction branches. Through the parameter sharing mechanism, the network can learn the common feature representations of the input constellation diagram pairs, enhancing its ability to capture the similarity of similar samples and the differences between dissimilar samples. Based on the feature extraction model, prototype vectors of known categories are extracted. These prototype vectors are the central representations of the features of all samples in that category, effectively representing the overall feature patterns of the known category. Simultaneously, negative prototypes are generated based on the known category prototype set. These negative prototypes serve as virtual representatives of unknown categories in the feature space. By comprehensively considering the distribution characteristics of known category prototypes, a reference benchmark capable of covering the feature regions of potential unknown categories is constructed. Setting and adjusting the dynamic rejection threshold is a crucial step in achieving open set recognition. It dynamically changes based on the distance between the feature vector of the sample to be identified and the negative prototype. When the distance between the sample to be identified and all known category prototypes is greater than the dynamic rejection threshold, it is determined to be an unknown category, thus effectively rejecting unknown devices. The loss function design comprehensively considers the distance from the sample to its own category prototype vector (bringing closer to similar categories) and the distance from the sample to the negative prototype vector (pushing away the distance from unknown categories to prototype vectors). This dual constraint guides the network to learn more discriminative features. During training, the dynamic rejection threshold is continuously adjusted based on the feedback of the sample's category attributes until the network loss value converges to the predetermined threshold, ensuring that the model achieves an optimal balance between the accuracy of known category recognition and the rejection rate of unknown categories. Finally, the overall performance of the model is verified by calculating evaluation metrics such as accuracy, precision, recall, and F1 score on independent test sets. Training is stopped and the final Siamese network model is determined only when all evaluation metrics meet the preset requirements, so as to ensure its reliability and effectiveness in real-world application scenarios.
[0056] In some embodiments, constructing a Siamese network, training the constellation graph on the input Siamese network to obtain a feature extraction model, includes: S221, Construct two VGG16 networks in the Siamese network, input the constellation diagram pair into the Siamese network, and obtain the feature vectors output by the two VGG16 networks respectively; S222: Calculate the Euclidean distance between two feature vectors, use the cross-entropy loss function to iteratively train the Siamese network, minimize the cross-entropy loss, and obtain the feature extraction model.
[0057] Specifically, the process of training the feature extraction model is as follows: Step 2-1: Embed a VGG16 network with shared parameters in the twin network. The rotated constellation diagram of the WiFi signal is represented as a two-dimensional matrix X∈R. H×W The above constellation diagram is input into the two branches of the Siamese network. Through multiple convolution and pooling operations, the input rotated constellation diagram is gradually transformed into lower-dimensional feature vectors fleft(X) and fright(X).
[0058] Step 2-2: Compare the Euclidean distance between feature vectors fleft(X) and fright(X) using the similarity measurement module to complete the feature matching and classification task. The calculation formula (12) is as follows:
[0059] Steps 2-3: Optimize the Siamese network using the cross-entropy loss function to minimize the difference between the predicted results and the true labels. Through training, features of the same category are clustered in the feature space, while features of different categories gradually become more separated. The cross-entropy loss is calculated as shown in formula (13):
[0060] in, Indicates the loss value. This represents the true label (0 or 1) of the i-th sample. The similarity score represents the probability that the i-th sample is predicted to be of the positive class (class 1).
[0061] After iteratively minimizing the loss, a feature extraction model with feature extraction capabilities is trained and used to calculate the prototype vectors of all known categories.
[0062] Steps 2-4: After model training is complete, use an independent test set to comprehensively evaluate its performance, calculating evaluation metrics such as accuracy, precision, recall, false positive rate, and F1 score. Once the evaluation metrics meet the requirements, stop training the Siamese network to obtain the trained Siamese network, which serves as the feature extraction model. The 16 devices used in the experiment were divided into the following three categories to construct constellation diagram pairs, which served as model inputs: Known categories: Eight devices are included. 80% of the samples from each category's rotating constellation diagrams form the training set for the Siamese network, while the remaining 20% of samples, along with samples from the truly unknown categories, form the test set for the second model. To train the Siamese network, we constructed a dataset containing both positive and negative samples. Positive samples are generated from within each of the eight categories, with each positive sample pair consisting of two different rotating constellation diagrams from the same category, and all constellation diagram pairs are unique. Negative samples are generated through permutations and combinations of the eight categories, resulting in 28 different category combinations. To ensure data balance, we maintain a consistent number of negative sample combinations and ensure a 1:1 ratio of positive to negative samples as input. This design guarantees a balanced distribution of positive and negative samples during training, thereby improving the model's discriminative ability. The generated constellation diagram pairs are in the form of... ,in, and A pair of rotating constellation diagrams, This indicates whether the constellation pair belongs to the same category (0 indicates the same category, 1 indicates a different category).
[0063] Pseudo-unknown categories: This includes four devices used to train the model's ability to reject unknown categories. All rotating constellation diagram samples from each category are used as the training set for the second model.
[0064] True Unknown Category: Includes 4 devices used to test the final performance of the model. 40% of the samples from each class's rotating constellation diagram are used as the test set.
[0065] This partitioning design fully considers the dual needs of open set recognition: accurate classification of known categories and effective rejection of unknown categories. By rationally allocating training and testing data and constructing a balanced mix of positive and negative sample pairs, the dataset provides the model with diverse feature representations, adapting to the challenges of device similarity and signal interference in complex scenarios. Furthermore, the introduction of pseudo-unknown categories enhances the model's sensitivity to unknown devices, while test data with truly unknown categories validates the framework's generalization ability in open set environments, laying a solid foundation for achieving high-precision recognition and robust detection.
[0066] In some embodiments, the step of extracting prototype vectors of known categories using a feature extraction model and forming a set of known category prototypes, and generating a negative prototype representing the feature pattern of unknown categories based on the set of known category prototypes, includes: S231, use the feature extraction model to extract the prototype vectors of known categories to form a prototype set of known categories; S232, use the self-attention mechanism of Transformer to calculate the attention weight matrix between each prototype vector in the known category prototype set, and normalize the attention weight matrix by the Softmax function to obtain the weighted prototype set. S233, calculate the mean of the weighted prototype set, and perform a nonlinear transformation on it using a multilayer perceptron to generate a negative prototype, which represents the feature pattern of an unknown category.
[0067] Specifically, the process of generating the negative prototype is as follows; Step 3-1: Use the trained feature extraction model to extract prototype vectors of known categories, forming a prototype set of known categories. , .
[0068] It should be noted that "known category" refers to the radio frequency device category that has been explicitly labeled in the open set identification scenario. Each known category corresponds to a unique prototype vector, which comprehensively reflects the core features of the radio frequency fingerprint of that category of devices. The prototype vector of a known category can be obtained by averaging the feature vectors of all training samples of the known category. By aggregating the common features of devices of the same type, a baseline feature representation at the category level is formed, providing a basic reference for the subsequent construction of negative prototypes.
[0069] Step 3-2: Calculate the attention weight matrix between known class prototype sets using the Transformer's self-attention mechanism. , The attention weight matrix is normalized using the Softmax function to obtain a weighted prototype set. Capture the feature differences between categories, where each Relationships for other categories were modeled. Equations (14) and (15) demonstrate how the attention weight matrix and the weighted attention weight matrix are calculated:
[0070]
[0071] in, This represents the attention weight matrix among known category prototype sets.
[0072] Step 3-3: Calculate the mean of the weighted prototype set. The negative prototype p- is generated by nonlinearly transforming the data using a multilayer perceptron (MLP), representing the feature patterns of the unknown category. The negative prototype enhances the model's ability to detect unknown devices by modeling known category relationships, providing an innovative mechanism for open set recognition. As shown in formula (16):
[0073] in, , , It is a trainable feature mapping matrix that performs different linear transformations on a known set of class prototypes. d is the feature dimension of the prototype vector, used for scaling to balance the range of attention weights; σ(·) represents the Softmax function, which normalizes each row of the matrix to ensure that the sum of the attention weights is 1; fn(·) is a multilayer perceptron (MLP) used to calculate the mean of the weighted prototype set. A nonlinear transformation is performed to generate the negative prototype p-.
[0074] In some embodiments, adjusting the dynamic rejection threshold according to the category attribute of the sample until the loss value converges to a predetermined threshold to obtain the adjusted dynamic rejection threshold includes: S251, a dynamic rejection threshold is set based on the distance between the feature vector of the sample to be identified and the negative prototype, and the category attribute of the sample to be identified is determined based on the dynamic rejection threshold, wherein the category attribute is a known category or an unknown category; S252, the loss value is calculated by using the rejection loss function to calculate the distance from the sample to the prototype vector and the distance from the sample to the negative prototype vector; S253, when it is determined that the loss value is higher than the predetermined loss threshold, the dynamic rejection threshold is adjusted according to the category attribute of the sample so that the distance between the known category sample and the prototype vector becomes closer and closer, and the distance between the unknown category sample and the prototype vector becomes farther and farther, until the redetermined loss value converges to the predetermined loss threshold, and the adjusted dynamic rejection threshold is obtained.
[0075] Specifically, the process of dynamically calculating the boundary is as follows; Step 4-1: After the feature vector f(q) of the sample to be identified q is extracted, calculate its distance to the negative prototype p-, and set the dynamic rejection threshold according to formula (17). .
[0076]
[0077] in, It is a distance calculation function used to quantify the relationship between the feature vector f(q) and the negative prototype p-.
[0078] Step 4-2: If the distance from sample q to all known class prototype vectors is less than the dynamic rejection threshold... If the sample is not found to be a known category, it is rejected and classified as an unknown category. This is illustrated in formula (18).
[0079] in, Representing sample features With the Prototype vectors of known categories The distance to all known class prototypes. If the distance of sample q to all known class prototypes is greater than the dynamic rejection threshold. If the condition is met, the sample is rejected and classified as an unknown category. Otherwise, the sample is classified as a known category.
[0080] Step 4-3: Optimize the dynamic rejection threshold using a custom rejection loss function. During training, the distance between the known class and the prototype vector gets closer and closer, while the distance between the unknown class and the prototype vector gets farther and farther (i.e., the distance between the unknown class and the negative prototype vector gets closer and closer), ensuring the robustness of the model in open set environments.
[0081] In some embodiments, the rejection loss function is defined as follows:
[0082] in, Optimize the loss at the boundary. These are boundary optimization parameters used to dynamically adjust the weight allocation of the distance between the known and unknown classes in the rejection loss function. For sample index, The total number of samples, and These represent the prototype vector and the negative prototype vector, respectively. It is the distance from sample i to the prototype vector. It is the distance from sample i to the negative prototype vector.
[0083] By minimizing the squared difference between the distance from known class samples to the prototype vector and the target value, and the squared difference between the distance from unknown class samples to the negative prototype vector and the target value, precise control of the dynamic rejection threshold is achieved. During training, the model adjusts the dynamic rejection threshold based on the class attribute (known or unknown) of the samples, ensuring that known class samples cluster around their prototype vectors as much as possible, while pushing unknown class samples away from the negative prototype vector. This effectively distinguishes known and unknown devices in open set recognition scenarios, reducing the risk of misclassification.
[0084] To comprehensively evaluate the model's performance in open-set recognition tasks, a series of classification performance metrics were employed. These metrics include both classification accuracy for known classes (KKC) and rejection ability for unknown classes (UUC), effectively reflecting the model's practical application performance. For ease of description, samples belonging to the KKC are defined as positive samples, and samples belonging to the UUC are defined as negative samples. The basic metrics are defined as follows: TP represents the number of correctly predicted positive instances, FP represents the number of incorrectly predicted negative instances, TN represents the number of correctly predicted negative instances, and FN represents the number of incorrectly predicted negative instances.
[0085] Compared with related technologies, this application has the following advantages: This application proposes an open-set radio frequency fingerprint recognition framework based on twin networks, which has significant technical advantages and application value in terms of functionality, performance, and security. The beneficial effects of this application are elaborated in detail below from three aspects: functional enhancement, performance optimization, and security assurance. 1. Functionality Enhancement: Efficient Open Set Identification and Dynamic Rejection Mechanism (1) To address the challenge of existing RF fingerprinting methods failing to effectively handle unknown devices in open-set environments, this application proposes an innovative dynamic rejection mechanism. By introducing negative prototype generation and adaptive rejection boundary design, this mechanism can dynamically determine whether the input signal originates from an unknown device, thereby avoiding the problem of mistakenly classifying unknown categories as known categories. Compared with traditional fixed threshold methods, the method in this application significantly improves the recognition accuracy in open-set environments, especially when the number of devices increases significantly or the hardware characteristics are highly similar.
[0086] (2) By generating and applying the Rotating Constellation Graph (RCF), this application transforms the processing of the original radio frequency signal from frequency domain features to image features, thereby making full use of mature models in the field of computer vision for feature extraction and classification. The Rotating Constellation Graph can more intuitively express the hardware differences between devices, while reducing the impact of signal noise and channel interference on the recognition results.
[0087] (3) This application designs a feature extraction and matching framework based on Siamese networks, which extracts deep features of signals through an embedded network with shared parameters. The Siamese network utilizes the similarity measure between input signal pairs to further enhance the recognition accuracy. Especially when the hardware characteristics of radio frequency signals are relatively similar, the network can significantly widen the distance between features of different categories by optimizing the loss function, thereby achieving accurate recognition of known categories.
[0088] (4) The introduction of negative prototypes effectively expands the ability of open set recognition. By combining the self-attention mechanism of Transformer to generate negative prototypes, this application achieves more accurate unknown category detection. The dynamically adjusted rejection mechanism ensures the robustness of the model when dealing with unknown devices, while maintaining efficiency and stability in the recognition task of known categories.
[0089] 2. Performance Optimization: Precision, Efficiency, and Low Resource Consumption (1) This application significantly improves the computational efficiency and resource utilization of radio frequency fingerprint recognition. By preprocessing the rotating constellation diagram, the complex signal processing process is simplified into an efficient image feature extraction task, reducing the computational resources and time costs required for traditional radio frequency signal analysis.
[0090] (2) This application demonstrates excellent scalability when processing large-scale datasets. The design of the Siamese network enables the model to effectively distinguish individual devices in a high-dimensional feature space while maintaining low memory usage and computational overhead. Especially in scenarios that require real-time processing of massive radio frequency signals, the framework of this application can complete the device identification task with low latency, providing efficient support for IoT and wireless communication systems.
[0091] (3) To address the issue of device similarity in radio frequency signals, this application uses a constellation diagram to visualize hardware characteristics. Furthermore, the feature matching mechanism in the twin network can further enhance the ability to capture subtle hardware differences, thereby improving the recognition accuracy of data collected at line-of-sight distances by 15% to 25% compared to existing methods.
[0092] 3. Security Guarantee: Enhanced robustness and anti-counterfeiting capabilities. (1) Recognition security in open set environments is a key focus of this application. This application ensures reliable detection of unknown devices through a dynamic rejection mechanism, effectively preventing spoofing attacks of unknown categories. Experimental results show that the model achieves a detection accuracy of over 90% in open set scenarios, significantly reducing security risks caused by misclassification in open scenarios.
[0093] (2) The introduction of negative prototypes eliminates the possibility of forging labels for known categories from the mechanism design. By dynamically generating negative prototypes through the self-attention mechanism, this application ensures the randomness and uniqueness of each feature matching task, thereby preventing attackers from using historical data to forge or deceive the model.
[0094] (3) For signal forgery and deception attacks, this application further enhances the anti-counterfeiting capability of the system through a strict verification mechanism in the feature extraction and matching process. By optimizing the similarity measurement between features, the twin network makes it difficult for attackers to pass the model's classification and verification even if they attempt to forge hardware features, thereby improving the robustness and credibility of the overall system.
[0095] 4. Overall Value: Technological Innovation and Application Prospects This application technically achieves a shift from traditional closed-set identification to open-set radio frequency fingerprinting, significantly improving the accuracy and efficiency of device identification and proposing innovative solutions in model design and rejection mechanisms. This framework is applicable to multiple fields such as IoT security, wireless communication, and spectrum management, effectively solving the challenges of device authentication and identification in open scenarios.
[0096] refer to Figure 7 This application also provides a radio frequency fingerprint recognition device based on twin networks and negative prototypes, including: The first module is used to acquire the radio frequency signals of the category to be identified and the radio frequency signals of the known categories, and generate the corresponding rotating constellation diagram; The second module is used to form a constellation pair by combining the rotated constellation diagram of the category to be identified with the rotated constellation diagram of the known category. The constellation pair is then input into a feature extraction model based on a Siamese network. The constellation pair is processed by two VGG16 networks in the Siamese network to output the prototype vector of the known category and the feature vector of the category to be identified. The two VGG16 networks have the same structure and share parameters. The third module is used to calculate the Euclidean distance between the two feature vectors, and to determine the category attribute of the radio frequency signal to be identified based on the Euclidean distance and the adjusted dynamic rejection threshold. The category attribute is either a known category or an unknown category.
[0097] This application also provides a radio frequency fingerprint recognition system based on twin networks and negative prototypes, including a memory, a processor, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the method of the above embodiments.
[0098] Taking the example of a processor and memory in a vehicle controller being connected via a bus, the memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the control processor, and these remote memories can be connected to the control device via a network.
[0099] The non-transitory software program and instructions required to implement the methods of the above embodiments are stored in memory and executed by the processor to perform the methods of the above embodiments.
[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0101] This application also provides a vehicle, including the vehicle control device described in the above embodiments.
[0102] The vehicle can be a private car, such as a sedan, SUV, MPV, or pickup truck. It can also be a commercial vehicle, such as a van, bus, small truck, or large semi-trailer. The vehicle must have an electric motor capable of outputting power or acting as a generator to store mechanical energy. When the vehicle is a new energy vehicle, it can be a hybrid or a pure electric vehicle.
[0103] Since the vehicle applies all the technical solutions of the above-mentioned control device or vehicle controller, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0104] Furthermore, one embodiment of this application provides a computer-readable storage medium storing computer-executable instructions for performing the methods described above.
[0105] It is worth noting that, since the computer-readable storage medium of this application embodiment can perform the methods of any of the above embodiments, the specific implementation and technical effects of the computer-readable storage medium of this application embodiment can be referred to the specific implementation and technical effects of the methods of any of the above embodiments.
[0106] Furthermore, one embodiment of this application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the computer device to perform the above-described method.
[0107] It is worth noting that, since the computer program product of this application embodiment can execute the methods of any of the above embodiments, the specific implementation methods and technical effects of the computer program product of this application embodiment can be referred to the specific implementation methods and technical effects of the methods of any of the above embodiments.
[0108] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0109] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
Claims
1. A radio frequency fingerprint recognition method based on Siamese networks and negative prototypes, characterized in that, The method includes: Acquire the radio frequency signals of the category to be identified and the radio frequency signals of the known categories, and generate the corresponding rotating constellation diagram; A constellation pair is formed by combining the rotated constellation diagram of the category to be identified with the rotated constellation diagram of the known category. The constellation pair is then input into a feature extraction model based on a Siamese network. The constellation pair is processed by two VGG16 networks in the Siamese network to output the prototype vector of the known category and the feature vector of the category to be identified. The two VGG16 networks have the same structure and share parameters. Calculate the Euclidean distance between the two feature vectors, and determine the category attribute of the radio frequency signal to be identified based on the Euclidean distance and the adjusted dynamic rejection threshold. The category attribute can be a known category or an unknown category.
2. The method according to claim 1, characterized in that, The step of generating a corresponding rotating constellation diagram based on the radio frequency signal includes: A radio frequency (RF) signal is acquired, and the RF signal is preprocessed to obtain a set of subcarriers; the preprocessing includes energy detection, short preamble and long preamble position detection, symbol alignment, time-frequency domain conversion and subcarrier equalization; The IQ points of all subcarriers are extracted from the Data field of each frame of the radio frequency signal. The extracted IQ points are plotted on the complex plane with increasing radii to generate a rotating constellation diagram corresponding to the radio frequency signal. The Data field contains multiple symbols, and each symbol contains a set of subcarriers. Each subcarrier corresponds to an IQ point, which is a complex data point composed of the in-phase component and the quadrature component corresponding to the subcarrier in the frequency domain of the radio frequency signal.
3. The method according to claim 1, characterized in that, The adjusted dynamic rejection threshold is obtained in the following way: A dataset is constructed, which contains samples of multiple known categories, samples of multiple pseudo-unknown categories, and samples of multiple truly unknown categories; the samples of the known categories contain the same number of positive samples and negative samples; the positive sample pairs are combinations of radio frequency data within each radio frequency device, and the negative sample pairs are combinations of radio frequency data from different radio frequency devices. Construct a Siamese network, input the dataset into the Siamese network for training, and obtain a feature extraction model; The prototype vectors of known categories are extracted using a feature extraction model, and a set of known category prototypes is formed. Based on the set of known category prototypes, a negative prototype representing the feature pattern of unknown categories is generated. A dynamic rejection threshold is set based on the distance between the feature vector of a sample of a true unknown category and its negative prototype. The category attribute of the sample to be identified is determined based on the dynamic rejection threshold. The category attribute can be a known category or an unknown category. The dynamic rejection threshold is adjusted according to the category attribute of the sample until the loss value converges to the predetermined threshold, thus obtaining the adjusted dynamic rejection threshold; the loss value is determined based on the distance from the sample to the prototype vector and the distance from the sample to the negative prototype vector.
4. The method according to claim 3, characterized in that, The construction of the Siamese network involves training the constellation graph into the input Siamese network to obtain a feature extraction model, including: Construct two VGG16 networks in the Siamese network, input the constellation diagram pair into the Siamese network, and obtain the feature vectors output by the two VGG16 networks respectively; Calculate the Euclidean distance between two feature vectors, iteratively train the Siamese network using the cross-entropy loss function, minimize the cross-entropy loss, and obtain the feature extraction model.
5. The method according to claim 3, characterized in that, The process of extracting prototype vectors of known categories using a feature extraction model and forming a known category prototype set, and generating a negative prototype representing the feature pattern of unknown categories based on the known category prototype set, includes: The prototype vectors of known categories are extracted using a feature extraction model to form a prototype set of known categories; The attention weight matrix between prototype vectors in the known category prototype set is calculated using the self-attention mechanism of Transformer. The attention weight matrix is then normalized using the Softmax function to obtain the weighted prototype set. The mean of the weighted prototype set is calculated and then nonlinearly transformed using a multilayer perceptron to generate a negative prototype, which represents the feature pattern of an unknown category.
6. The method according to claim 3, characterized in that, The step of adjusting the dynamic rejection threshold based on the category attribute of the sample until the loss value converges to a predetermined threshold to obtain the adjusted dynamic rejection threshold includes: A dynamic rejection threshold is set based on the distance between the feature vector of the sample to be identified and the negative prototype. The category attribute of the sample to be identified is then determined based on the dynamic rejection threshold. The category attribute can be a known category or an unknown category. The loss value is calculated by using the rejection loss function to measure the distance from the sample to the prototype vector and the distance from the sample to the negative prototype vector. If the loss value is determined to be higher than the predetermined loss threshold, the dynamic rejection threshold is adjusted according to the category attribute of the sample so that the distance between the known category sample and the prototype vector becomes closer and closer, and the distance between the unknown category sample and the prototype vector becomes farther and farther, until the redetermined loss value converges to the predetermined loss threshold, thus obtaining the adjusted dynamic rejection threshold.
7. The method according to claim 1, characterized in that, The rejection loss function is defined as follows: in, Optimize the loss at the boundary. These are boundary optimization parameters used to dynamically adjust the weight allocation of the distance between the known and unknown classes in the rejection loss function. For sample index, The total number of samples, and These represent the prototype vector and the negative prototype vector, respectively. It is the distance from sample i to the prototype vector. It is the distance from sample i to the negative prototype vector.
8. A radio frequency fingerprint recognition device based on twin networks and negative prototypes, characterized in that, The device includes: The first module is used to acquire the radio frequency signals of the category to be identified and the radio frequency signals of the known categories, and generate the corresponding rotating constellation diagram; The second module is used to form a constellation pair by combining the rotated constellation diagram of the category to be identified with the rotated constellation diagram of the known category. The constellation pair is then input into a feature extraction model based on a Siamese network. The constellation pair is processed by two VGG16 networks in the Siamese network to output the prototype vector of the known category and the feature vector of the category to be identified. The two VGG16 networks have the same structure and share parameters. The third module is used to calculate the Euclidean distance between the two feature vectors, and to determine the category attribute of the radio frequency signal to be identified based on the Euclidean distance and the adjusted dynamic rejection threshold. The category attribute is either a known category or an unknown category.
9. A radio frequency fingerprint recognition system based on Siamese networks and negative prototypes, characterized in that, It includes a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.