WiFi device radio frequency fingerprint identification method based on small sample image classification
Through the image data enhancement module based on twin neural networks and autoencoders, the accuracy problem of radio frequency fingerprint recognition of WiFi devices under small sample conditions was solved. The data enhancement strategy was used to expand the sample and improve the recognition accuracy.
Patent Information
- Application Number
- CN202411775637.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-12-05
AI Technical Summary
Under small sample conditions, traditional WiFi device radio frequency fingerprint recognition methods are difficult to guarantee accuracy, especially in new devices or small-scale network environments, where the number of samples is limited, resulting in poor recognition results.
An image data enhancement module based on twin neural networks and autoencoders is used to construct a small sample data set through short-time Fourier transform to perform image feature extraction and similarity judgment. The data enhancement strategy is used to expand the sample and train the radio frequency fingerprint small sample image classification model.
The accuracy of radio frequency fingerprint recognition of WiFi devices is improved under small sample conditions, and higher classification accuracy is achieved through data enhancement and model training.
Smart Images

Figure CN119691726B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of wireless communication security, in particular to a WiFi device radio frequency fingerprint identification method based on small sample image classification. BACKGROUND
[0002] With the rapid development of wireless communication technology, the number of deployed WiFi devices has increased dramatically. How to effectively identify and manage these devices has become an important research topic. Traditional device authentication methods, such as password-based or encryption protocol-based authentication, are vulnerable to security threats such as man-in-the-middle attacks and key leakage. In order to improve the security and uniqueness of devices, radio frequency fingerprint identification technology has gradually become a new solution. Radio frequency fingerprint is a unique signal feature determined by device hardware characteristics, which is difficult to be forged or copied, and thus can provide more reliable identity authentication for devices.
[0003] However, the extraction and classification of radio frequency fingerprints usually rely on a large number of sample data to ensure the generalization ability and accuracy of the model. But in practical applications, it is often difficult to obtain a large number of radio frequency data samples of WiFi devices, especially when facing new devices or small-scale network environments, the number of samples is very limited, which poses a serious challenge to traditional radio frequency fingerprint classification methods.
[0004] Therefore, in the related art, there is an urgent need for a method that can improve the accuracy of WiFi device radio frequency fingerprint identification under small sample conditions. SUMMARY
[0005] Therefore, it is necessary to provide a WiFi device radio frequency fingerprint identification method based on small sample image classification that can improve the accuracy of WiFi device radio frequency fingerprint identification under small sample conditions.
[0006] In a first aspect, the present application provides a WiFi device radio frequency fingerprint identification method based on small sample image classification. The method comprises:
[0007] Obtaining WiFi device signal data and preprocessing, converting the preprocessed WiFi device signal data into a time-frequency spectrum graph by using short-time Fourier transform, and constructing a small sample data set;
[0008] Constructing a radio frequency fingerprint small sample image classification model based on a twin neural network, and designing an image data enhancement module based on an autoencoder;
[0009] Pre-training the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set;
[0010] Sample expansion is performed based on the image data enhancement module, and a pre-trained radio frequency fingerprint small sample image classification model is used for screening;
[0011] The radio frequency fingerprint small sample image classification model is retrained using the expanded data set, and after the training is completed, a test sample is input, and an identification result is output.
[0012] Optionally, in an embodiment of the present application, the preprocessing includes frame detection, signal interception, and energy normalization.
[0013] Optionally, in an embodiment of the present application, the formula of the short-time Fourier transform is:
[0014]
[0015] wherein x(t) is the WiFi device signal data after preprocessing, w(t-m) is a window function, m is a sliding parameter of time, ω is a frequency component, j is an imaginary unit, and t is time.
[0016] Optionally, in an embodiment of the present application, the radio frequency fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module, wherein the feature extraction module is composed of 4 convolution modules, and the similarity discrimination module is composed of 3 fully connected layers.
[0017] Optionally, in an embodiment of the present application, the image data enhancement module is used for time-frequency spectrum feature extraction, transformation, and restoration, and includes an encoder and a decoder, wherein the encoder is composed of 4 convolution modules, and the decoder is composed of 4 transposed convolution modules.
[0018] Optionally, in an embodiment of the present application, the pre-training of the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set includes:
[0019] Initializing network parameters;
[0020] The training samples are input into the image data enhancement module in batches, a binary cross-entropy loss function is used to construct an image data enhancement loss function, and back propagation is performed based on the image data enhancement loss function;
[0021] The training samples are divided into a training set, a support set, and a validation set according to categories, and a positive-negative sample pair is constructed, and the radio frequency fingerprint small sample image classification model is input in batches, a binary cross-entropy loss function is used to construct a classification loss function, and back propagation is performed based on the classification loss function.
[0022] Optionally, in one embodiment of the present application, the sample expansion based on the image data enhancement module includes image mixing, image masking, feature transformation, and noise addition.
[0023] In a second aspect, the present application also provides a WiFi device radio frequency fingerprint recognition device based on small sample image classification. The device includes:
[0024] A small sample data set construction module is used to obtain and preprocess WiFi device signal data, convert the preprocessed WiFi device signal data into a time-frequency spectrum using short-time Fourier transform, and construct a small sample data set;
[0025] A model building module is used to build a small-sample RF fingerprint image classification model based on a twin neural network and design an image data enhancement module based on an autoencoder;
[0026] A model pre-training module, configured to pre-train the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set;
[0027] A data enhancement module, configured to perform sample expansion based on the image data enhancement module and perform screening using a pre-trained radio frequency fingerprint small sample image classification model;
[0028] The radio frequency fingerprint recognition module is used to retrain the radio frequency fingerprint small sample image classification model using the expanded data set, input the test sample after the training is completed, and output the recognition result.
[0029] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program and the processor executes the steps of the method described in each of the above embodiments.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in each of the above embodiments.
[0031] The above-mentioned WiFi device radio frequency fingerprint recognition method based on small sample image classification first obtains and preprocesses WiFi device signal data, and uses short-time Fourier transform to convert the preprocessed WiFi device signal data into a time-frequency spectrum to construct a small sample data set; then, a radio frequency fingerprint small sample image classification model is constructed based on a twin neural network, and an image data enhancement module is designed based on an autoencoder; then, the radio frequency fingerprint small sample image classification model and the image data enhancement module are pre-trained using the small sample data set; then, sample expansion is performed based on the image data enhancement module, and screening is performed using the pre-trained radio frequency fingerprint small sample image classification model; finally, the radio frequency fingerprint small sample image classification model is re-trained using the expanded data set, and after training is completed, a test sample is input and a recognition result is output. Specifically, the method utilizes spectrograms as feature representations of RF fingerprints and designs a small-sample spectrogram classification model based on a twin neural network. Through training, it effectively learns the feature representations of samples and the similarity metric between categories. Furthermore, a data augmentation strategy for image feature extraction, transformation, and restoration based on autoencoders is designed to generate new spectrograms with both feature diversity and noise robustness. Furthermore, through an iterative strategy of model training and data augmentation, a highly effective small-sample image classification model for RF fingerprints is developed, achieving high classification accuracy with relatively few training samples. This improves the accuracy of RF fingerprint recognition for WiFi devices under small sample conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a diagram illustrating an application environment of a WiFi device radio frequency fingerprint recognition method based on small sample image classification in one embodiment;
[0033] Figure 2 1 is a flow chart of a method for radio frequency fingerprint recognition of WiFi devices based on small sample image classification in one embodiment;
[0034] Figure 3 Schematic diagram of the IEEE 802.11a protocol WiFi signal frame format in one embodiment;
[0035] Figure 4 Schematic diagram of the overall structure of a small sample image classification model for radio frequency fingerprints based on a twin neural network in one embodiment;
[0036] Figure 5 Schematic diagram of the structure of a feature extraction module in one embodiment;
[0037] Figure 6 Schematic diagram of the structure of a similarity determination module in one embodiment;
[0038] Figure 7A structural schematic diagram of an image data enhancement module in an embodiment;
[0039] Figure 8 A schematic diagram of a data enhancement process in an embodiment;
[0040] Figure 9 A flowchart of a model training and data enhancement iteration strategy in an embodiment;
[0041] Figure 10 A flowchart of specific steps of a WiFi device radio frequency fingerprint identification method based on small sample image classification in an embodiment;
[0042] Figure 11 A structural block diagram of a WiFi device radio frequency fingerprint identification apparatus based on small sample image classification in an embodiment;
[0043] Figure 12 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0044] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0045] The WiFi device radio frequency fingerprint identification method based on small sample image classification provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 . The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0046] In an embodiment, as shown in Figure 2 , a WiFi device radio frequency fingerprint identification method based on small sample image classification is provided. Taking the server in Figure 1 as an example, the method includes the following steps:
[0047] S201: Obtain WiFi device signal data and perform preprocessing, convert the preprocessed WiFi device signal data into a time-frequency spectrum using short-time Fourier transform, and construct a small sample data set.
[0048] In the embodiment of the present application, first, a USRP N210 software radio platform is used as a receiver, and 34 WiFi network cards are selected as transmitting devices. WiFi signals are transmitted and collected through the IEEE 802.11a protocol at a relatively close distance indoors. The USRP device operates at a sampling rate of 20 MHz. For each device, 3.5 seconds of raw transmission data is collected for subsequent preprocessing.
[0049] Specifically, in one embodiment of the present application, the preprocessing includes frame detection, signal interception, and energy normalization.
[0050] In one embodiment of the present application, after data acquisition is completed, it is imported into Matlab for pre-processing operations such as frame detection, signal interception, and energy normalization. Specifically, the WiFi signal frame format transmitted by the IEEE 802.11a protocol is as follows: Figure 3 As shown, the long and short training sequences included in the signal preamble are used to detect the frame starting point in sequence, and the window length of 3440 including the preamble, signaling field and data field is set to intercept the signal. Each device selects 200 signal samples that meet the conditions and processes them using energy normalization.
[0051] Afterwards, the short-time Fourier transform is used to convert the pre-processed WiFi device signal data into a time-frequency spectrum diagram to construct a small sample data set. Specifically, the collected signals x(t) of 34 devices are processed in matlab to obtain 34*200*3440 signal data, where 200 means that 200 signals are selected for each device, and 3440 means the interception length of each signal. The WiFi signal is then converted into a time-frequency spectrum diagram s(t) through short-time Fourier transform. The transformed time-frequency spectrum diagram is then used to form a data set according to the device category, and is divided into a training set and a test set according to the requirements of the small sample scenario. Specifically, a training set n is selected according to each category. train , validation set n val , support set n sup and test set n test ,In order to meet the definition of a small sample scenario, we select 5 ,spectrograms from each category as training data, 5 as support sets, 40 as validation sets, and the remaining 150 as test sets.
[0052] In one embodiment of the present application, the formula for the short-time Fourier transform is:
[0053]
[0054] Where x(t) is the preprocessed WiFi device signal data, w(tm) is the window function, m is the time sliding parameter, ω is the frequency component, j is the imaginary unit, and t is time.
[0055] S203: Build a radio frequency fingerprint small sample image classification model based on the twin neural network, and design an image data enhancement module based on the autoencoder.
[0056] In an embodiment of the present application, a twin neural network is used to construct a radio frequency fingerprint small sample image classification model, and an image data enhancement module is designed based on an autoencoder.
[0057] Specifically, in one embodiment of the present application, the radio frequency fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module, wherein the feature extraction module is composed of 4 convolution modules, and the similarity discrimination module is composed of 3 fully connected layers.
[0058] In one embodiment of the present application, Figure 4 As shown in the figure, the constructed RF fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module, where Figure 5 As shown in the figure, the feature extraction module uses four convolution modules with channel numbers of 64, 128, 256, and 512 to extract deep features of the time spectrum graph. The specific process is shown in the following formula:
[0059] f i =F(s i ;θ)
[0060] Among them, F(s i ; θ) represents the operation of the feature extraction process, θ is a trainable parameter, f i It is the feature map representation after feature extraction.
[0061] Each convolution block includes a 3×3 convolution kernel, a ReLu activation function, and a 2×2 maximum pooling layer. The specific formula of each structure is as follows:
[0062] Convolutional layer:
[0063]
[0064] Among them, K h and K w are the height and width of the convolution kernel, W is the weight matrix of the convolution kernel, and b k is the bias, i, j, k are the row, column and channel indices of the output feature map respectively. This convolution operation can extract image features in local areas and is particularly suitable for capturing local patterns in time-frequency spectrograms.
[0065] Activation function:
[0066] f(x)=max(0,x)
[0067] The purpose of applying a nonlinear activation function after the convolution operation is to introduce nonlinear characteristics, prevent the model from overfitting, speed up calculations, and enable the network to learn more complex feature representations.
[0068] Pooling layer:
[0069]
[0070] Among them, P is the pooling window size. Through this operation, the spatial dimension of the feature map is gradually reduced while retaining the most significant features in each local area.
[0071] Through this hierarchical structural design, the network can gradually extract discriminative feature vectors from the input data for subsequent similarity calculations.
[0072] like Figure 6 As shown, the similarity discrimination module consists of three fully connected layers with gradually decreasing numbers of neurons. The first two fully connected layers are followed by a ReLu activation function to introduce nonlinearity, and the last fully connected layer is followed by a Sigmoid function to map the output to the (0, 1) interval, reflecting the similarity between samples. This designed similarity discrimination module allows the network to learn the optimal similarity measurement rules in a data-driven manner, rather than relying solely on predefined distance metrics. The network automatically adjusts weights and biases during training, ensuring that samples of the same category output higher similarity scores, while samples of different categories output lower similarity scores.
[0073] In one embodiment of the present application, the image data enhancement module is used for time-frequency spectrum feature extraction, transformation and restoration, and includes an encoder and a decoder, wherein the encoder is composed of 4 convolution modules and the decoder is composed of 4 transposed convolution modules.
[0074] In one embodiment of the present application, Figure 7As shown in the figure, the image data enhancement module consists of an encoder and a decoder. The encoder uses a structure similar to that of a twin neural network to ensure feature stability. It also uses four convolutional modules with 64, 128, 256, and 512 channels to extract features from the time-frequency spectrum. However, each convolutional block contains a 3×3 convolution kernel with a stride of 2 and a Relu activation function. The decoder adopts a symmetrical structure to the encoder and includes four transposed convolutional modules with 256, 128, 64, and 3 channels for feature restoration. The first three transposed convolutional layers are connected to a Relu activation function, and the last transposed convolutional layer is connected to a Sigmoid activation function.
[0075] S205: Pre-training the radio frequency fingerprint small sample image classification model and image data enhancement module using the small sample data set.
[0076] In the embodiment of the present application, based on the constructed radio frequency fingerprint small sample image classification model and image data enhancement module, a pre-training strategy is designed using a small sample data set to obtain the initial model parameters of the iterative process.
[0077] Specifically, in one embodiment of the present application, the pre-training of the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set includes:
[0078] S301: Initialize network parameters.
[0079] S303: Input the training samples into the image data enhancement module in batches, construct an image data enhancement loss function using a binary cross entropy loss function, and perform back propagation based on the image data enhancement loss function.
[0080] S305: Divide the training samples into a training set, a support set, and a validation set according to categories, and construct positive and negative sample pairs, which are then input into the radio frequency fingerprint small sample image classification model in batches, and a classification loss function is constructed using a binary cross entropy loss function, and back propagation is performed based on the classification loss function.
[0081] In one embodiment of the present application, the network parameters are initialized first, and the Adam optimization algorithm is used as the optimizer for training the two networks. When training the image data enhancement module, the training samples are input in batches, and backpropagation is performed based on the loss of each round. The loss function of the autoencoder model is a binary cross entropy loss function, which is specifically expressed as:
[0082]
[0083] Where X is the original input image, is the reconstructed image, n is the number of image pixels, and during the training process, the model is saved when the training loss is stable, which is recorded as
[0084] When training the RF fingerprint small sample image classification model, the training samples are divided into training set, support set, and validation set according to category, and positive and negative sample pairs are constructed. Then, they are input in batches and backpropagated according to the loss of each round. The loss function of the twin neural network model is the binary cross entropy loss function, which is specifically expressed as:
[0085] L SNN (y,D)=-[y·log(p)+(1-y)·log(1-p)]
[0086] Among them, y is the label of the sample pair (1 for positive sample pair, 0 for negative sample pair), p is the similarity probability of the model output, and D is the Euclidean distance between the feature vectors. During the training process, verification is performed and the model parameters with the highest accuracy on the verification set are saved and recorded as
[0087] S207: Expand samples based on the image data enhancement module, and perform screening using a pre-trained radio frequency fingerprint small sample image classification model.
[0088] In the embodiment of the present application, due to the lack of training samples in small sample scenarios, the model often leads to insufficient accuracy and poor stability. However, a large amount of data expansion at one time may introduce a lot of useless data. Therefore, a data enhancement strategy is designed based on the pre-trained image data enhancement module. For each category of data, a new time-frequency spectrum with feature diversity and noise robustness is obtained, and then input into the pre-trained radio frequency fingerprint small sample image classification model for testing and discrimination according to category. The time-frequency spectrum with correct discrimination is retained, and 30 samples are selected for each category to expand the training data. The number of training samples for each category after expansion is 35. Specifically, in one embodiment of the present application, the sample expansion based on the image data enhancement module includes image mixing, image masking, feature transformation and noise addition, such as Figure 8 As shown in Figure 2, it is a schematic diagram of the specific data enhancement process.
[0089] S209: The radio frequency fingerprint small sample image classification model is trained again using the expanded data set. After the training is completed, a test sample is input and a recognition result is output.
[0090] In the embodiment of the present application, the training data after data enhancement is expanded, and then the parameters of the trained radio frequency fingerprint small sample image classification model are loaded, and the Adam optimization algorithm is also used as the optimizer. The expanded training data is divided into positive and negative sample pairs, and input into the radio frequency fingerprint small sample image classification model in batches for a certain round of training. The binary cross entropy loss function is still used to calculate the loss for back propagation. During the training process, verification is performed according to a certain round, and the model parameters with the highest accuracy on the verification set are saved for subsequent data enhancement strategies and retraining processes. The specific iterative strategy is as follows Figure 9 As shown. At the same time, it is determined whether the model training and data enhancement strategies have reached the preset number of iterations. If not, the number of iterations is increased by one and the training set enhancement and model retraining are continued. If so, the trained twin neural network is saved, the test set data is classified, and the results are output.
[0091] In the above-mentioned WiFi device radio frequency fingerprint recognition method based on small sample image classification, first, WiFi device signal data is obtained and preprocessed, and the preprocessed WiFi device signal data is converted into a time-frequency spectrum using short-time Fourier transform to construct a small sample data set; then, a radio frequency fingerprint small sample image classification model is constructed based on a twin neural network, and an image data enhancement module is designed based on an autoencoder; then, the radio frequency fingerprint small sample image classification model and the image data enhancement module are pre-trained using the small sample data set; then, sample expansion is performed based on the image data enhancement module, and screening is performed using the pre-trained radio frequency fingerprint small sample image classification model; finally, the radio frequency fingerprint small sample image classification model is retrained using the expanded data set, and after training is completed, a test sample is input and a recognition result is output. Specifically, the method utilizes spectrograms as feature representations of RF fingerprints and designs a small-sample spectrogram classification model based on a twin neural network. Through training, it effectively learns the feature representations of samples and the similarity metric between categories. Furthermore, a data augmentation strategy for image feature extraction, transformation, and restoration based on autoencoders is designed to generate new spectrograms with both feature diversity and noise robustness. Furthermore, through an iterative strategy of model training and data augmentation, a highly effective small-sample image classification model for RF fingerprints is developed, achieving high classification accuracy with relatively few training samples. This improves the accuracy of RF fingerprint recognition for WiFi devices under small sample conditions.
[0092] The following is a specific example to illustrate the specific implementation steps of the WiFi device radio frequency fingerprint recognition method based on small sample image classification of this application. Figure 10As shown, first, S401, obtain WiFi device signal data and preprocess it, and use short-time Fourier transform to convert the preprocessed WiFi device signal data into a time-frequency spectrum to construct a small sample data set. Specifically, S403, the preprocessing includes frame detection, signal interception and energy normalization. S405, the formula of the short-time Fourier transform is:
[0093]
[0094] Where x(t) is the preprocessed WiFi device signal data, w(tm) is the window function, m is the time sliding parameter, ω is the frequency component, j is the imaginary unit, and t is time.
[0095] Next, in S407, a small-sample RF fingerprint image classification model is constructed based on a twin neural network, and an image data enhancement module is designed based on an autoencoder. Specifically, in S409-S411, the small-sample RF fingerprint image classification model includes a feature extraction module and a similarity determination module. The feature extraction module is composed of four convolutional modules, and the similarity determination module is composed of three fully connected layers. The image data enhancement module is used for time-frequency spectrum feature extraction, transformation, and restoration, and includes an encoder and a decoder. The encoder is composed of four convolutional modules, and the decoder is composed of four transposed convolutional modules.
[0096] Then, in S413, the small sample dataset is used to pre-train the RF fingerprint small sample image classification model and image data enhancement module. Specifically, in S415-S419, network parameters are initialized; training samples are input into the image data enhancement module in batches, an image data enhancement loss function is constructed using a binary cross-entropy loss function, and backpropagation is performed based on the image data enhancement loss function; the training samples are divided into a training set, a support set, and a validation set by category, and positive and negative sample pairs are constructed. These are then input into the RF fingerprint small sample image classification model in batches, a classification loss function is constructed using a binary cross-entropy loss function, and backpropagation is performed based on the classification loss function.
[0097] Next, in step S421, a data enhancement strategy is designed, and a pre-trained RF fingerprint small sample image classification model is used to screen and expand samples. In step S423, sample expansion based on the image data enhancement module includes image blending, image masking, feature transformation, and noise addition. Finally, in step S425, the RF fingerprint small sample image classification model is retrained using the expanded dataset. After training is complete, a test sample is input and the recognition result is output.
[0098] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0099] Based on the same inventive concept, embodiments of the present application also provide a small-sample image classification-based WiFi device RF fingerprint recognition device for implementing the aforementioned small-sample image classification-based WiFi device RF fingerprint recognition method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the WiFi device RF fingerprint recognition device based on small-sample image classification provided below can be found in the above-mentioned limitations of the WiFi device RF fingerprint recognition method based on small-sample image classification, and will not be repeated here.
[0100] In one embodiment, Figure 11 As shown, a WiFi device radio frequency fingerprint recognition device 1100 based on small sample image classification is provided, comprising: a small sample data set construction module 1101, a model construction module 1103, a model pre-training module 1105, a data enhancement module 1107 and a radio frequency fingerprint recognition module 1109, wherein:
[0101] The small sample data set construction module 1101 is used to obtain and preprocess WiFi device signal data, convert the preprocessed WiFi device signal data into a time-frequency spectrum using short-time Fourier transform, and construct a small sample data set.
[0102] The model construction module 1103 is used to build a radio frequency fingerprint small sample image classification model based on the twin neural network and design an image data enhancement module based on the autoencoder.
[0103] The model pre-training module 1105 is used to pre-train the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set.
[0104] The data enhancement module 1107 is used to design a data enhancement strategy and use a pre-trained radio frequency fingerprint small sample image classification model to perform sample screening and expansion.
[0105] The radio frequency fingerprint identification module 1109 is configured to retrain the radio frequency fingerprint small sample image classification model by using the expanded data set, input test samples after the training is completed, and output a recognition result.
[0106] In an embodiment of the present application, the preprocessing includes frame detection, signal interception, and energy normalization.
[0107] In an embodiment of the present application, the formula of the short-time Fourier transform is as follows:
[0108]
[0109] wherein x(t) is the WiFi device signal data after preprocessing, w(t-m) is a window function, m is a sliding parameter of time, ω is a frequency component, j is an imaginary unit, and t is time.
[0110] In an embodiment of the present application, the radio frequency fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module, wherein the feature extraction module is composed of four convolution modules, and the similarity discrimination module is composed of three fully connected layers.
[0111] In an embodiment of the present application, the image data enhancement module is configured to time-frequency spectrum feature extraction, transformation, and restoration, and includes an encoder and a decoder, wherein the encoder is composed of four convolution modules, and the decoder is composed of four transposed convolution modules.
[0112] In an embodiment of the present application, the pre-training of the radio frequency fingerprint small sample image classification model and the image data enhancement module by using the small sample data set includes:
[0113] initializing network parameters;
[0114] inputting training samples into the image data enhancement module in batches, constructing an image data enhancement loss function by using a binary cross-entropy loss function, and performing back propagation based on the image data enhancement loss function;
[0115] dividing the training samples into a training set, a support set, and a validation set according to categories, constructing positive and negative sample pairs, inputting the radio frequency fingerprint small sample image classification model in batches, constructing a classification loss function by using a binary cross-entropy loss function, and performing back propagation based on the classification loss function.
[0116] In an embodiment of the present application, the sample expansion based on the image data enhancement module includes image mixing, image masking, feature transformation, and adding noise.
[0117] The modules in the WiFi device radio frequency fingerprint identification device based on small sample image classification can be realized by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so that the processor can call and execute the operations of the modules.
[0118] In one embodiment, a computer device, which can be a terminal, has an internal structure as shown in Figure 12 The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved by WIFI, mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement a WiFi device radio frequency fingerprint identification method based on small sample image classification. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad arranged on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0119] Those skilled in the art can understand that Figure 12 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not limit the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0120] In one embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program. The processor executes the computer program to implement the steps in the above method embodiments.
[0121] In one embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0122] In one embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0123] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0124] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0125] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present disclosure.
[0126] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A WiFi device radio frequency fingerprint recognition method based on small sample image classification, characterized in that: The method comprises: Obtain and preprocess WiFi device signal data, convert the preprocessed WiFi device signal data into a time-frequency spectrum using short-time Fourier transform, and construct a small sample data set; Build a small sample image classification model for RF fingerprints based on a twin neural network, and design an image data enhancement module based on an autoencoder; Pre-training the radio frequency fingerprint small sample image classification model and image data enhancement module using the small sample data set; Sample expansion is performed based on the image data enhancement module, and screening is performed using a pre-trained radio frequency fingerprint small sample image classification model; The radio frequency fingerprint small sample image classification model is trained again using the expanded data set, and after the training is completed, the test sample is input and the recognition result is output; The constructed RF fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module. The feature extraction module uses four convolution modules with channel numbers of 64, 128, 256, and 512 to perform deep feature extraction of the time spectrum graph. The specific process is shown in the following formula: in, represents the operation of the feature extraction process, are trainable parameters, It is the feature map representation after feature extraction; Each convolution block includes a 3×3 convolution kernel, a ReLu activation function, and a 2×2 maximum pooling layer. The specific formula of each structure is as follows: Convolutional layer: in, and are the height and width of the convolution kernel, is the weight matrix of the convolution kernel, is the bias, are the row, column, and channel indices of the output feature map, respectively. This convolution operation can extract image features in local areas and is particularly suitable for capturing local patterns in time-spectrograms. Activation function: The nonlinear activation function is applied after the convolution operation to introduce nonlinear characteristics, prevent the model from overfitting and speed up the calculation, so that the network can learn more complex feature representations; Pooling layer: in, is the pooling window size, through which the spatial dimension of the feature map is gradually reduced while retaining the most significant features in each local area; The similarity discrimination module is composed of three fully connected layers with gradually decreasing number of neurons. The first two fully connected layers are connected with ReLu activation function to introduce nonlinearity. The last fully connected layer is connected with Sigmoid function to map the output to the interval (0, 1) to reflect the similarity between samples. The pre-training of the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set includes: Initialize network parameters; Inputting training samples into the image data enhancement module in batches, constructing an image data enhancement loss function using a binary cross entropy loss function, and performing backpropagation based on the image data enhancement loss function; The training samples are divided into a training set, a support set, and a validation set according to categories, and positive and negative sample pairs are constructed. The positive and negative sample pairs are then input into the radio frequency fingerprint small sample image classification model in batches. A classification loss function is constructed using a binary cross entropy loss function, and back propagation is performed based on the classification loss function.
2. The method for identifying radio frequency fingerprints of WiFi devices based on small sample image classification according to claim 1, characterized in that: The preprocessing includes frame detection, signal interception and energy normalization.
3. The WiFi device radio frequency fingerprint recognition method based on small sample image classification according to claim 1 is characterized in that: The formula for the short-time Fourier transform is: in, It is the WiFi device signal data after preprocessing, is a window function, is the sliding parameter of time, is the frequency component, is an imaginary unit, It's time.
4. The method for identifying radio frequency fingerprints of WiFi devices based on small sample image classification according to claim 1, characterized in that: The radio frequency fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module, wherein the feature extraction module is composed of four convolution modules, and the similarity discrimination module is composed of three fully connected layers.
5. The method for identifying radio frequency fingerprints of WiFi devices based on small sample image classification according to claim 1, characterized in that: The image data enhancement module is used for time-frequency spectrum feature extraction, transformation and restoration, and includes an encoder and a decoder, wherein the encoder is composed of 4 convolution modules and the decoder is composed of 4 transposed convolution modules.
6. The method for identifying radio frequency fingerprints of WiFi devices based on small sample image classification according to claim 1, characterized in that: The sample expansion based on the image data enhancement module includes image mixing, image masking, feature transformation and noise addition.
7. A WiFi device radio frequency fingerprint recognition device based on small sample image classification, characterized in that: The device comprises: A small sample data set construction module is used to obtain and preprocess WiFi device signal data, convert the preprocessed WiFi device signal data into a time-frequency spectrum using short-time Fourier transform, and construct a small sample data set; A model building module is used to build a small-sample RF fingerprint image classification model based on a twin neural network and design an image data enhancement module based on an autoencoder; A model pre-training module, configured to pre-train the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set; A data enhancement module, configured to perform sample expansion based on the image data enhancement module and perform screening using a pre-trained radio frequency fingerprint small sample image classification model; The radio frequency fingerprint recognition module is used to retrain the radio frequency fingerprint small sample image classification model using the expanded data set, input the test sample after training, and output the recognition result; The constructed RF fingerprint small sample image classification model includes a feature extraction module and a similarity discrimination module. The feature extraction module uses four convolution modules with channel numbers of 64, 128, 256, and 512 to perform deep feature extraction of the time spectrum graph. The specific process is shown in the following formula: in, represents the operation of the feature extraction process, are trainable parameters, It is the feature map representation after feature extraction; Each convolution block includes a 3×3 convolution kernel, a ReLu activation function, and a 2×2 maximum pooling layer. The specific formula of each structure is as follows: Convolutional layer: in, and are the height and width of the convolution kernel, is the weight matrix of the convolution kernel, is the bias, are the row, column, and channel indices of the output feature map, respectively. This convolution operation can extract image features in local areas and is particularly suitable for capturing local patterns in time-spectrograms. Activation function: The nonlinear activation function is applied after the convolution operation to introduce nonlinear characteristics, prevent the model from overfitting and speed up the calculation, so that the network can learn more complex feature representations; Pooling layer: in, is the pooling window size, through which the spatial dimension of the feature map is gradually reduced while retaining the most significant features in each local area; The similarity discrimination module is composed of three fully connected layers with gradually decreasing number of neurons. The first two fully connected layers are connected with ReLu activation function to introduce nonlinearity. The last fully connected layer is connected with Sigmoid function to map the output to the interval (0, 1) to reflect the similarity between samples. The pre-training of the radio frequency fingerprint small sample image classification model and the image data enhancement module using the small sample data set includes: Initialize network parameters; Inputting training samples into the image data enhancement module in batches, constructing an image data enhancement loss function using a binary cross entropy loss function, and performing backpropagation based on the image data enhancement loss function; The training samples are divided into a training set, a support set, and a validation set according to categories, and positive and negative sample pairs are constructed. The positive and negative sample pairs are then input into the radio frequency fingerprint small sample image classification model in batches. A classification loss function is constructed using a binary cross entropy loss function, and back propagation is performed based on the classification loss function.
8. 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 method according to any one of claims 1 to 6 are implemented.
9. 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 the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
IFF signal identification method and device based on radio frequency fingerprint, and medium
CN113905383A
Small sample radio frequency fingerprint intelligent identification system and method
CN114980122A