Radio frequency fingerprint recognition method and system based on convolution-attention mechanism and multi-packet inference
By combining the RFF-CAT model with a convolutional neural network and a Transformer encoder, the problems of low robustness and accuracy of traditional RF fingerprint recognition methods under complex channel conditions are solved, and efficient device recognition in noisy environments is achieved.
Patent Information
- Application Number
- CN202510820264.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Traditional radio frequency fingerprint recognition methods exhibit low robustness and classification accuracy under complex channel conditions and noise interference, and a single model has difficulty balancing local features and global dependencies.
The RFF-CAT model, which combines convolutional neural networks and Transformer encoders, extracts local features through convolutional layers and uses a multi-head self-attention mechanism to capture global dependencies, and combines multi-packet adaptive fusion methods to improve recognition performance.
The accuracy and robustness of the RF fingerprint recognition model in noisy environments have been improved, and it can significantly improve device recognition accuracy and system performance under low signal-to-noise ratio conditions.
Smart Images

Figure CN120337998B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a radio frequency fingerprint recognition method and system based on a convolution-attention mechanism and multi-packet reasoning, and belongs to the field of communication networks and artificial intelligence technology. Background Art
[0002] Radio Frequency Fingerprinting (RFF) is a key technology for device authentication and security in wireless communication systems. By extracting unique features generated by wireless devices during signal transmission, RFF can effectively identify device identities. Traditional RF fingerprinting methods typically rely on specialized feature engineering and statistically based classifiers. These methods often exhibit low robustness and classification accuracy when faced with complex channel conditions, signal noise interference, and similar characteristics between devices. In recent years, with the development of deep learning technology, deep learning-based RF fingerprinting models have gradually become mainstream. These models can automatically extract time-frequency domain features of signals and significantly improve the accuracy of device classification.
[0003] At present, the application of deep learning models in the field of radio frequency fingerprint recognition is mainly concentrated on classic structures such as convolutional neural networks (CNN) and long short-term memory networks (LSTM). However, a single model may face limitations when processing complex signal features. For example, CNN performs well in capturing local features, but lacks the ability to model global time series information. Although recurrent networks such as LSTM can capture the long-term dependencies of time series, they have low computational efficiency and have difficulty processing high-dimensional signal data.
[0004] To address these issues, the Transformer, due to its powerful global feature modeling capabilities and parallel computing efficiency, has gradually become a research hotspot for processing sequence signals. However, directly applying the Transformer to RF fingerprinting still faces some challenges, such as the failure to fully utilize the locality of signal features and the fact that global modeling capabilities may be constrained by the expressiveness of input features. To address these issues, an RF fingerprinting method is urgently needed that can simultaneously capture local signal features and global dependencies to improve the model's classification accuracy and robustness to noisy data. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present invention provides a radio frequency fingerprint recognition method and system based on a convolution-attention mechanism and multi-packet reasoning, which is used to solve the problems of traditional radio frequency fingerprint recognition models such as performance degradation in noisy environments, insufficient feature extraction, and the difficulty of achieving a balance between global and local features when relying on a single model for complex data. Through in-depth analysis of the distribution patterns of local and global features of radio frequency signals, the present invention proposes a deep learning model architecture, RFF-CAT, that combines a convolutional neural network (CNN) and a Transformer encoder. This model uses convolutional layers to enhance local feature extraction capabilities, extracts local features from the original radio frequency signal, and effectively removes noise and retains key signal features through layer-by-layer convolution operations. At the same time, the Transformer encoder module captures the global dependencies of radio frequency signals through a multi-head self-attention mechanism and enhances sequence modeling capabilities in combination with explicit positional encoding.
[0006] In terms of module design, this paper addresses the high computational complexity and redundant module interactions inherent in traditional model fusion mechanisms by adopting a module separation strategy, enabling independent optimization of the convolutional and Transformer modules. This reduces computational complexity while improving model stability. To further enhance model accuracy, this paper also introduces a multi-packet adaptive fusion method (MPF). This method improves recognition performance in low signal-to-noise ratio (SNR) environments by partitioning the data into multiple packets and performing a weighted summation to fuse the different packets.
[0007] The technical solutions of the present invention are as follows:
[0008] A first aspect of the present invention provides a radio frequency fingerprint recognition method based on a convolution-attention mechanism and multi-packet reasoning, comprising:
[0009] Step 1: Capture the device transmission signal and pre-process the transmission signal to obtain a spectrum diagram;
[0010] Step 2: Build a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model;
[0011] The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders;
[0012] The convolutional layer transforms the input feature map into a high-order feature representation;
[0013] The position encoding layer is used to add position information (absolute or relative position) to enable the model to process sequential information;
[0014] The Transformer encoder includes a multi-head self-attention mechanism and a feed-forward neural network (FFN) layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feed-forward neural network layer further enhances the feature expression capability.
[0015] Step 3: Use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet inference method to obtain the final prediction results to achieve device authentication and identification.
[0016] Preferably, according to the present invention, capturing a device transmission signal and preprocessing the transmission signal to obtain a spectrum diagram includes:
[0017] First, the transmission signal is collected from the LoRa device and recorded as r(n). The LoRa device uses the LoRa protocol.
[0018] Then, calculate the carrier frequency offset (CFO) as shown below:
[0019] ;
[0020] Among them, arg(⋅) represents the phase of the transmitted signal, n represents the time variable, Indicates carrier frequency offset;
[0021] The carrier frequency offset (CFO) is compensated to reduce the error caused by the carrier frequency offset, as shown in the following equation:
[0022] ;
[0023] in, To receive the signal, is the compensated signal, j represents the imaginary unit, and CFO represents the carrier frequency offset. , t represents the time variable;
[0024] Data normalization is used to normalize the compensated signal to unit amplitude to eliminate the impact of differences in transmit power between devices on classification, as shown in the following formula:
[0025] ;
[0026] Among them, r norm (n) represents the normalized received signal, whose amplitude is limited to the range of [-1, 1]. It is used to unify the energy scale of signals from different devices, enhance the model's sensitivity to the structural features in device fingerprints, and reduce the interference of transmission power differences on classification results;
[0027] Finally, a short-time Fourier transform (STFT) is performed to convert it into a channel-independent spectrum to alleviate the channel impact, as shown in the following formula:
[0028] ;
[0029] in, represents the spectrum diagram, It represents a matrix window of length N, which is a sliding window function, specifically a rectangular window function of length N=64. A signal segment is selected from time point n to each moment t for transformation. j represents the imaginary unit and f represents the frequency.
[0030] Preferably, according to the present invention, a radio frequency fingerprint recognition model is constructed, and the obtained spectrum graph is input into the radio frequency fingerprint recognition model for training to obtain a trained radio frequency fingerprint recognition model; the method includes:
[0031] The convolutional layers include normalization layer, point convolution layer, GLU activation function layer, depth-wise separable convolution layer, batch normalization layer, Swish activation function layer, cascaded convolution layer, and Dropout layer;
[0032] First, the obtained spectrum map is input into the convolution layer, and the input spectrum map is standardized so that its mean is 0 and its variance is 1 to improve the training stability, obtain a more evenly distributed spectrum feature, and retain the standardized output of the original structure; the channel dimension is adjusted by using 1x1 convolution in the point convolution layer, and the feature information is fused or expanded to obtain the feature map after the number of channels is adjusted; the key information of the feature map is enhanced by the GLU activation function layer, and the redundant information of the feature map is suppressed; the parameter amount of the feature map is reduced by the depthwise separable convolution layer, and the spatial features are enhanced; a stable distribution feature map is obtained by the batch normalization layer; the activated feature map is obtained by the Swish activation function layer, and the small gradient information of the negative area is retained; the feature representation with the final channel number optimization is obtained by the cascade convolution layer; and finally, the regularized feature map is obtained by the Dropout layer. This module extracts low-level local features from the signal, such as the edges and textures of the spectrum graph, which are helpful for subsequent pattern recognition of the signal.
[0033] Then, in order to preserve the temporal and sequential information, a position encoding layer is introduced after the convolutional layer operation to obtain the position encoded feature map, ensuring that the output of the convolutional layer is properly adjusted to capture the temporal relationship in the data. Specifically, the position embedding is added to the output of the convolutional layer, and the formula is as follows:
[0034] ;
[0035] Among them, PE(X) represents the feature map of position encoding, X is the output of the convolutional layer, This explicit encoding helps the model understand the order and dependencies of features in the sequence, which is a key factor for time series analysis and signal processing tasks;
[0036] Finally, the position-encoded feature map is input into the Transformer encoder, which uses a multi-head self-attention mechanism to capture global dependencies across the entire sequence. This simulates long-range relationships between features, enabling the model to understand context and global patterns that are crucial for accurate classification. Specifically, the operation is as follows:
[0037] head i =Attention(W i Q X1,W i K X1,W i V X1);
[0038] Among them, X1 is the input feature map of position encoding, W i Q is the query matrix of the i-th attention head, which is used to map the input features to the query vector; W i K is the key matrix of the i-th attention head, which is used to map the input features into key vectors; W i V is the value matrix of the i-th attention head, which is used to map the input features into a value vector; h attention heads generate the output of the final multi-head self-attention mechanism, which is concatenated and linearly transformed as shown in the following formula:
[0039] MHA(X1)=W O (head1|| ... || head h );
[0040] Among them, MHA(X1) represents the output of the multi-head self-attention mechanism, W O is the output weight matrix; the combined output of the multi-head self-attention mechanism is mapped to ensure that it conforms to the final output dimension of the Transformer model; the attention mechanism enables the model to selectively focus on important features at different positions in the sequence, thereby more effectively simulating global context and dependencies; the feature representation is further refined using a feedforward neural network layer;
[0041] After processing by the Transformer encoder, the feature map passes through a one-dimensional global average pooling layer to compress the temporal dimension of the feature map into a fixed-length feature vector. Finally, the feature vector is sent to a fully connected layer and a softmax layer for classification. After training, the trained RFF-CAT model, or RF fingerprint recognition model, is obtained. The design of the RFF-CAT model ensures independent processing of local and global feature extraction. The convolutional layer specializes in capturing local features, while the Transformer encoder excels at modeling global dependencies. By separating these tasks, the model reduces computational complexity, increases flexibility, and improves performance in noisy environments. Compared with traditional Conformer models (which typically combine CNN and Transformer operations into a single module), this separation also makes the model architecture simpler and easier to interpret.
[0042] The training of the RFF-CAT model adopts the following process, including:
[0043] 1) Use the RMSProp optimization algorithm to minimize the cross entropy loss function;
[0044] 2) Batch processing of training data and performing multiple rounds of iterative training until convergence;
[0045] 3) During the training process, a learning rate scheduling strategy is introduced to improve training efficiency.
[0046] Preferably, according to the present invention, a trained radio frequency fingerprint recognition model is used for prediction, and a multi-packet inference method is combined to obtain a final prediction result; including:
[0047] During the prediction and inference phase, RF signal data from unknown devices is first preprocessed and converted into a channel-independent spectrogram, which is then fed into the trained RFF-CAT model. The output of the Softmax layer in the RFF-CAT model is a probability vector, where each element represents the confidence level associated with a device. The probability vector indicates the likelihood that the packet belongs to each potential device, enabling accurate and reliable device identification.
[0048] The output of the RFF-CAT model is then fed into the multi-packet reasoning method, also known as the adaptive fusion method (MPF), to obtain the final output probability. The multi-packet reasoning method (MPF) includes:
[0049] The incoming RF signal data is divided into multiple data packets. The initial prediction value, i.e., the initial prediction value obtained by the RFF-CAT model, is calculated for each data packet. An initial weight set is defined, and then a weighted sum is performed to obtain the fused prediction probability, as shown below:
[0050] ;
[0051] Among them, p represents the fusion prediction probability, W represents the predicted probability of the nth data packet, i.e. the initial predicted value; n Represents the weight of the predicted probability of the nth data packet; the above formula can quantify the various contributions of different data packets and set different weights for the data packets;
[0052] Calculate the error between the initial prediction value and the fused prediction probability; update the weights to adapt to the prediction value of each data packet, usually following the update rule of the error balance algorithm; at each iteration, the weight update rule is as follows:
[0053] ;
[0054] in, Represents the predicted probability weight array of the packet with index n; Represents the weight array after updating the weight of index n, preparing for the next iteration; Represents the learning rate, which controls the magnitude of weight adjustment in each iteration; It represents the error between the initial prediction probability, i.e. the initial prediction value, and the fusion probability after weighted summation, reflecting the difference between the initial prediction probability and the prediction probability after weighted summation; is an array containing the initial predicted probabilities for the first N packets starting from index n;
[0055] The updated weights are used to perform the weighted summation on the predicted values of each data packet to obtain a new fused prediction probability, which identifies the RF fingerprint of the corresponding device. The model not only outputs the identity of the device, but also distinguishes different devices based on the uniqueness of the RF signal, thereby achieving device authentication and identification.
[0056] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the processor implements the steps of a radio frequency fingerprint recognition method based on a convolution-attention mechanism and multi-packet inference.
[0057] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a radio frequency fingerprint recognition method based on a convolution-attention mechanism and multi-packet reasoning.
[0058] A second aspect of the present invention provides a radio frequency fingerprint recognition system based on a convolution-attention mechanism and multi-packet reasoning, comprising:
[0059] The preprocessing module is configured to: capture the device transmission signal and preprocess the transmission signal to obtain a spectrum diagram;
[0060] The model training module is configured to: construct a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model;
[0061] The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders;
[0062] The convolutional layer transforms the input feature map into a high-order feature representation;
[0063] The position encoding layer is used to add position information;
[0064] The Transformer encoder includes a multi-head self-attention mechanism and a feedforward neural network layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feedforward neural network layer further enhances the feature expression capability.
[0065] The multi-packet reasoning module is configured to use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet reasoning method to obtain the final prediction results.
[0066] The beneficial effects of the present invention are:
[0067] 1. This paper models RF fingerprint recognition as a deep learning problem based on convolutional layers and Transformer encoders, and proposes a multi-packet adaptive fusion method. During the model training process, the feature extraction capabilities of convolutional layers and Transformer are combined to effectively improve the feature expression and classification accuracy of RF signals.
[0068] 2. RFF-CAT demonstrates higher accuracy, stability, and robustness when processing complex spatiotemporal data and high-dimensional feature maps. It is a deep learning model with broad application prospects. The present invention performs well in low signal-to-noise ratio environments and can significantly improve the overall performance of distributed radio frequency fingerprint recognition systems, enhancing the recognition accuracy and robustness of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 The system model and workflow diagram of radio frequency fingerprint identification of the present invention;
[0070] Figure 2 Schematic diagram of the RFF-CAT model of the present invention;
[0071] Figure 3 A time domain diagram of the data set used in the experiments of the present invention; Figure 3 (a) is the time domain diagram of the LoRa device dataset collected when the expansion factor of the LoRa device is set to 7; Figure 3(b) is the time domain diagram of the LoRa device dataset collected when the expansion factor of the LoRa device is set to 8; Figure 3 (c) is the time domain diagram of the LoRa device dataset collected when the expansion factor of the LoRa device is set to 9;
[0072] Figure 4 The spectrum graph generated after preprocessing the data set used in the present invention;
[0073] Figure 5 The overall comparison chart of the prediction performance model of RFF-CAT and baseline;
[0074] Figure 6 Schematic diagram of the comparison of prediction performance of different signal-to-noise ratios under MPF conditions and reasoning based on average values of the present invention; Figure 6 (a) is a schematic diagram of the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 0; Figure 6 (b) is a diagram showing the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 5; Figure 6 (c) is a diagram showing the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 10; Figure 6 (d) is a diagram showing the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 20;
[0075] Figure 7 Schematic diagram of the classification between the MPF method (weighted sum) used in the present invention and the traditional average-based method. DETAILED DESCRIPTION
[0076] The present invention will be further described below with reference to embodiments and accompanying drawings, but is not limited thereto.
[0077] Example 1
[0078] RF fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning, such as Figure 1 As shown, including:
[0079] Step 1: Capture the device transmission signal and pre-process the transmission signal to obtain a spectrum diagram;
[0080] Step 2: Build a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model;
[0081] The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders;
[0082] The convolutional layer transforms the input feature map into a high-order feature representation;
[0083] The position encoding layer is used to add position information (absolute or relative position) to enable the model to process sequential information;
[0084] The Transformer encoder includes a multi-head self-attention mechanism and a feed-forward neural network (FFN) layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feed-forward neural network layer further enhances the feature expression capability.
[0085] Step 3: Use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet inference method to obtain the final prediction results to achieve device authentication and identification.
[0086] Example 2
[0087] The radio frequency fingerprint recognition method based on the convolution-attention mechanism and multi-packet reasoning described in Example 1 is different in that:
[0088] Capture the device transmission signal, the time domain diagram of the transmission signal is as follows Figure 3 As shown, Figure 3 (a) is the time domain diagram of the LoRa device dataset collected when the expansion factor of the LoRa device is set to 7; Figure 3 (b) is the time domain diagram of the LoRa device dataset collected when the expansion factor of the LoRa device is set to 8; Figure 3 (c) is a time domain diagram of the LoRa device data set collected when the expansion factor of the LoRa device is set to 9. The transmission signal is preprocessed to obtain a spectrum diagram, including:
[0089] First, the transmission signal is collected from the LoRa device and recorded as r(n). The LoRa device uses the LoRa protocol.
[0090] LoRa devices are terminal devices that use LoRa (Long Range) modulation technology for wireless communication. These devices typically feature low-power, long-distance, and low-rate data transmission capabilities and are widely used in IoT scenarios such as smart metering, environmental monitoring, agricultural IoT, and smart cities. LoRa devices, including sensor nodes, gateways, and modules, can operate for long periods without frequent charging, making them suitable for deployment in energy-sensitive environments.
[0091] The LoRa protocol usually refers to the LoRaWAN (LoRa Wide Area Network) protocol, an open, low-power, wide-area network communication protocol built on the LoRa physical layer technology. LoRaWAN adopts a star topology and supports mechanisms such as device hierarchical management, security authentication, and end-to-end encryption. It has the advantages of low power consumption, long distance, and a large number of connections, making it particularly suitable for application scenarios with long-distance, intermittent, and small data transmission.
[0092] Then, calculate the carrier frequency offset (CFO) as shown below:
[0093] ;
[0094] Among them, arg(⋅) represents the phase of the transmitted signal, n represents the time variable, Indicates carrier frequency offset;
[0095] The carrier frequency offset (CFO) is compensated to reduce the error caused by the carrier frequency offset, as shown in the following equation:
[0096] ;
[0097] in, To receive the signal, is the compensated signal, j represents the imaginary unit, and CFO represents the carrier frequency offset. , t represents the time variable;
[0098] Data normalization is used to normalize the compensated signal to unit amplitude to eliminate the impact of differences in transmit power between devices on classification, as shown in the following formula:
[0099] ;
[0100] Among them, r norm (n) represents the normalized received signal, whose amplitude is limited to the range of [-1, 1]. It is used to unify the energy scale of signals from different devices, enhance the model's sensitivity to the structural features in device fingerprints, and reduce the interference of transmission power differences on classification results;
[0101] Finally, a short-time Fourier transform (STFT) is performed to convert it into a channel-independent spectrum to alleviate the channel impact, as shown in the following formula:
[0102] ;
[0103] in, represents the spectrum diagram, It represents a matrix window of length N, which is a sliding window function, specifically a rectangular window function of length N=64. A signal segment is selected from time point n to each moment t for transformation. j represents the imaginary unit and f represents the frequency.
[0104] Construct a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model; Figure 2 As shown, including:
[0105] The convolutional layers include normalization layer, point convolution layer, GLU activation function layer, depth-wise separable convolution layer, batch normalization layer, Swish activation function layer, cascaded convolution layer, and Dropout layer;
[0106] First, the obtained spectrum map is input into the convolution layer, and the input spectrum map is standardized so that its mean is 0 and its variance is 1 to improve the training stability, obtain a more evenly distributed spectrum feature, and retain the standardized output of the original structure; the channel dimension is adjusted by using 1x1 convolution in the point convolution layer, and the feature information is fused or expanded to obtain the feature map after the number of channels is adjusted; the key information of the feature map is enhanced by the GLU activation function layer, and the redundant information of the feature map is suppressed; the parameter amount of the feature map is reduced by the depthwise separable convolution layer, and the spatial features are enhanced; a stable distribution feature map is obtained by the batch normalization layer; the activated feature map is obtained by the Swish activation function layer, and the small gradient information of the negative area is retained; the feature representation with the final channel number optimization is obtained by the cascade convolution layer; and finally, the regularized feature map is obtained by the Dropout layer. This module extracts low-level local features from the signal, such as the edges and textures of the spectrum graph, which are helpful for subsequent pattern recognition of the signal.
[0107] Then, in order to preserve the temporal and sequential information, a position encoding layer is introduced after the convolutional layer operation to obtain the position encoded feature map, ensuring that the output of the convolutional layer is properly adjusted to capture the temporal relationship in the data. Specifically, the position embedding is added to the output of the convolutional layer, and the formula is as follows:
[0108] ;
[0109] Among them, PE(X) represents the feature map of position encoding, X is the output of the convolutional layer, This explicit encoding helps the model understand the order and dependencies of features in the sequence, which is a key factor for time series analysis and signal processing tasks;
[0110] Finally, the position-encoded feature map is input into the Transformer encoder, a stacked multi-module. The Transformer encoder uses a multi-head self-attention mechanism to capture global dependencies across the entire sequence. It simulates long-range relationships between features, enabling the model to understand context and global patterns that are crucial for accurate classification. Specifically, the operation is as follows:
[0111] head i =Attention(W i Q X1,W i K X1,W iV X1);
[0112] Among them, X1 is the input feature map of position encoding, W i Q is the query matrix of the i-th attention head, which is used to map the input features to the query vector; W i K is the key matrix of the i-th attention head, which is used to map the input features into key vectors; W i V is the value matrix of the i-th attention head, which is used to map the input features into a value vector; h attention heads generate the final multi-head self-attention mechanism output, which is concatenated and linearly transformed as shown in the following formula:
[0113] MHA(X1)=W O (head1|| ... || head h );
[0114] Among them, MHA(X1) represents the output of the multi-head self-attention mechanism, W O is the output weight matrix; the combined output of the multi-head self-attention mechanism is mapped to ensure that it conforms to the final output dimension of the Transformer model; the attention mechanism enables the model to selectively focus on important features at different positions in the sequence, thereby more effectively simulating global context and dependencies; the feature representation is further refined using a feedforward neural network layer;
[0115] After processing by the Transformer encoder, the feature map passes through a one-dimensional global average pooling layer to compress the temporal dimension of the feature map into a fixed-length feature vector. Finally, the feature vector is sent to a fully connected layer and a softmax layer for classification. After training, the trained RFF-CAT model, or RF fingerprint recognition model, is obtained. The design of the RFF-CAT model ensures independent processing of local and global feature extraction. The convolutional layer specializes in capturing local features, while the Transformer encoder excels at modeling global dependencies. By separating these tasks, the model reduces computational complexity, increases flexibility, and improves performance in noisy environments. Compared with traditional Conformer models (which typically combine CNN and Transformer operations into a single module), this separation also makes the model architecture simpler and easier to interpret.
[0116] The training of the RFF-CAT model adopts the following process, including:
[0117] 1) Use the RMSProp optimization algorithm to minimize the cross entropy loss function;
[0118] 2) Batch processing of training data and performing multiple rounds of iterative training until convergence;
[0119] 3) During the training process, a learning rate scheduling strategy is introduced to improve training efficiency.
[0120] Use the trained RF fingerprint recognition model for prediction and combine it with the multi-packet inference method to obtain the final prediction results; including:
[0121] In the prediction and inference stage, the RF signal data from the unknown device is first preprocessed and converted into a channel-independent spectrum graph, such as Figure 4 As shown, the spectrogram is then fed into the trained RFF-CAT model. The output of the Softmax layer in the RFF-CAT model is a probability vector, where each element represents the confidence associated with one of the devices. The probability vector indicates the likelihood that the packet belongs to each potential device, thereby achieving accurate and reliable device identification.
[0122] The output of the RFF-CAT model is then fed into the multi-packet reasoning method, also known as the adaptive fusion method (MPF), to obtain the final output probability. The multi-packet reasoning method (MPF) includes:
[0123] The incoming RF signal data is divided into multiple data packets. The initial prediction value, i.e., the initial prediction value obtained by the RFF-CAT model, is calculated for each data packet. An initial weight set is defined, and then a weighted sum is performed to obtain the fused prediction probability, as shown below:
[0124] ;
[0125] Among them, p represents the fusion prediction probability, Indicates the predicted probability of the nth data packet, i.e. the initial predicted value; Represents the weight of the predicted probability of the nth data packet; the above formula can quantify the various contributions of different data packets and set different weights for the data packets;
[0126] Calculate the error between the initial prediction value and the fused prediction probability; update the weights to adapt to the prediction value of each data packet, usually following the update rule of the error balance algorithm; at each iteration, the weight update rule is as follows:
[0127] ;
[0128] Among them, w n represents the predicted probability weight array of the packet with index n; w n+1 Represents the weight array after updating the weight of index n, preparing for the next iteration; Represents the learning rate, which controls the magnitude of weight adjustment in each iteration; en It represents the error between the initial prediction probability, i.e. the initial prediction value and the weighted sum fusion probability, reflecting the difference between the initial prediction probability and the weighted sum prediction probability; p n is an array containing the initial predicted probabilities for the first N packets starting from index n.
[0129] The updated weights are used to perform the weighted summation on the predicted values of each data packet to obtain a new fused prediction probability, which identifies the RF fingerprint of the corresponding device. The model not only outputs the identity of the device, but also distinguishes different devices based on the uniqueness of the RF signal, thereby achieving device authentication and identification.
[0130] After the entire model training is completed, it also includes: using the final trained model to classify signal samples of unknown devices; evaluating the accuracy, recall rate and F1 value of the model based on the classification results; storing the evaluation results and regularly updating the model to adapt to the feature changes of new devices.
[0131] The results of the proposed RF fingerprint recognition and multi-packet fusion method based on convolutional neural network and Transformer encoder are shown in Figure 5 、 Figure 6 、 Figure 7 As shown; Figure 5 The classification accuracy of the RFF-CAT model was compared with that of the Transformer model, the convolutional neural network model, and the Transformer encoder model at different signal-to-noise ratio (SNR) levels. These classification accuracies were all achieved without the MPF. As shown in the figure, at low SNR levels, the classification accuracy achieved by the RFF-CAT model was approximately 10% higher than that achieved by the Transformer model. At high SNR levels, the classification accuracy of the RFF-CAT model was approximately 4-5% higher than that of the Transformer model. Furthermore, the overall classification accuracy achieved by the RFF-CAT model was approximately 10% higher than that achieved by the Transformer model. RFF-CAT utilizes convolution operations to capture local patterns and features, which is particularly useful at low SNR levels. Experimental results obtained through simulation using the proposed RFF-CAT trained model demonstrate that the model exhibits excellent performance. Figure 6 (a) is a schematic diagram of the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 0; Figure 6 (b) is a diagram showing the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 5; Figure 6 (c) is a diagram showing the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 10; Figure 6(d) is a schematic diagram of the accuracy of using MPF and not using MPF when the signal-to-noise ratio is 20; Figure 6 and Figure 7 It can be seen that the invented MPF method can significantly improve the RFF performance, especially in low SNR scenarios.
[0132] Example 3
[0133] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet inference described in embodiment 1 or 2.
[0134] Example 4
[0135] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning described in embodiment 1 or 2 are implemented.
[0136] Example 5
[0137] The preprocessing module is configured to: capture the device transmission signal and preprocess the transmission signal to obtain a spectrum diagram;
[0138] The model training module is configured to: construct a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model;
[0139] The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders;
[0140] The convolutional layer transforms the input feature map into a high-order feature representation;
[0141] The position encoding layer is used to add position information;
[0142] The Transformer encoder includes a multi-head self-attention mechanism and a feedforward neural network layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feedforward neural network layer further enhances the feature expression capability.
[0143] The multi-packet reasoning module is configured to use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet reasoning method to obtain the final prediction results.
Claims
1. Radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning, characterized by: include: Step 1: Capture the device transmission signal and pre-process the transmission signal to obtain a spectrum diagram; Step 2: Build a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model; The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders; The convolutional layer transforms the input feature map into a high-order feature representation; The position encoding layer is used to add position information; The Transformer encoder includes a multi-head self-attention mechanism and a feedforward neural network layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feedforward neural network layer further enhances the feature expression capability. The convolutional layers include normalization layer, point convolution layer, GLU activation function layer, depth-wise separable convolution layer, batch normalization layer, Swish activation function layer, cascaded convolution layer, and Dropout layer; First, the obtained spectrogram is input into the convolutional layer to normalize the input spectrogram; The point convolution layer uses 1x1 convolution to adjust the channel dimension and obtain the feature map with adjusted channel number; the GLU activation function layer enhances the key information of the feature map and suppresses the redundant information of the feature map; the depth-wise separable convolution layer reduces the number of parameters of the feature map and enhances the spatial features; the batch normalization layer obtains the feature map with stable distribution; the Swish activation function layer obtains the activated feature map and retains the small gradient information in the negative area; the concatenated convolution layers obtain the final feature representation with optimized channel number; and finally the Dropout layer obtains the regularized feature map X. Then, a position encoding layer is introduced after the convolutional layer operation to obtain a position-encoded feature map to capture the temporal relationship in the data. Finally, the position-encoded feature map is fed into the Transformer encoder, which uses a multi-head self-attention mechanism to capture global dependencies across the entire sequence. After the Transformer encoder is processed, the feature map passes through a one-dimensional global average pooling layer to compress the time dimension of the feature map into a feature vector of fixed length. Finally, the feature vector is sent to the fully connected layer and the softmax layer for classification. After training, the trained RFF-CAT model, i.e., the radio frequency fingerprint recognition model, is obtained. Step 3: Use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet inference method to obtain the final prediction results; Multi-package inference methods include: The incoming RF signal data is divided into multiple data packets. The initial prediction value (i.e., the initial prediction value obtained by the RFF-CAT model) is calculated for each data packet. An initial weight set is defined, and then a weighted sum is performed to obtain the fused prediction probability. Calculate the error between the initial prediction value and the fused prediction probability, and update the weights to adapt to the prediction value of each data packet; The updated weights are used to perform weighted summation on the predicted values of each data packet again to obtain a new fusion prediction probability, that is, to identify the RF fingerprint of the corresponding device and realize device authentication and identification.
2. The radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning according to claim 1 is characterized in that: Capture the device transmission signal and pre-process the transmission signal to obtain a spectrum diagram; including: First, the transmission signal is collected from the LoRa device and recorded as r(n). The LoRa device uses the LoRa protocol. Then, calculate the carrier frequency offset as shown below: ; Among them, arg(⋅) represents the phase of the transmitted signal, n represents the time variable, Indicates carrier frequency offset; The carrier frequency offset is compensated as shown in the following formula: ; in, To receive the signal, is the compensated signal, j represents the imaginary unit, and CFO represents the carrier frequency offset. , t represents the time variable; Data normalization is used to normalize the compensated signal to unit amplitude, as shown in the following formula: ; Among them, r norm (n) represents the normalized received signal; Finally, a short-time Fourier transform is performed to convert it into a spectrum graph that is independent of the channel, as shown in the following formula: ; in, represents the spectrum diagram, It represents a matrix window of length N, which selects a signal from time point n to each moment t for transformation, j represents the imaginary unit, and f represents the frequency.
3. The radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning according to claim 2 is characterized in that: Construct a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model; including: After the convolutional layer operation, the position encoding layer is introduced to obtain the position encoding feature map to capture the temporal relationship in the data. The formula is as follows: ; Among them, PE(X) represents the feature map of position encoding, X is the output of the convolutional layer, is the position code; The position-encoded feature map is input to the Transformer encoder as follows: head i =Attention(W i Q X1,W i K X1,W i V X1); Among them, X1 is the input feature map of position encoding, W i Q is the query matrix of the i-th attention head; W i K is the key matrix of the i-th attention head; W i V is the value matrix of the i-th attention head; h attention heads generate the final multi-head self-attention mechanism output, which is concatenated and linearly transformed as shown in the following formula: MHA(X1)=W O (head1|| ... || head h ); Among them, MHA(X1) represents the output of the multi-head self-attention mechanism, W O is the output weight matrix; it maps the combined output of the multi-head self-attention mechanism and uses the feedforward neural network layer to further improve the feature representation.
4. The radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning according to claim 3 is characterized in that: Use the trained RF fingerprint recognition model for prediction and combine it with the multi-packet inference method to obtain the final prediction results; including: In the prediction and inference phase, the RF signal data from the unknown device is first preprocessed and converted into a channel-independent spectrogram, which is then fed into the trained RFF-CAT model. The output obtained by the RFF-CAT model is then used to obtain the final output probability through a multi-package inference method, i.e., an adaptive fusion method; The ensemble predicted probabilities are shown below: ; Among them, p represents the fusion prediction probability, Indicates the predicted probability of the nth data packet, i.e. the initial predicted value; represents the weight of the predicted probability of the nth data packet; At each iteration, the weight update rule is as follows: ; in, Represents the predicted probability weight array of the packet with index n; Represents the weight array after updating the weight of index n, Represents the learning rate, which controls the magnitude of weight adjustment in each iteration; Represents the initial prediction probability, that is, the error between the initial prediction value and the weighted summed fusion probability, is an array containing the initial predicted probabilities for the first N packets starting from index n.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning according to any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of implementing the radio frequency fingerprint recognition method based on convolution-attention mechanism and multi-packet reasoning according to any one of claims 1 to 4 are implemented.
7. Radio frequency fingerprint recognition system based on convolution-attention mechanism and multi-packet reasoning, characterized by: include: The preprocessing module is configured to: capture the device transmission signal and preprocess the transmission signal to obtain a spectrum diagram; The model training module is configured to: construct a radio frequency fingerprint recognition model, input the obtained spectrum graph into the radio frequency fingerprint recognition model for training, and obtain a trained radio frequency fingerprint recognition model; The RF fingerprint recognition model includes convolutional layers, position encoding layers, and Transformer encoders; The convolutional layer transforms the input feature map into a high-order feature representation; The position encoding layer is used to add position information; The Transformer encoder includes a multi-head self-attention mechanism and a feedforward neural network layer. The multi-head self-attention mechanism captures the global dependencies in the entire sequence, and the feedforward neural network layer further enhances the feature expression capability. The convolutional layers include normalization layer, point convolution layer, GLU activation function layer, depth-wise separable convolution layer, batch normalization layer, Swish activation function layer, cascaded convolution layer, and Dropout layer; First, the obtained spectrogram is input into the convolutional layer to normalize the input spectrogram; The point convolution layer uses 1x1 convolution to adjust the channel dimension and obtain the feature map with adjusted channel number; the GLU activation function layer enhances the key information of the feature map and suppresses the redundant information of the feature map; the depth-wise separable convolution layer reduces the number of parameters of the feature map and enhances the spatial features; the batch normalization layer obtains the feature map with stable distribution; the Swish activation function layer obtains the activated feature map and retains the small gradient information in the negative area; the concatenated convolution layers obtain the final feature representation with optimized channel number; and finally the Dropout layer obtains the regularized feature map X. Then, a position encoding layer is introduced after the convolutional layer operation to obtain a position-encoded feature map to capture the temporal relationship in the data. Finally, the position-encoded feature map is fed into the Transformer encoder, which uses a multi-head self-attention mechanism to capture global dependencies across the entire sequence. After the Transformer encoder is processed, the feature map passes through a one-dimensional global average pooling layer to compress the time dimension of the feature map into a feature vector of fixed length. Finally, the feature vector is sent to the fully connected layer and the softmax layer for classification. After training, the trained RFF-CAT model, i.e., the radio frequency fingerprint recognition model, is obtained. The multi-packet inference module is configured to: use the trained RF fingerprint recognition model to make predictions and combine it with the multi-packet inference method to obtain the final prediction results; Multi-package inference methods include: The incoming RF signal data is divided into multiple data packets. The initial prediction value (i.e., the initial prediction value obtained by the RFF-CAT model) is calculated for each data packet. An initial weight set is defined, and then a weighted sum is performed to obtain the fused prediction probability. Calculate the error between the initial prediction value and the fused prediction probability, and update the weights to adapt to the prediction value of each data packet; The updated weights are used to perform weighted summation on the predicted values of each data packet again to obtain a new fusion prediction probability, that is, to identify the RF fingerprint of the corresponding device and realize device authentication and identification.
Citation Information
Patent Citations
Multi-feature fusion wireless device radio frequency fingerprint extraction method based on attention mechanism
CN114118131A
Robust radio frequency fingerprint identification method based on cross attention
CN118612744A