Robust RF fingerprint recognition method based on cross-attention
By employing a robust RF fingerprinting method based on cross-attention, and utilizing segmented logarithmic spectrum embedding and multi-head cross-attention mechanism, the problem of decreased recognition accuracy caused by changes in channel conditions is solved, achieving higher recognition accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2026-03-10
AI Technical Summary
Existing radio frequency fingerprinting methods suffer from decreased recognition accuracy when channel conditions change, making it difficult to effectively extract device hardware features and mitigate the impact of channel characteristics.
A robust RF fingerprinting method based on cross-attention is adopted. By segmented logarithmic spectrum embedding and multi-head cross-attention mechanism, channel-related and hardware-related features are separated, and a cross-Transformer model is constructed to fully extract hardware features and weaken channel features.
It improves the accuracy of radio frequency fingerprint recognition, especially under low signal-to-noise ratio conditions, and enhances the robustness and recognition performance of the model.
Smart Images

Figure CN118612744B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of radio frequency fingerprint identification methods, and particularly relates to a robust radio frequency fingerprint identification method based on cross attention. BACKGROUND
[0002] The open nature of wireless transmission leads to many threats in security, such as being vulnerable to attacks by illegal devices. To ensure the security of wireless transmission, the access security of wireless transmission devices must be ensured first. Traditional device security authentication is achieved by key encryption or identity authentication based on MAC / IP and the like, but the key or identity has the risk of being cracked or copied, and therefore a new security authentication method needs to be found to improve the security of the network. Radio frequency fingerprints come from the hardware differences inside wireless devices, are unique and difficult to tamper with, and can be used as a basis for identifying different wireless devices, and are a reliable and lightweight wireless communication device security authentication method.
[0003] In the field of radio frequency fingerprint identification, the powerful nonlinear representation and learning ability of deep neural networks enable them to learn high-level features directly from raw signals with complex structures, and effectively extract radio frequency fingerprints that can represent the essential features of devices. Neural networks are data-driven models, and therefore, in order to obtain better generalization ability and identification performance, the radio frequency fingerprint identification method based on deep neural networks needs higher quality training data and deeper network models. However, in actual scenarios, when the radio frequency signals in the training and identification stages experience different channel conditions due to differences in factors such as collection time and place, the distribution of the collected data will drift, thereby greatly reducing the radio frequency fingerprint identification accuracy.
[0004] To solve this problem, most existing researches are based on channel feature removal methods: through correlation algorithms, the influence of the transmission channel is removed as much as possible in the received signal, and the part related to the hardware device is retained. However, this kind of method needs prior information of the signal, and also has the possibility that the channel influence is not completely removed, or the original hardware fingerprint of the device is blurred in the process of removing the channel influence. SUMMARY
[0005] The purpose of the present application is to provide a robust radio frequency fingerprint identification method based on cross attention, which can effectively improve the identification accuracy of the device.
[0006] The technical solution adopted by the present application is a robust radio frequency fingerprint identification method based on cross attention, which is implemented according to the following steps:
[0007] Step 1, obtaining the signal of a wireless communication device to obtain the segmented log spectrum of the signal;
[0008] Step 2, the segmented log spectrum in the step 1 is operated by sliding window, a segmented log spectrum embedding mode is constructed, absolute position coding is added, and an embedding module is constructed;
[0009] Step 3, two frames of data of the same device outside the channel correlation time are taken, operations of step 1 to step 2 are performed, and the output results are sent to the coding module;
[0010] Step 4, the output results of the coding module are sent to the classification network to obtain a classification probability;
[0011] Step 5, an overall network model is constructed by step 1 to step 4, the network is trained using a training sample set, and the network effect is tested using a test sample to obtain an identification accuracy.
[0012] The technical scheme of the present application also has the following characteristics:
[0013] Step 1 is implemented according to the following steps:
[0014] Step 1.1, the signal of the wireless communication device is obtained, and is expressed as:
[0015] y[n]=h[n]*f(x[n])+n0[n] (1)
[0016] Wherein, y[n] is a digital signal obtained after the received signal is converted by an analog-to-digital converter; x[n] is a signal transmitted by the wireless communication device; n0[n] is an additive white Gaussian noise; h[n] is a time-varying impulse response of the wireless channel experienced by the transmitted signal; f(·) represents the influence of the transmitter hardware device on the signal; * represents convolution operation; n is the serial number of the received signal;
[0017] Step 1.2, the short-time Fourier transform of the signal is calculated to obtain a segmented log spectrum;
[0018] The short-time Fourier transform of the discrete input signal y[n] can be obtained as follows:
[0019]
[0020] Wherein: S[k,m] is the kth row and mth column element of the complex matrix obtained by performing STFT on y[n] ; w[·] is a window function, and a rectangular window is selected here; N is the number of points for each segment to perform FFT.
[0021] Step 2 is implemented according to the following steps:
[0022] Step 2.1: a sliding window is taken on the segmented log spectrum, the window length is l w , and the sliding point number is r, so as to obtain a block sequence matrix as follows:
[0023] P=[p1,p2,…,pK ] T (3)
[0024] wherein: M is the number of segmented log spectrum columns; K=Mx((N-l w ) / r+1) represents the number of block sequences that can be formed after the segmented log spectrum is subjected to windowing operation; p k represents different frequency bands in the segmented log spectrum of the signal in different time periods;
[0025] Step 2.2: Adding absolute position coding to the block sequence vector after segmentation to make the block sequence vector contain position information;
[0026] The i-th element in the position sequence obtained after the absolute position coding of each element can be expressed as:
[0027]
[0028] wherein t represents the number of each position; θ i is the frequency artificially set at each position;
[0029] θ i =10000 -2i / d (5)
[0030] wherein d represents the dimension of the input after the embedding module.
[0031] Step 3 is specifically: taking the multi-head cross attention of two frames of data of the same device after SLSE outside the channel correlation time to construct an encoding module.
[0032] The construction of the encoding module specifically includes:
[0033] Calculating the cross attention value of different frequency bands in the segmented log spectrum of the signal in different time periods:
[0034]
[0035] wherein W Q ,W K ,W V are query matrix, key matrix and value matrix, (Q, K, V) are learnable weight matrices, P a , P b are obtained from different frames after SLSE embedding, with a dimension of d k ;
[0036] Multi-head partitioning is performed on Q, K and V in the second dimension to obtain h heads:
[0037] head i =CA(Q iK i ,V i ),i∈[1,h] (7)
[0038] Concatenate the output matrix of each head in the last dimension:
[0039] MHCA(P a ,P b )=concat(head1,head2,…,head h ) (8)
[0040] After that, a feedforward network module is added after each MHCA.
[0041] The beneficial effects of the present application are:
[0042] 1) The present application proposes a fingerprint feature separation algorithm based on segmented log spectrum similarity measurement, which separates the channel-related part and the hardware-related part in the fingerprint feature according to their different causes and characteristics, and retains the hardware features while weakening the channel features by calculating the segmented log spectrum similarity of the radio frequency signal.
[0043] 2) The present application proposes a cross-Transformer model, which uses a segmented log spectrum embedding method and a multi-head cross-attention mechanism to replace the original embedding method and self-attention mechanism, so that the model pays more attention to the part that effectively reflects the essential characteristics of the device, fully extracts the hardware features and weakens the channel features, and realizes channel-robust radio frequency fingerprint identification. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 The network result model of the robust radio frequency fingerprint identification method based on cross-attention of the present application;
[0045] Figure 2 The identification accuracy comparison chart of the robust radio frequency fingerprint identification method based on cross-attention of the present application under different signal-to-noise ratios and the traditional method and the method only with SLSE DETAILED DESCRIPTION
[0046] The present application will be described in detail below in combination with the drawings and specific embodiments.
[0047] The robust radio frequency fingerprint identification method based on cross-attention of the present application, as shown in Figure 1 , calculates the segmented log spectrum of the original IQ data, and then sends it into the classification network for calculating the identification accuracy after passing through the embedding module and two encoding modules. In the training stage of the network, data outside the channel-related time of two frames is needed, the segmented log spectrum of which is calculated after passing through the embedding module, and the outputs of the two embedding modules are sent into the encoding module at the same time, and finally the classification probability is obtained through the classification module to train the network parameters.
[0048] The cross-attention-based robust radio frequency fingerprinting method is implemented according to the following steps:
[0049] Step 1, obtaining a signal of a wireless communication device to obtain a segmented log spectrum of the signal;
[0050] Step 1 is implemented according to the following steps:
[0051] Step 1.1, obtaining a signal of a wireless communication device, denoted as:
[0052] y[n]=h[n]*f(x[n])+n0[n] (1)
[0053] where y[n] is a digital signal obtained after the received signal is analog-to-digital converted; x[n] is a signal transmitted by the wireless communication device; n0[n] is additive white Gaussian noise; h[n] is a time-varying impulse response of a wireless channel experienced by the transmitted signal; f(·) represents the influence of the transmitter hardware device on the signal; * represents convolution operation; n is the serial number of the received signal;
[0054] Step 1.2, calculating a short-time Fourier transform on the signal to obtain a segmented log spectrum;
[0055] The short-time Fourier transform on the discrete input signal y[n] can be obtained as:
[0056]
[0057] where S[k,m] is the kth row and mth column element of the complex matrix obtained after the STFT on y[n] ; w[·] is a window function, and a rectangular window is selected here; N is the number of points for each segment to perform FFT;
[0058] Step 2, performing a sliding window operation on the segmented log spectrum in step 1 to construct a segmented log spectrum embedding mode (SLSE), adding absolute position encoding, and constructing an embedding module;
[0059] Step 2 is implemented according to the following steps:
[0060] Step 2.1: taking a sliding window on the segmented log spectrum, with a window length of l w and a sliding point number of r, to obtain a block sequence matrix as:
[0061] P=[p1,p2,…,p K ] T (3)
[0062] where M is the number of columns of the segmented log spectrum; K=M×((N-l wrepresents the number of block sequences that can be formed after the windowing operation on the segmented log spectrum; p k represents different frequency bands in the segmented log spectrum of the signal in different time periods;
[0063] Step 2.2: Add absolute position coding to the block sequence vector after segmentation, so that the block sequence vector contains position information;
[0064] The i-th element in the position sequence obtained after the absolute position coding of each element can be expressed as:
[0065]
[0066] where t represents the number of each position; θ i is the frequency artificially set for each position;
[0067] θ i = 10000 -2i / d (5)
[0068] where d represents the dimension of the input through the embedding module;
[0069] Step 3: Take two frames of data of the same device outside the channel-related time, and perform steps 1-2 operations, and send the output results into the encoding module;
[0070] Step 3 is specifically: taking two frames of data of the same device outside the channel-related time after SLSE, performing multi-head cross attention (MHCA), and constructing an encoding module; specifically including:
[0071] Calculate the cross-attention value of different frequency bands in the segmented log spectrum of the signal in different time periods:
[0072]
[0073] where W Q ,W K ,W V is the query matrix, the key matrix and the value matrix, and (Q, K, V) is the learnable weight matrix of the query matrix, the key matrix and the value matrix, P a , P b is obtained by embedding from different frames through SLSE, with a dimension of d k ;
[0074] Multi-head partition is performed on Q, K, and V in the second dimension to obtain h heads:
[0075] head i = CA(Q i ,K i ,V i), i e [1, h] (7)
[0076] Concatenate the output matrix of each head in the last dimension:
[0077] MHCA(P a ,P b )=concat(head1,head2,…,head h ) (8)
[0078] After that, a feed-forward network module (FFN) is added after each MHCA.
[0079] Step 4, send the output result of the encoding module into the classification network to obtain the classification probability.
[0080] Step 5, construct the overall network model with steps 1-4, train the network using the training sample set, and test the network effect with the test sample to obtain the recognition accuracy.
[0081] Embodiment 1
[0082] In the field of radio frequency fingerprint identification, deep neural networks can effectively extract radio frequency fingerprints that can represent the essential characteristics of devices. In order to obtain better generalization ability and recognition performance, the radio frequency fingerprint identification method based on deep neural networks needs higher quality training data and deeper network models. However, in actual scenarios, when the radio frequency signals in the training and identification stages experience different channel conditions due to differences in factors such as collection time and location, the distribution of the collected data will drift, greatly reducing the radio frequency fingerprint identification accuracy, therefore the robustness of the radio frequency fingerprint identification method needs to be improved.
[0083] Embodiment 2
[0084] The robust radio frequency fingerprint identification method based on cross-attention, w[·] is the window function in step 1, the window length is W, and the sliding distance is R, here a rectangular window is selected, that is:
[0085]
[0086] Let the input be y[n], and obtain the STFT complex matrix under the condition of not considering noise:
[0087]
[0088] Where:
[0089] X m =[X 1,m ,X 2,m ,…,X N,m ] TH represents the ideal spectrum of the m-th segment of the signal after y[n] is divided by a sliding window; m =[H 1,m H 2,m ,…,H N,m ] T y[n] represents the channel response experienced by the m-th segment of the signal; ⊙ represents the element-wise multiplication operation; F(·) represents the effect of the transmitter hardware on the radio frequency signal in the frequency domain.
[0090] Taking the amplitude values of each element of S and converting them from a linear scale to a logarithmic scale, we obtain the piecewise logarithmic spectrum:
[0091]
[0092] in: for The column vector of a matrix; lg(·) represents the base-10 logarithmic operation on each element of the matrix; |·| represents the absolute value operation on each element of the matrix.
[0093] Ignore W in step 3 Q W K W V Due to the influence of this, the cross-attention value becomes:
[0094]
[0095] in, This represents the similarity between different frequency bands at different times for the same device.
[0096] Example 3
[0097] The graph compares the recognition accuracy of the proposed method with that of traditional methods and methods with only SLSE under different signal-to-noise ratios. The traditional method refers to using the Vision Transformer as the baseline model, dividing the matrix after the short-time Fourier transform into blocks, flattening them to form the vector of the block sequence, and employing the original multi-head attention module in the Vision Transformer. The method with only SLSE incorporates the SLSE proposed in this invention into the Vision Transformer, but retains the original multi-head self-attention mechanism. The proposed method is the method of this invention.
[0098] The data used comes from the WiSig public dataset, which contains subsets D1, D2, D3, and D4 of data collected by six devices on March 1, 8, 15, and 23, 2022, with 1,000 preamble data points from each transmitter, totaling 6,000. Since the time interval between each two sets of data collections is at least one week, the channel conditions experienced by the transmitted signals in different data subsets must have changed.
[0099] Since the signal-to-noise ratio of the data is greater than 10dB, Gaussian white noise is added to the original data here, Figure 2 The signal-to-noise ratio in the above formula is the ratio of the original received signal to the power of the added artificial noise. The actual signal-to-noise ratio of the signal after adding noise is less than the value. The data of D1 is used for training, and the data of D4 is used for testing. The results show that the recognition accuracy of the method using only SLSE is higher than that of the traditional method, and the recognition accuracy of the proposed method is the highest. Under low signal-to-noise ratio, the proposed method is more obvious than the other two methods.
Claims
1. A robust radio frequency fingerprinting method based on cross-attention, characterized in that, The method is implemented according to the following steps: Step 1, obtaining signals of a wireless communication device to obtain a segmented log spectrum of the signals; Step 2, performing a sliding window operation on the segmented log spectrum in step 1 to construct a segmented log spectrum embedding mode SLSE, adding absolute position encoding to construct an embedding module; Step 3, taking two frames of data of the same device outside the channel correlation time, performing steps 1-2, and inputting the output results into the encoding module; Step 4, inputting the output results of the encoding module into a classification network to obtain a classification probability; Step 5, constructing an overall network model according to steps 1-4, training the network using a training sample set, testing the network effect using a test sample, and obtaining an identification accuracy rate; The step 3 is specifically: taking the multi-head cross attention of the two frames of data of the same device outside the channel correlation time after the SLSE to construct the encoding module; The construction of the encoding module specifically includes: calculating the cross attention values of different frequency bands in the signal segmented log spectrum in different time periods: (6) wherein, is a query matrix, a key matrix and a value matrix, a learnable weight matrix, , from different frames , is obtained by SLSE embedding, with a dimension of ; right Multi-head partitioning is performed on the second dimension to obtain... h Size: (7) splicing the output matrix of each head in the last dimension: (8) then adding a feedforward network module after each MHCA.
2. The cross-attention based robust radio frequency fingerprinting method of claim 1, wherein, The step 1 is implemented according to the following steps: Step 1.1, obtaining signals of a wireless communication device, denoted as: (1) wherein, is a digital signal obtained after the received signal is subjected to analog-to-digital conversion; is a signal transmitted by a wireless communication device; is additive white Gaussian noise; is a time-varying impulse response of a wireless channel experienced by the transmitted signal; represents an impact of a transmitter hardware device on the signal; represents a convolution operation; is a sequence number of the received signal; Step 1.2, calculating a short-time Fourier transform on the signals to obtain a segmented log spectrum; For discrete input signals Performing a short-time Fourier transform gives (2) wherein: is the complex matrix obtained after STFT is the element in the i-th row and j-th column of the complex matrix obtained after STFT k is the element in the i-th row and j-th column of the complex matrix m obtained after STFT is the window function, and a rectangular window is selected here; N is the number of points for FFT for each segment; and R is the sliding distance; M is the number of log-spectrum columns for each segment.
3. The cross-attention based robust radio frequency fingerprinting method of claim 1, wherein, The step 2 is implemented according to the following steps: Step 2.1: Take sliding window on the segmented log spectrum, window length is l w , sliding point number is r , and the segmented sequence matrix is obtained as follows: (3) wherein: M is the number of segmented log spectrum columns; represents the number of block sequences that can be formed after the windowing operation of the segmented log spectrum; after division represents different frequency bands in the signal segmented log spectrum of different time periods; Step 2.2: adding absolute position encoding to the block sequence vector after blocking to make the block sequence vector contain position information; Absolute position encoding encodes the position sequence of each element. i Each element can be represented as: (4) wherein, t denotes the number of each position; is the frequency set artificially for each position; (5) wherein, d denotes the dimension of the input through the embedding module.