Unsupervised multi-user physical layer authentication method based on twin converter neural network
By constructing a lightweight twin Transformer model CSI-UST and using CSI data from legitimate devices for unsupervised training, the model complexity and scalability issues of multi-user authentication in dynamic wireless scenarios are solved, achieving high accuracy and low complexity physical layer authentication, which is suitable for IoT devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
Existing physical layer authentication schemes based on CSI suffer from problems in dynamic wireless scenarios, such as difficulty in obtaining CSI data from unauthorized devices, complex model structures, and insufficient dynamic scalability, resulting in high deployment costs and insufficient authentication accuracy and robustness.
An unsupervised multi-user physical layer authentication method based on Siamese Transformer neural network is adopted. By constructing a lightweight Siamese Transformer model CSI-UST, unsupervised training is performed using legitimate device CSI data to extract short-time invariant features of CSI, and a dynamic sample update mechanism is designed to achieve reliable authentication and environmental adaptation for multiple users.
It significantly improves the accuracy and robustness of multi-user physical layer authentication without requiring the acquisition of illegal device CSI data and retraining model parameters, while reducing model complexity and computational overhead, making it suitable for resource-constrained IoT devices.
Smart Images

Figure QLYQS_1 
Figure QLYQS_2 
Figure QLYQS_3
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of wireless communication and information security technology, in particular to physical layer authentication, and specifically to an unsupervised multi-user physical layer authentication method based on twin transformer neural network. BACKGROUND
[0002] The rapid development of wireless communication technology greatly enhances the flexibility and mobility of Internet of Things devices, but also brings more severe information security challenges. In an open wireless environment, how to reliably identify the identity of the access device while ensuring the confidentiality, integrity and availability of data has become an important research problem in the field of wireless security.
[0003] At present, traditional encryption technology, secure socket layer protocol and digital signature mechanism have been widely used in the Internet and other communication networks to ensure the secure transmission of sensitive data. However, such schemes based on upper layer protocols and key management have high deployment and maintenance costs in large-scale, highly dynamic, and key distribution difficult Internet of Things scenarios, and are vulnerable to key leakage and other problems.
[0004] Physical layer authentication identifies the identity of the device by utilizing the physical layer characteristics of the wireless channel or radio frequency hardware fingerprint, serving as a powerful supplement to traditional authentication mechanisms. Physical layer authentication schemes can generally be divided into two categories: key-based and keyless. Keyless channel authentication schemes use Channel State Information (CSI) for statistical decision-making, becoming a research hotspot in recent years. Existing research has shown that the introduction of deep learning technology can significantly improve the accuracy and robustness of physical layer authentication in complex time-varying environments.
[0005] To improve the impact of channel time variation on physical layer authentication performance, some research uses generative adversarial networks to predict the next time CSI of a mobile legitimate transmitter, thereby improving authentication performance. Other works construct deep learning binary classification models based on the CSI fingerprints of legitimate and illegitimate devices, or implement multi-device authentication through a multi-user deep neural network architecture. However, these schemes generally have the following limitations: they rely on the idealized assumption of illegitimate device CSI data; the model structure is complex and has a large number of parameters; they lack dynamic expansion capability for new users; and they are heavily dependent on large amounts of labeled data. Therefore, how to develop an unsupervised physical layer authentication method that relies only on legitimate device CSI data, deploys a lightweight model on resource-constrained platforms, and has multi-user dynamic expansion capability in dynamic wireless scenarios has become a challenging and urgent problem. SUMMARY
[0006] The present application aims at the problems of difficulty in obtaining CSI data of illegal equipment, complex model structure and insufficient dynamic expansion capability in existing CSI-based physical layer authentication schemes, and proposes an unsupervised multi-user physical layer authentication method based on Siamese Transformer for dynamic scenes, which realizes reliable authentication of multiple users under the premise of training only with CSI data of legal equipment, and takes into account high accuracy, low model complexity and robustness to complex dynamic environments. By constructing a keyless channel authentication framework suitable for dynamic scenes, introducing a Siamese Transformer model (CSI-UST) using CSI short-time invariance features, and designing a dynamic sample updating mechanism, the present application can realize online expansion of user set and continuous adaptation to environmental changes without updating model parameters, effectively reducing authentication error rate and application abandonment rate, and significantly improving the engineering practicability of physical layer authentication.
[0007] The purpose of the present application is achieved as follows:
[0008] Firstly, a dynamic multi-user wireless communication system model containing multiple mobile legal senders, one mobile attacker and one stationary legal receiver is constructed, the receiver estimates the CSI of each sender within a continuous transmission time slot, and based on channel spatial decorrelation and coherence time theory, extracts CSI short-time invariance features suitable for dynamic scenes. Then, the collected CSI data is vectorized, frequency domain amplitude is extracted and normalized, and a data set for unsupervised training is constructed. Based on the data set, a lightweight Siamese Transformer model CSI-UST is designed, the Backbone of which mainly consists of linear embedding, scaling, position encoding and multi-layer Transformer encoder, a compact CSI feature representation is obtained through global pooling, and unsupervised training is carried out under the Siamese network structure using a contrastive loss function, only using the CSI data of legal equipment to construct positive and negative sample pairs. In the authentication stage, the receiver uses the trained CSI-UST model to map the current CSI sample and the historical legal CSI sample to the feature space, calculates the Euclidean distance of the features, and makes a "same device / not same device" decision based on a preset threshold; combined with the dynamic sample updating method, the historical CSI sample is updated and eliminated by setting a timeliness threshold, realizing continuous adaptation to channel time variation and new equipment access, thereby constructing a multi-user scalable physical layer authentication scheme UMUST for dynamic scenes.
[0009] The specific mode is as follows:
[0010] An unsupervised multi-user physical layer authentication method based on Siamese Transformer neural network, comprising the following steps:
[0011] Step 1, constructing a system model and a CSI collection framework, a dynamic multi-user wireless communication system model is constructed, which includes N mobile legitimate senders, one mobile attacker and one stationary legitimate receiver. Each sender and receiver communicates in a multipath propagation environment. The receiver estimates the channel in each time slot through the training sequence to obtain the corresponding CSI data, which is used to distinguish between legitimate senders and attackers, and to identify specific legitimate devices;
[0012] Step 2, CSI data preprocessing and feature construction, the original CSI complex tensor collected by the receiver in each environment is vectorized, the frequency domain amplitude feature is extracted, and each sample is normalized to construct a normalized frequency domain amplitude dataset. Combining the theoretical analysis of Doppler shift and coherence time, the short-time similarity between adjacent timestamp CSI samples is used as the basis for subsequent twin network contrast learning;
[0013] Step 3, constructing a twin transformer neural network model CSI-UST, a lightweight twin Transformer model CSI-UST is constructed for the short-time invariance feature of CSI data. The Backbone of this model consists of a linear embedding layer, a scaling operation, a position encoding, and several layers of Transformer encoder, which is used to extract high-dimensional features of CSI sequence. A fixed-length feature vector is generated through global pooling, and the feature pair is output in the twin network structure to calculate the Euclidean distance between samples;
[0014] Step 4, unsupervised training based on contrastive loss, only using the CSI data collected by the legitimate device to construct positive and negative sample pairs in a dynamic environment: adjacent timestamp CSI samples are used to form positive sample pairs, and non-adjacent timestamp CSI samples are used to form negative sample pairs; the sample pairs are input into the twin network CSI-UST, and the contrastive loss function is used to optimize the model parameters, to narrow the feature distance of positive samples and to widen the feature distance of negative samples, realizing the joint modeling of CSI short-time invariance and device difference;
[0015] Step 5, online authentication decision based on CSI-UST, in the authentication stage, the receiver preprocesses the CSI from unknown devices in the same way as in the training stage, and inputs it into the CSI-UST model with the historical CSI samples of each legitimate device to obtain the corresponding feature distance. When there is a legitimate device whose feature distance with the current CSI sample is less than the preset decision threshold, it is determined that the sample comes from the legitimate device, and the historical CSI sample of the corresponding device is updated; when the feature distances of all legitimate devices are greater than the decision threshold, the sample is considered to come from the attacker or new device, triggering the supplementary authentication process;
[0016] Step 6, dynamic sample update and multi-user expansion, based on the set timeliness threshold, when the time interval of historical CSI samples exceeds the threshold, the old samples are discarded and new CSI samples are retained or added to ensure that the CSI features used in the authentication process can reflect the current channel state; when the supplementary authentication confirms that an unknown device is a new legal device, it is added to the legal device set and its CSI sample is recorded, realizing the dynamic expansion of the multi-user set without retraining the model parameters, thereby constructing an unsupervised multi-user physical layer authentication scheme facing dynamic scenarios.
[0017] Further, in step 1, the multi-user wireless communication system includes N+2 devices, i.e. N mobile legitimate sending ends A j , 1 mobile attacker E and 1 stationary legitimate receiving end Bob. Bob receives the training sequence in each time slot and estimates the channel response of the current time slot and compares it with the legal channel response recorded in the last time slot. When and are similar in the feature space, it is determined that the signal comes from the same legal device, otherwise it is considered as a fake signal or from other devices.
[0018] Further, in step 2, the original CSI data obtained by the receiving end at each time t is represented as a complex tensor H tensor (t), which is processed by vectorization to obtain a complex vector H vector (t), and the frequency domain amplitude is represented as:
[0019]
[0020] where Real(·) and Imag(·) represent the real part and the imaginary part of the complex number respectively. Normalization is performed on each sample to obtain a normalized amplitude vector:
[0021]
[0022] where H max,amp (t) and H min,amp (t) represent the maximum and minimum values of the amplitude within the sample respectively.
[0023] Further, in step 2, the channel short-time invariance feature is described by using the relationship between Doppler shift and coherence time T c , which is approximately expressed as:
[0024]
[0025] where the Doppler shift f d is given by:
[0026]
[0027] The signal wavelength λ is represented as:
[0028]
[0029] Where c is the speed of light, f c Let f be the carrier frequency, and υ be the relative velocity between the transmitter and receiver. Combining the above relationships, at carrier frequency f... c In a scenario with a frequency of 2.4 GHz and a relative speed of υ = 2 m / s, the coherence time is approximately 26.4 ms. The interval between adjacent CSI samples collected during the coherence time is less than this value, thereby ensuring that adjacent samples have high similarity.
[0030] Furthermore, in step 3, the normalized CSI amplitude vector H(t) is transformed into the model feature space through a linear embedding layer:
[0031] H emb (t)=W·H(t)+b
[0032] in, Let b be the weight matrix, b be the bias vector, and d be the bias vector. model For the embedding dimension. Then, the embedding results are processed according to... Scaling:
[0033]
[0034] And superimpose the sine-cosine position code PE(pos):
[0035]
[0036] The location encoding takes the following form:
[0037]
[0038] Where pos is the position index and i is the dimension index.
[0039] Furthermore, in step 3, the Transformer encoder consists of a multi-head self-attention layer and a feedforward network (FFN). The multi-head self-attention calculation process is as follows:
[0040]
[0041] Where Q, K, and V are the query, key, and value, respectively, and d k =d model / h, where h is the number of attention heads. The outputs of multiple attention heads are concatenated and linearly mapped to obtain:
[0042] MultiHead(X)=Concat(head1,...,head h )·W o
[0043] The transformer encoder layer obtains stable output through a residual connection and layer normalization, and finally maps sequence features into a fixed length feature vector f through global average pooling.
[0044] Further, in the step 4, the twin network is composed of two Backbones with the same structure and shared parameters, and outputs feature vectors f1 and f2 respectively, and the Euclidean distance of the two is:
[0045] d=||f1-f2||2
[0046] The contrast loss function is defined as:
[0047] Loss=Y·d 2 +(1-Y)·max(0,M-d) 2
[0048] Wherein, Y is a sample pair label, Y is 1 when Y is 1, and the loss term d 2 Encourage the feature distance to be small; when Y is 0, it is a negative sample pair, and when d is less than M, the loss is (M-d) 2 , so as to make the feature distance at least greater than the margin M. The positive sample pair is composed of adjacent time stamp CSI samples, and the negative sample pair is composed of non-adjacent time stamp samples.
[0049] Further, in the step 5, the authentication decision rule is: when the distance d between the to-be-authenticated CSI sample and the historical CSI sample of a certain legal device in the feature space is less than the preset decision threshold θ, it is determined that the legal device comes from the legal device, and the current sample is added to the historical CSI set of the device; when the distance between the to-be-authenticated CSI sample and all legal device historical CSI samples is greater than θ, it is determined that the sample is an attacker or a new device, and whether it is added to the legal device set is decided according to the upper layer supplementary authentication result.
[0050] Further, in the step 6, a timeliness threshold t θ is introduced to control the effective time length of the historical CSI sample, when the recording time interval satisfies t1-t0>t θ , the historical sample corresponding to t0 is eliminated, and only the newer CSI sample is retained, so as to ensure that the features used in the authentication process can represent the current channel state.
[0051] The positive effects of the application are:
[0052] The application designs a lightweight twin transformer neural network model CSI-UST by utilizing the short-time invariance characteristics of channel state information in dynamic scenes, with the optimization goal of improving the correctness and robustness of multi-user physical layer authentication, only relying on the CSI data of the legal device to construct contrast learning samples, realizing efficient representation of CSI features, and on this basis, constructing an extensible multi-user physical layer authentication scheme UMUST, which completes multi-user authentication and rapid access of new devices without obtaining illegal device CSI data and without retraining model parameters. This method not only realizes higher authentication accuracy and lower false alarm rate and missed detection rate in various dynamic LoS and non-LoS scenes, but also significantly reduces the model parameter amount and computational overhead, improving the deployment feasibility and engineering application value on resource-constrained Internet of Things devices. BRIEF DESCRIPTION OF DRAWINGS DETAILED DESCRIPTION OF THE INVENTION BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 A flowchart of a multi-user physical layer authentication scheme UMUST based on CSI-UST in an embodiment of the application.
[0054] Figure 2 A structure diagram of a dynamic multi-user wireless communication system model in an embodiment of the application.
[0055] Figure 3 A comparison diagram of CSI frequency domain amplitude characteristics in static and dynamic scenes in an embodiment of the application.
[0056] Figure 4 A structure diagram of a lightweight model CSI-UST based on twin Transformer in an embodiment of the application. DETAILED DESCRIPTION OF THE INVENTION
[0057] The specific embodiments of the application will be further described in detail below with reference to the accompanying drawings.
[0058] As shown in Figure 1 , the application provides a multi-user physical layer authentication scheme UMUST based on CSI-UST, which runs in a dynamic multi-user wireless communication system, and the system model is as shown in Figure 2 ; the scheme first collects and analyzes the amplitude characteristics of channel state information (CSI) in a dynamic scene, as shown in Figure 3 , and on this basis, constructs a twin Transformer lightweight model CSI-UST as shown in Figure 4 , and completes multi-user physical layer authentication and dynamic sample update based on the model, specifically including the following steps:
[0059] Step 1, in the target application scene, establish a model as shown in Figure 2The dynamic multi-user wireless communication system model is shown, which includes several legitimate senders in a mobile state, at least one attacker in a mobile state, and a stationary or slowly moving legitimate receiver Bob. The legitimate sender and Bob are in a legitimate communication link, and the attacker tries to disguise as a certain legitimate sender to send a fake signal to Bob. In this system, Bob obtains the corresponding channel state information (CSI) by receiving the training sequence data packets of each sending device, and uses it as the basic feature of subsequent physical layer authentication. At the same time, the system operates in a dynamic environment with significant multipath propagation and Doppler effect to reflect the real wireless communication scene;
[0060] Step 2, in the established system, control the legitimate sender and the attacker to send data packets to Bob periodically in different dynamic scenes, and the receiver obtains the original CSI data by using the existing CSI acquisition tool. The continuously acquired CSI data is stored in time sequence to obtain the original CSI data sequence. The original CSI data is preprocessed, including: extracting the frequency domain amplitude information from the complex CSI to form the CSI amplitude sequence; normalizing each CSI amplitude data to make the CSI samples in different time and different environments comparable. The preprocessed CSI amplitude data is used to analyze the short-time invariance feature in the dynamic scene, and is used as the input of model training and authentication;
[0061] Step 3, on the basis of the obtained preprocessed CSI amplitude sequence, two CSI amplitude data of the same legitimate device within adjacent time stamps are selected to form a positive sample pair, and CSI data with a large time interval is selected to form a negative sample pair. In this way, a large number of sample pair data sets labeled as "CSI of the same device in a short time" (positive sample) and "CSI of different time or different device" (negative sample) are constructed. The above sample pairs will be used to train the twin Transformer model, so that the model can pull the CSI representation of the same stable channel state closer in the feature space, and pull the CSI representation of different channel states or different devices farther away, thereby learning the discriminative physical layer fingerprint feature without relying on the CSI of illegal devices;
[0062] Step 4, on the basis of the constructed sample pair data set, a model as shown in Figure 4The twin Transformer lightweight model CSI-UST is shown. The model includes two weight-shared branches, each of which takes the preprocessed CSI amplitude vector as input, goes through linear embedding, position encoding, and several layers of Transformer encoder, and outputs a fixed-length feature vector; for two CSI inputs from the same sample pair, two feature vectors are obtained respectively, and the Euclidean distance is calculated. Through the contrast loss function, the CSI-UST is unsupervised training, so that the feature distance of the positive sample pair is as small as possible, and the feature distance of the negative sample pair is greater than the set margin. After training, the CSI-UST can be used as a unified network for feature extraction and similarity measurement for subsequent multi-user physical layer authentication.
[0063] Step 5, deploy the CSI-UST model trained to the receiving end Bob to form the UMUST authentication process as shown in Figure 1 The UMUST authentication process is shown. When Bob receives the training sequence data packet from an unknown sending device, it performs CSI estimation and preprocessing to obtain the CSI amplitude sample to be authenticated. Bob selects representative CSI samples from the locally stored historical CSI sample set of the legitimate sending end, and forms sample pairs with the to-be-authenticated sample one by one, and sends them into the CSI-UST model to calculate the feature distance. According to the pre-set decision threshold, compare the distance results and output the authentication result: if the distance corresponding to a certain legal device is less than the threshold, it is determined that the to-be-authenticated sample comes from the legal device; if the distances of all legal devices are not less than the threshold, it is determined that the sample does not belong to the existing legal device, and further processing is needed in combination with the upper layer mechanism;
[0064] Step 6, in the authentication process of step 5, to adapt to the characteristics of channel changes over time in dynamic scenarios, Bob dynamically updates the historical CSI samples of the legitimate sending end. For the samples that pass the authentication, they are added to the CSI library of the corresponding legal device; when the time interval of the historical samples exceeds the set timeliness threshold, the outdated samples are eliminated from the CSI library to ensure that the CSI library always reflects the current channel state. When step 5 determines that a CSI sample does not belong to the existing legal device, the system can trigger the upper layer supplementary authentication process (such as key-based or application layer identity authentication). In the case of confirming the legality of the new device through supplementary authentication, the device is marked as a new legal sending end, and a corresponding CSI historical sample library is established to include it in the subsequent physical layer authentication range of the UMUST scheme.
[0065] Further, in step 1, the dynamic multi-user wireless communication system adopts 2.4 GHz frequency band, 20 MHz channel bandwidth, and conforms to the IEEE 802.11n standard; both the transmitting end and the receiving end can adopt a general notebook terminal equipped with an Intel WiFi Link 5300 network card, the number of antennas of the receiving end Bob is 3, the number of antennas of the legal transmitting end and the attacker is 3, the physical layer adopts an OFDM system, the total number of subcarriers is 64, of which 48 are data subcarriers, 4 are pilot subcarriers, and 12 are guard subcarriers, and the subcarriers are divided into 30 subcarrier groups according to the agreement of the hardware acquisition tool, and the CSI is output in the form of a matrix.
[0066] Further, in step 2, the original CSI is given in the form of a complex number, and each CSI sample is organized as a complex vector with dimensions (N x R x T), where N is the number of subcarrier groups, R is the number of receiving antennas, and T is the number of transmitting antennas. During preprocessing, the amplitude of the complex vector is calculated first, and then linear normalization is performed on each amplitude sample according to the maximum and minimum values within the sample, so as to map the amplitude range to the interval [0, 1] and eliminate the scale differences caused by different acquisition batches and different channel gains.
[0067] Further, in step 3, in order to fully utilize the short-time invariance of the wireless channel within the coherence time, under the condition that the device moving speed is about 2 m / s and the carrier frequency is about 2.4 GHz, the coherence time is about 20 ms to 30 ms; the transmitting end sends data packets to the receiving end at a frequency of 1000 Hz, and the time interval between adjacent CSI samples is less than 1 ms, which is significantly smaller than the coherence time, so adjacent timestamp samples can be considered to be in the same stable channel state. When constructing positive sample pairs, CSI samples with a time interval of 1 sampling period are preferably selected, and when constructing negative sample pairs, CSI samples with a time interval greater than several sampling periods or CSI samples from different devices are preferably selected.
[0068] Further, in step 4, the linear embedding layer in the CSI-UST model maps the input CSI amplitude vector to a feature space with dimensions d model , and d model is preferably set to 8; the position encoding adopts a sine-cosine form to represent the subcarrier index, which is used to help the Transformer capture the correlation between different subcarriers of the CSI; the Transformer encoder is preferably set to 1 layer, and the number of heads of the multi-head self-attention is preferably set to 8, so as to greatly reduce the parameter amount while maintaining the representation ability. After completing the multi-head attention and feedforward network calculation, a fixed-length feature vector is obtained through global average pooling, and all the above parameters are shared in the twin structure, so that the overall model parameter amount is controlled at about 3000 levels, which is suitable for deployment on resource-limited terminals.
[0069] Further, in step 4, the marginal value M in the contrast loss function is preferably set to 1.0; during the training process, a random gradient descent type optimization algorithm is used to constrain the feature distance of positive sample pairs to approach 0 and the feature distance of negative sample pairs to be no less than 1.0, thereby forming a clear class interval in the feature space. During training, sample pairs with a batch size of tens to hundreds can be selected, and the iteration round is stopped adaptively according to the performance of the validation set to avoid overfitting.
[0070] Further, in step 5, to achieve multi-user authentication, the receiving end Bob maintains one or more reference CSI samples for each legitimate sending end for comparison with the current to-be-authenticated sample. After calculating the feature distance between the to-be-authenticated sample and each reference sample using CSI-UST, the minimum distance is taken as the similarity measure of the legitimate device, and compared with the decision threshold; the decision threshold is preferably set in the range of 0.4-0.8, and when the threshold is 0.5 under the condition of high signal-to-noise ratio, the false alarm rate can be effectively suppressed while ensuring a low false alarm rate, achieving a balance between accuracy and security.
[0071] Further, in step 6, the timeliness threshold of historical CSI samples is set according to the sampling frequency and the channel variation speed, and one of the two forms of "sample number" or "time length" is preferably used, for example, when the sample time interval exceeds several tens of milliseconds or exceeds several tens of sampling periods, the sample is considered to be too old and is deleted from the CSI library. When a new device is expanded, its CSI samples can be collected in a longer time window first, and after completing the upper-layer identity authentication, the confirmed samples are written into the CSI library and participate in subsequent physical layer authentication, thereby dynamically expanding the set of authenticated users without modifying the CSI-UST network parameters.
Claims
1. An unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network, characterized in that, Includes the following steps: Step 1: Establish a dynamic multi-user wireless communication system in the target application scenario. In the system, set up multiple legitimate transmitters in a mobile state, at least one attacker in a mobile state, and a legitimate receiver. The legitimate receiver is used to receive training sequence data packets sent by each transmitter and estimate the corresponding Channel State Information (CSI). Step 2: Perform CSI acquisition on the training sequence data packets sent by the legitimate sender at multiple time points to obtain the original CSI data sequence arranged in chronological order, and preprocess each original CSI data. The preprocessing includes at least: expanding the complex CSI into a complex vector, calculating the frequency domain amplitude and normalizing the amplitude to obtain a normalized CSI amplitude sequence. Step 3: Construct contrastive learning sample pairs based on the short-time invariance features of the normalized CSI amplitude sequence. Specifically, two normalized CSI amplitude data from the same legitimate transmitter at adjacent time points are constructed as positive sample pairs, and normalized CSI amplitude data with a time interval greater than a predetermined threshold and / or from different transmitters are constructed as negative sample pairs. This results in a sample pair dataset labeled "CSI from the same device in a short time" and "CSI from different times or different devices". Step 4: Construct and train a Siamese Transformer lightweight model CSI-UST based on the sample pair dataset. CSI-UST includes at least two network branches with shared parameters. Each branch includes, in sequence: a linear embedding layer, a scaling and position encoding module, at least one Transformer encoder layer, and a global pooling layer, used to map the input normalized CSI amplitude data into a fixed-length feature vector. Unsupervised training of CSI-UST is performed using a contrastive loss function to reduce the feature distance of positive sample pairs and make the feature distance of negative sample pairs greater than a preset margin value. Step 5: Deploy the trained CSI-UST on the legitimate receiver. Use the CSI-UST to extract features and calculate distances between the CSI sample to be authenticated and the historical CSI samples of each legitimate sender. Compare the feature distances according to a preset decision threshold. If the feature distance of a legitimate sender is less than the decision threshold, the CSI sample to be authenticated is determined to be from that legitimate sender. Otherwise, the CSI sample to be authenticated is determined not to belong to the current set of legitimate devices. Step 6: If the authentication result is valid, add the CSI sample to be authenticated as the latest historical CSI sample of the corresponding valid sender to the historical sample library, and eliminate historical CSI samples that exceed the preset timeliness threshold; if the authentication result is that it does not belong to the current set of valid devices and is confirmed as a valid new device by the upper layer supplementary authentication, establish a corresponding historical CSI sample library for the new device, thereby realizing the dynamic expansion of the new device.
2. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 1, the dynamic multi-user wireless communication system uses a 2.4GHz carrier frequency and a 20MHz channel bandwidth, conforming to the IEEE 802.11n standard. The legitimate receiver is equipped with a multi-antenna receiving module, and both the legitimate transmitter and the attacker are equipped with multi-antenna transmitting modules. Communication is based on orthogonal frequency division multiplexing, with a total of 64 subcarriers, including data subcarriers, pilot subcarriers, and guard subcarriers, which are divided into several subcarrier groups according to predetermined rules to facilitate CSI acquisition.
3. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 2, the CSI preprocessing specifically requires organizing each original CSI data point into a complex vector of dimension (N×R×R), where N is the number of subcarrier groups, R is the number of receive antennas, and R is the number of transmit antennas, and the frequency domain amplitude is calculated according to the following formula: Where Real(·) and Imag(·) represent the real and imaginary parts of the complex vector, respectively, and the amplitude is normalized according to the maximum and minimum values within the sample to obtain the normalized CSI amplitude data H. norm,amp (t).
4. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 3, the relative velocity and carrier frequency parameters between the legitimate transmitter and the legitimate receiver satisfy the channel coherence time T. c The coherence time approximately satisfies the condition that it is slightly longer than the CSI sampling interval. Where v is the relative velocity, f c Where c is the carrier frequency and c is the speed of light. The positive sample pair is preferably composed of two CSI samples with a time interval less than the coherence time and from the same legitimate transmitter. The negative sample pair is preferably composed of CSI samples with a time interval greater than a number of sampling periods and / or from different transmitters or attackers.
5. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 4, the linear embedding layer maps the input normalized CSI amplitude vector to a vector with dimension d. model The embedding vector, and according to The embedding vector is scaled and the position encoding adopts a sine-cosine function form. The embedding vector is encoded with the subcarrier index as the independent variable, thereby explicitly introducing the subcarrier order information. The Transformer encoder includes a multi-head self-attention layer and a feedforward network layer. Each layer is stably trained through residual connections and layer normalization. At the output end, the sequence features are aggregated through a global pooling layer to obtain a fixed-length CSI feature vector.
6. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 4, CSI-UST is a lightweight model, where the embedding dimension d model The Transformer encoder has 1 layer and 8 attention heads. The total number of model parameters is controlled below 10,000, preferably around 3,000, to facilitate deployment on resource-constrained IoT devices.
7. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, The contrast loss function used in step 4 is defined as follows: Loss=Y·d 2 +(1-Y)·max(0,M-d) 2 Where Y is the label of the sample pair, Y=1 for positive sample pairs and Y=0 for negative sample pairs; d is the Euclidean distance between the corresponding feature vectors; M is the marginal value, and M>0, preferably M=1.
0.
8. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 5, the legitimate receiver maintains at least one reference CSI sample for each legitimate sender. The CSI sample to be authenticated and each reference CSI sample are processed by CSI-UST to obtain corresponding feature distances. The feature distances are compared with a decision threshold θ. When there is a legitimate sender whose corresponding feature distance is less than θ, the CSI sample to be authenticated is determined to be from that legitimate sender. Otherwise, the CSI sample to be authenticated is determined not to belong to the current set of legitimate devices. The decision threshold θ is preferably set in the range of 0.4 to 0.8, and more preferably set to 0.
5.
9. The unsupervised multi-user physical layer authentication method based on a Siamese transformer neural network as described in claim 1, characterized in that, In step 6, the timeliness threshold is represented by a time interval or the number of samples. When the time interval or sample interval between a historical CSI sample and the current authentication time is greater than the timeliness threshold, the historical CSI sample is determined to be expired and removed from the historical sample library. For CSI samples to be authenticated that are determined not to belong to the current set of legitimate devices, after supplementary authentication through upper-layer protocol, key authentication, or manual confirmation, they are written into the newly created historical sample library as the initial CSI sample of the new legitimate device, so that the set of authenticated users can be expanded without updating the CSI-UST model parameters.