# OFDM Emitter Identification Method Based on Data Augmentation and Contrastive Learning
## 3 Proposed Method
### Contrastive Learning and Residual Network Framework  
The problem of emitter identification is a classification problem in deep learning. In order to solve the identification problem of OFDM signals under the condition of few shots, we divided the training stage into self-supervised pretraining based on contrastive learning and transmitter classification based on CNN. We use the residual network as a backbone of this classification task, the advantage is that it added the residual block in the convolutional neural network, the network computing the difference \(F(x)\) between original mapping \(H(x)\) and the input feature \(x\), to solve the error gradually increase along with the network layer increases and gradient diffusion problems, makes deep networks have better performance than the shallow network. In terms of the particularity that OFDM signals contain 108 seed carriers, we made some adjustments to the structure of ResNet: (1) The input layer of the residual network that originally supported RGB three-channel color image was modified to support the structure of amplitude and phase dual channels as input, and the parameters of the first two channels were copied to ensure that the initial weights were consistent with the residual network. (2) We adjust the method of residual network feature extraction, reducing the input layer convolution kernel to one dimension so that it pays more attention to the features displayed by the same subcarrier. At the same time, in this paper, we further compare the identification effect of residual networks with different depths under OFDM signals, and finally uses the ResNet18 as the backbone, the difference between ResNet18 and 1 dResNet18 is shown in Figure 6.  
We use the method of contrastive learning to construct positive samples and negative samples, and pull closer the distance of positive samples, and pull away the distance of negative samples to obtain a pretrained model. The goal of contrastive learning is shown in Figure 7.  
Figure 6: ResNet is usually used to extract the features of RGB images. There is a large amount of local information in the images, but each line of OFDM signal represents a subcarrier with timing information inside. Therefore, it is more reasonable to use 1-dimensional convolution and adjust the step size in OFDM data. We propose a framework based on the above residual structure, as shown in Figure 8, our framework consists of two parts: In the upper part of Figure 8, we conduct pretraining by contrastive learning, and the pre-training network is the feature extraction layer of the residual network mentioned above. Supposing we have an OFDM dataset \(X=\{x_{i}\}_{i=1}^{N}\), where \(N\) is the total number of samples. We denote training samples from a batch as \(X_{b}=\{x_{j}\}_{j=1}^{bs}\), where \(bs\) is batch size. For each \(x_{j}\) in each batch, we perform data augmentation, and we obtain \(x_{j}^{+}\). Then, we select the other samples in the Mini-batch \(x_{j+1}\), \(x_{j+2}\)\(\cdots\) and feed these samples into the feature extractor, we take the output of \(xj\) and \(xj^{+}\) through the network as \(q\) and \(k_{+}\), respectively, and we take the output of \(x_{j+1}\), \(x_{j+2}\)\(\cdots\) as \(k_{j+1}\), \(k_{j+2}\)\(\cdots\). Since \(q\) and \(k_{+}\) come from the same sample \(x_{j}\), they both belong to positive samples and have the highest similarity. In this part, we use InfoNCE loss function, which are defined as:  
\[L_{q}=-log\frac{exp(q\cdot k_{+}/\tau)}{\sum_{i=0}^{K}exp(q\cdot k_{i}/\tau)}. \tag{2}\]  
where the numerator is the dot product of \(q\) with \(k_{+}\), and the denominator is the dot product of \(q\) with all \(k\), \(\tau\) is a temperature coefficient. Based on this, the training of the feature extraction layer is completed. Next, in the fine-tune phase, we use the training dataset \(X\) to train a residual network, including the fully connected layer.