CN116894207A - An intelligent radiation source identification method based on Swin Transformer and transfer learning - Google Patents
An intelligent radiation source identification method based on Swin Transformer and transfer learning Download PDFInfo
- Publication number
- CN116894207A CN116894207A CN202310767307.3A CN202310767307A CN116894207A CN 116894207 A CN116894207 A CN 116894207A CN 202310767307 A CN202310767307 A CN 202310767307A CN 116894207 A CN116894207 A CN 116894207A
- Authority
- CN
- China
- Prior art keywords
- vector
- data
- radiation source
- attention
- window
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/10—Pre-processing; Data cleansing
- G06F18/15—Statistical pre-processing, e.g. techniques for normalisation or restoring missing data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0499—Feedforward networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/096—Transfer learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Molecular Biology (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical field
本发明涉及信号处理技术领域,具体涉及一种基于Swin Transformer和迁移学习的智能辐射源识别方法。The invention relates to the field of signal processing technology, and specifically relates to an intelligent radiation source identification method based on Swin Transformer and transfer learning.
背景技术Background technique
随着通信技术的不断发展,通信设备的数量和种类不断增加,通信协议不断变化,这使得高效、准确的获取感兴趣辐射源目标信息的难度不断增加。作为通信对抗中重要的一环,辐射源识别技术变得越来越关键。事实上,实际电磁环境中辐射源类型、功率、天线、辐射源与接收机之间的距离、调制信息、信道等都会影响辐射源的指纹特征,造成辐射源鉴别困难。With the continuous development of communication technology, the number and types of communication equipment continue to increase, and communication protocols continue to change, which makes it increasingly difficult to obtain target information on radiation sources of interest efficiently and accurately. As an important part of communication countermeasures, radiation source identification technology has become increasingly critical. In fact, in the actual electromagnetic environment, the type of radiation source, power, antenna, distance between the radiation source and receiver, modulation information, channel, etc. will affect the fingerprint characteristics of the radiation source, making it difficult to identify the radiation source.
常用的辐射源识别方法大致分为两类,包括基于人工特征的识别方法和基于深度学习的识别方法。传统基于人工特征提取或机器学习的辐射源识别方法从侦收的辐射源信号中提取具有高鉴别力的有效特征非常困难,而且由于信号数据信息量较大,人工难以快速准确处理数据蒸馏出有用的信息。基于深度学习的识别方法能够直接使用侦收的信号数据实现端到端的辐射源个体识别,不仅省略了人工提取指纹操作,并且分类准确率更高。然而,在实际场景中有效数据非常稀缺,大部分信号数据无标签,可用、高效的训练集难以获得,无法满足基于深度学习的智能辐射源识别的数据训练需要。除此之外,当前电磁目标识别技术应用场景窄、无法实现跨场景、跨平台识别,急需寻找一种有效的特征识别方法,尽可能提高在不同地点、不同平台接收的场景下电磁目标识别的可靠性。Commonly used radiation source identification methods are roughly divided into two categories, including identification methods based on artificial features and identification methods based on deep learning. Traditional radiation source identification methods based on manual feature extraction or machine learning are very difficult to extract effective features with high discriminability from the detected radiation source signals. Moreover, due to the large amount of signal data information, it is difficult to manually process the data quickly and accurately to distill useful features. Information. The identification method based on deep learning can directly use the collected signal data to achieve end-to-end identification of individual radiation sources, which not only eliminates the manual fingerprint extraction operation, but also has a higher classification accuracy. However, in actual scenarios, effective data are very scarce, most signal data are unlabeled, and available and efficient training sets are difficult to obtain, which cannot meet the data training needs of intelligent radiation source identification based on deep learning. In addition, the current application scenarios of electromagnetic target recognition technology are narrow and cannot achieve cross-scenario and cross-platform recognition. There is an urgent need to find an effective feature recognition method to improve the accuracy of electromagnetic target recognition in scenarios received by different locations and platforms as much as possible. reliability.
发明内容Contents of the invention
本发明的目的在于提供一种基于SwinTransformer和迁移学习的智能辐射源识别方法,针对场景迁移、跨接收机场景下的识别问题,将无监督特征提取模型用于电磁目标数据在标注缺失时的特征提取,从而达到较好的目标识别效果,即扩大辐射源个体识别的应用场景,实现场景自适应辐射源智能识别。The purpose of the present invention is to provide an intelligent radiation source identification method based on SwinTransformer and transfer learning. Aiming at the problem of scene migration and identification in cross-receiver scenarios, the unsupervised feature extraction model is used to characterize the electromagnetic target data when the annotation is missing. Extraction, so as to achieve better target recognition results, that is, to expand the application scenarios of individual radiation source identification and realize scene-adaptive intelligent identification of radiation sources.
为实现上述技术目的,达到上述技术效果,本发明是通过以下技术方案实现:In order to achieve the above technical objectives and achieve the above technical effects, the present invention is implemented through the following technical solutions:
一种基于Swin Transformer和迁移学习的智能辐射源识别方法,包括以下步骤:An intelligent radiation source identification method based on Swin Transformer and transfer learning, including the following steps:
S1:输入原始辐射源信号作为输入序列,经过组合的信号预处理方式进行数据增强,生成一系列样本;S1: Input the original radiation source signal as the input sequence, perform data enhancement through a combined signal preprocessing method, and generate a series of samples;
S2:将步骤S1生成的每个样本转换为向量表示,并添加位置编码;S2: Convert each sample generated in step S1 into a vector representation and add position encoding;
S3:将步骤S2所得向量表示输入到编码GPT器中,编码器由多个相同的层组成,每个层都包含多头注意力机制和前馈神经网络;S3: Input the vector representation obtained in step S2 into the encoder GPT. The encoder consists of multiple identical layers, each layer including a multi-head attention mechanism and a feedforward neural network;
S4:将编码器的输出输入到解码器中,解码器也由多个相同的层组成,每个层都包含多头注意力机制、前馈神经网络和编码器-解码器注意力机制;S4: Input the output of the encoder into the decoder. The decoder is also composed of multiple identical layers. Each layer contains a multi-head attention mechanism, a feedforward neural network and an encoder-decoder attention mechanism;
S5:将解码器的输出转换为目标序列样本。S5: Convert the output of the decoder into target sequence samples.
进一步的,所述信号预处理方式包括:以复数形式保留双通道信号正交分量(Q路)和同相分量(I路)的全部信息利用短时傅里叶变换(Short-time Fouriertransform,STFT)、高阶矩高阶谱参数特征(积分双谱特征)和小波变换(Wavelet transform,WT)来对输入序列进行多样化操作。Further, the signal preprocessing method includes: retaining all the information of the orthogonal component (Q path) and the in-phase component (I path) of the dual-channel signal in complex form using short-time Fourier transform (STFT) , high-order moments and high-order spectral parameter features (integrated bispectral features) and wavelet transform (Wavelet transform, WT) to perform diversified operations on the input sequence.
进一步的,所述多样化操作具体包括:Further, the diversification operations specifically include:
对于原始的双通道时域数据,数据增强包括但不限于时域平移、拉伸、压缩与加噪声;通过一维卷积层搭建网络降低运算复杂度并且缩短训练时间;For original dual-channel time domain data, data enhancement includes but is not limited to time domain translation, stretching, compression and adding noise; building a network through one-dimensional convolutional layers reduces computational complexity and shortens training time;
对于变换域或调制域变换后的信号二维样本序列,数据增强包括但不限于二维样本序列平移、旋转、缩放、翻转与加噪声;增加数据集的多样性,提高模型的泛化能力和准确率;For the signal two-dimensional sample sequence after transformation domain or modulation domain transformation, data enhancement includes but is not limited to translation, rotation, scaling, flipping and adding noise to the two-dimensional sample sequence; increasing the diversity of the data set, improving the generalization ability of the model and Accuracy;
原始样本大小设为w×h,裁剪大小设为cw×ch,裁剪数量设为n,则可以随机裁剪出的图片数量为:The original sample size is set to w×h, the crop size is set to c w ×c h , and the number of crops is set to n. Then the number of pictures that can be randomly cropped is:
(w-cw+1)×(h-ch+1)(wc w +1)×(hc h +1)
翻转包括垂直旋转和水平旋转两种方式;在四个方向旋转可以将图像数量扩充四倍;一个样本可以拓展的样本数量为:Flip includes vertical rotation and horizontal rotation; rotation in four directions can expand the number of images four times; the number of samples that can be expanded by one sample is:
4×2×(w-cw+1)×(h-ch+1)4×2×(wc w +1)×(hc h +1)
进一步的,所述注意力机制为ShiftedWindow局部注意力机制,具体包括:首先通过将查询向量与键向量进行点积,得到一个分数向量;接着将分数向量除以一个可调整的缩放因子,以避免分数过大或过小;然后将缩放后的分数向量输入到softmax函数中,以获得注意力权重;最后将注意力权重与值向量进行加权平均,以获得最终的上下文向量(Attention),这个向量可以为每个输入位置分配一个权重,以便更好地捕捉输入序列中的重要信息;Further, the attention mechanism is a ShiftedWindow local attention mechanism, which specifically includes: first, performing a dot product between the query vector and the key vector to obtain a score vector; then dividing the score vector by an adjustable scaling factor to avoid The score is too large or too small; then the scaled score vector is input into the softmax function to obtain the attention weight; finally, the attention weight and the value vector are weighted and averaged to obtain the final context vector (Attention). This vector Each input position can be assigned a weight to better capture important information in the input sequence;
用于计算自注意力的公式为:The formula used to calculate self-attention is:
Q,K,V分别表示查询向量、键向量和值向量,dk表示可调整的缩放因子。Q, K, V represent the query vector, key vector and value vector respectively, and d k represents the adjustable scaling factor.
进一步的,所述Shifted Window局部注意力机制是一种分层Transformer,表示以移位窗口方法计算;移位窗口方案通过将self-attention计算限制在不重叠的局部窗口上,同时允许跨窗口连接,从而起到提高效率的效果;Furthermore, the Shifted Window local attention mechanism is a hierarchical Transformer, which is calculated by the shifted window method; the shifted window scheme limits the self-attention calculation to non-overlapping local windows while allowing cross-window connections. , thereby improving efficiency;
Shifted Window在局部窗口内计算自注意力,窗口以不重叠的方式均匀地划分;设每个窗口划分为M×M大小的子窗口,全局MSA模块和基于h×w大小划分样本的窗口的计算复杂度为:Shifted Window calculates self-attention within a local window, and the windows are evenly divided in a non-overlapping manner; assuming that each window is divided into sub-windows of M×M size, the calculation of the global MSA module and the window based on the h×w size division sample The complexity is:
Ω(MSA)=4hwC2+2(hw)2CΩ(MSA)=4hwC 2 +2(hw) 2 C
Ω(W-MSA)=4hwC2+2M2hwCΩ(W-MSA)=4hwC 2 +2M 2 hwC
移动窗口的方式,可以让窗口和窗口之间进行通信,并且具有上下文的信息;同时在原始计算自注意力的公式中的Q,K,V时加入了相对位置编码B;The moving window method allows communication between windows and has contextual information; at the same time, relative position coding B is added to Q, K, and V in the original formula for calculating self-attention;
进一步的,所述softmax函数将一个向量映射到一个概率分布,将神经网络的输出转换为类别概率;softmax函数的公式如下,xi是输入向量中的第i个元素,n是向量的长度:Further, the softmax function maps a vector to a probability distribution and converts the output of the neural network into a category probability; the formula of the softmax function is as follows, x i is the i-th element in the input vector, and n is the length of the vector:
在二维数据处理任务中,全连接层可以将输入数据中的每个像素都与输出数据中的每个像素相连,从而使得输出数据中的每个像素都可以由输入数据中的所有像素共同决定。In two-dimensional data processing tasks, the fully connected layer can connect every pixel in the input data to every pixel in the output data, so that every pixel in the output data can be common to all pixels in the input data. Decide.
本发明的有益效果:Beneficial effects of the present invention:
本发明使用组合的信号预处理方式进行数据增强,利用短时傅里叶变换与时域数据的一维向量和二维向量增强方式使得数据集的样本量得到了几个数量级的提升,从而拓展数据量,使模型得到更多信息。使用自注意力机制使其更好的利用先验知识从新数据中学习到辐射源指纹特征。即使在新的环境下得到数据特征改变,也能通过这种方式捕捉新环境和原来的环境通用的特征和模式,提高模型的复用性。使用滑动窗口的方法使网络参数的更新降低计算复杂度,并提高模型的训练速度和推理速度,计算复杂度减少到了原来的(M/h)2,即子窗口,带来更高的效率和训练速度。模型的输出映射到特定类别的一层神经网络的分类方法,在双通道时域一维数据处理任务中使用softmax函数。在变化域(频域等)二维数据处理任务中使用全连接层。The present invention uses a combined signal preprocessing method for data enhancement, and uses short-time Fourier transform and one-dimensional vector and two-dimensional vector enhancement methods of time domain data to increase the sample size of the data set by several orders of magnitude, thereby expanding The amount of data allows the model to get more information. The use of self-attention mechanism makes it better to use prior knowledge to learn radiation source fingerprint features from new data. Even if the data characteristics change in the new environment, the common characteristics and patterns of the new environment and the original environment can be captured in this way, improving the reusability of the model. Using the sliding window method reduces the computational complexity of updating network parameters and improves the training speed and inference speed of the model. The computational complexity is reduced to the original (M/h) 2 , that is, the sub-window, which brings higher efficiency and Training speed. A classification method in which the output of the model is mapped to a specific class of one-layer neural network, using the softmax function in a dual-channel time domain one-dimensional data processing task. Fully connected layers are used in two-dimensional data processing tasks in the changing domain (frequency domain, etc.).
1.扩大辐射源个体识别的应用场景:传统的辐射源识别方法通常局限于特定场景下的个体识别,在场景迁移或跨接收机场景下可能无法准确识别。而基于SwinTransformer和迁移学习的方法可以增强模型的泛化能力,适应不同场景的辐射源识别,从而扩大了辐射源个体识别应用的范围。1. Expand the application scenarios of individual radiation source identification: Traditional radiation source identification methods are usually limited to individual identification in specific scenarios, and may not be accurately identified during scene migration or cross-receiver scenarios. The method based on SwinTransformer and transfer learning can enhance the generalization ability of the model and adapt to the identification of radiation sources in different scenarios, thereby expanding the scope of individual radiation source identification applications.
2.实现场景自适应辐射源智能识别:当辐射源数据的标注缺失时,传统的监督学习方法很难实现较好的识别效果。而本方法通过使用无监督特征提取模型,可以在标注缺失的情况下从电磁目标数据中提取特征。这样可以使得模型在面对标注不完整的数据时仍然能够有效地进行辐射源智能识别,实现了场景自适应。2. Realize scene-adaptive intelligent identification of radiation sources: When the annotation of radiation source data is missing, it is difficult for traditional supervised learning methods to achieve better identification results. By using an unsupervised feature extraction model, this method can extract features from electromagnetic target data in the absence of annotations. This allows the model to effectively perform intelligent identification of radiation sources when faced with incompletely annotated data, achieving scene adaptation.
3.数据增强和多样化操作:数据增强是一种常见的方法,通过对原始数据进行一系列的变换操作,可以增加数据集的多样性,从而提高模型的泛化能力和鲁棒性。在本方法中,信号预处理方式采用了多样化操作,包括时域平移、拉伸、压缩、加噪声以及二维样本序列平移、旋转、缩放和翻转等。这些操作可以模拟不同实际场景下的辐射源信号变化,使得模型能够更好地适应各种情况下的辐射源识别任务。3. Data enhancement and diversification operations: Data enhancement is a common method. By performing a series of transformation operations on the original data, the diversity of the data set can be increased, thereby improving the generalization ability and robustness of the model. In this method, the signal preprocessing method uses a variety of operations, including time domain translation, stretching, compression, noise addition, and two-dimensional sample sequence translation, rotation, scaling and flipping. These operations can simulate the changes in radiation source signals in different actual scenarios, allowing the model to better adapt to radiation source identification tasks under various circumstances.
4.使用Shifted Window局部注意力机制:注意力机制是Transformer模型中的重要组成部分,可以为不同位置的输入提供不同的权重,以更好地捕捉输入序列中的重要信息。Shifted Window局部注意力机制是一种特殊的注意力机制,通过限制self-attention计算在不重叠的局部窗口上,可以减少计算量,并且允许窗口之间的通信,使得模型可以同时获取局部和全局的上下文信息。4. Use the Shifted Window local attention mechanism: The attention mechanism is an important part of the Transformer model, which can provide different weights for inputs at different positions to better capture important information in the input sequence. The Shifted Window local attention mechanism is a special attention mechanism. By limiting the self-attention calculation to non-overlapping local windows, it can reduce the amount of calculation and allow communication between windows, so that the model can obtain local and global information at the same time. contextual information.
5.基于分层Transformer的移位窗口方案:为了进一步提高计算效率和模型的可解释性,在本方法中采用了基于分层Transformer的移位窗口方案。这种方案通过将self-attention计算限制在局部窗口上,减少了计算复杂度,同时允许窗口之间的相互通信,有助于提取更具信息量的特征。5. Shift window scheme based on hierarchical Transformer: In order to further improve calculation efficiency and model interpretability, a shift window scheme based on hierarchical Transformer is adopted in this method. This scheme reduces computational complexity by limiting self-attention calculations to local windows, while allowing mutual communication between windows, helping to extract more informative features.
6.softmax函数的使用:softmax函数常用于将神经网络输出转换为类别概率分布,使得模型的输出更符合分类任务的要求。在本方法中,通过使用softmax函数,可以将模型的输出转换为各个类别的概率值,方便进行分类决策。6. Use of softmax function: The softmax function is often used to convert the neural network output into a category probability distribution, so that the output of the model more meets the requirements of the classification task. In this method, by using the softmax function, the output of the model can be converted into probability values of each category to facilitate classification decisions.
7.全连接层的使用:全连接层是神经网络中常用的层之一,它将输入数据中的每个像素都与输出数据中的每个像素相连,以使得输出数据中的每个像素都可以由输入数据中的所有像素共同决定。在处理二维数据任务中,全连接层可以捕捉到输入数据中的空间信息,提高分类任务的准确性。在本方法中,全连接层的使用有助于提取输入数据的细粒度特征,同时保留了像素间的空间关系。7. The use of fully connected layers: The fully connected layer is one of the commonly used layers in neural networks. It connects each pixel in the input data to each pixel in the output data, so that each pixel in the output data can be determined jointly by all pixels in the input data. In the task of processing two-dimensional data, the fully connected layer can capture the spatial information in the input data and improve the accuracy of the classification task. In this method, the use of fully connected layers helps to extract fine-grained features of the input data while preserving the spatial relationship between pixels.
当然,实施本发明的任一产品并不一定需要同时达到以上所述的所有优点。Of course, any product implementing the present invention does not necessarily need to achieve all the above-mentioned advantages at the same time.
附图说明Description of the drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the drawings needed to describe the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.
图1为本发明整体流程示意图;Figure 1 is a schematic diagram of the overall process of the present invention;
图2为本发明模型架构示意图;Figure 2 is a schematic diagram of the model architecture of the present invention;
图3为本发明实施例所述的resnet50训练集和测试集识别损失准确率曲线示意图;Figure 3 is a schematic diagram of the recognition loss accuracy curve of the resnet50 training set and test set according to the embodiment of the present invention;
图4为本发明实施例所述的迁移后的验证集使用resnet50训练的样本识别混淆矩阵示意图;Figure 4 is a schematic diagram of the sample recognition confusion matrix trained by resnet50 on the migrated verification set according to the embodiment of the present invention;
图5为本发明实施例所述的基于Swin Transformer的训练集和测试集损失准确率曲线示意图;Figure 5 is a schematic diagram of the loss accuracy curve of the training set and test set based on Swin Transformer according to the embodiment of the present invention;
图6为本发明实施例所述的迁移后的验证集使用Swin Transformer识别混淆矩阵示意图。Figure 6 is a schematic diagram of using Swin Transformer to identify the confusion matrix of the migrated verification set according to the embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
实施例1Example 1
本实施例所述的一种基于Swin Transformer和迁移学习的智能辐射源识别方法,包括以下步骤:An intelligent radiation source identification method based on Swin Transformer and transfer learning described in this embodiment includes the following steps:
S1:输入原始辐射源信号作为输入序列,经过组合的信号预处理方式进行数据增强,生成一系列样本;S1: Input the original radiation source signal as the input sequence, perform data enhancement through a combined signal preprocessing method, and generate a series of samples;
S2:将步骤S1生成的每个样本转换为向量表示,并添加位置编码;S2: Convert each sample generated in step S1 into a vector representation and add position encoding;
S3:将步骤S2所得向量表示输入到编码GPT器中,编码器由多个相同的层组成,每个层都包含多头注意力机制和前馈神经网络;S3: Input the vector representation obtained in step S2 into the encoder GPT. The encoder consists of multiple identical layers, each layer including a multi-head attention mechanism and a feedforward neural network;
S4:将编码器的输出输入到解码器中,解码器也由多个相同的层组成,每个层都包含多头注意力机制、前馈神经网络和编码器-解码器注意力机制;S4: Input the output of the encoder into the decoder. The decoder is also composed of multiple identical layers. Each layer contains a multi-head attention mechanism, a feedforward neural network and an encoder-decoder attention mechanism;
S5:将解码器的输出转换为目标序列样本。S5: Convert the output of the decoder into target sequence samples.
实施例2Example 2
在本实施例中,针对目前标签的数据量较少条件下,如何拓展数据量,使模型得到更多信息的问题;本发明使用组合的信号预处理方式进行数据增强。In this embodiment, in view of the problem of how to expand the amount of data so that the model can obtain more information under the current condition that the amount of tag data is small, the present invention uses a combined signal preprocessing method for data enhancement.
在新场景中,有标签的信号样本较少条件下,如何通过多种不同的信号预处理方式,从现有数据生成新的训练数据来扩展原数据集。研究这些信号预处理的有效性有助于提升样本多样性,达到扩充数据和数据增强、提高模型泛化能力、减少过拟合、提高模型鲁棒性。In the new scenario, under the condition that there are few labeled signal samples, how to use a variety of different signal preprocessing methods to generate new training data from existing data to expand the original data set. Studying the effectiveness of these signal preprocessing can help improve sample diversity, expand data and data enhancement, improve model generalization capabilities, reduce overfitting, and improve model robustness.
本发明结合传统信号分析方法,以复数形式保留双通道信号正交分量(Q路)和同相分量(I路)的全部信息利用短时傅里叶变换(Short-time Fourier transform,STFT)、高阶矩高阶谱参数特征(积分双谱特征)和小波变换(Wavelet transform,WT)来对样本序列进行多样化操作。多样化操作后的样本分别通过一维和二维卷积层搭建网络,同时原始的双通道时域数据能够更好地保留信号的指纹特征,变换域或调制域变换后的信号包含时域和频域两种信息,能减轻频率对信号的指纹特征学习的影响。模型的基本架构如图2所示。This invention combines traditional signal analysis methods to retain all the information of the orthogonal component (Q path) and in-phase component (I path) of the dual-channel signal in complex form using short-time Fourier transform (STFT), high Order moment high-order spectral parameter features (integrated bispectral features) and wavelet transform (Wavelet transform, WT) are used to diversify the sample sequence. The samples after the diversification operation are used to build networks through one-dimensional and two-dimensional convolution layers. At the same time, the original dual-channel time domain data can better retain the fingerprint characteristics of the signal. The signal after transformation domain or modulation domain transformation includes time domain and frequency domain. Two types of information in the domain can reduce the impact of frequency on signal fingerprint feature learning. The basic architecture of the model is shown in Figure 2.
对于原始的双通道时域数据,可以使用时域平移、时域拉伸、时域压缩、时域加各种噪声进行数据增强。通过一维卷积层搭建网络可以降低运算复杂度并且缩短训练时间。For original dual-channel time domain data, time domain translation, time domain stretching, time domain compression, and time domain addition of various noises can be used for data enhancement. Building a network through one-dimensional convolutional layers can reduce computational complexity and shorten training time.
对于变换域或调制域变换后的信号二维样本序列,可以对二维样本序列平移、旋转、缩放、翻转、加噪声进行数据增强。这些数据增强方式可以增加数据集的多样性,从而提高模型的泛化能力和准确率。例如,对于同时包含时间轴和频率轴的二维时频图,随机裁剪、翻转和旋转可以使模型更好地适应不同的频率和时间,加噪声可以仿真不同信道环境,使模型更好地适应不同的噪声环境。For the two-dimensional sample sequence of the signal after transformation in the transformation domain or modulation domain, data enhancement can be performed on the two-dimensional sample sequence by translating, rotating, scaling, flipping, and adding noise. These data enhancement methods can increase the diversity of the data set, thereby improving the generalization ability and accuracy of the model. For example, for a two-dimensional time-frequency diagram that contains both the time axis and the frequency axis, random cropping, flipping, and rotation can make the model better adapt to different frequencies and times. Adding noise can simulate different channel environments and make the model better adapt to Different noise environments.
为了有效增强数据,本发明采用数据组合的方法增强数据:In order to effectively enhance data, the present invention uses the method of data combination to enhance data:
通过随机设置参数裁剪、翻转和旋转,对每一个样本进行不同的操作方式,从而增加多样性。By randomly setting parameters for cropping, flipping and rotating, each sample is operated in a different way to increase diversity.
如果原始样本大小为w×h,裁剪大小为cw×ch,裁剪数量为n,则可以随机裁剪出的图片数量为:If the original sample size is w×h, the crop size is c w ×c h , and the number of crops is n, the number of pictures that can be randomly cropped is:
(w-cw+1)×(h-ch+1)(wc w +1)×(hc h +1)
翻转包括垂直旋转和水平旋转两种方式;在四个方向旋转可以将图像数量扩充四倍。一个样本可以拓展的样本数量为:Flip includes vertical rotation and horizontal rotation; rotating in four directions can quadruple the number of images. The number of samples that can be expanded by a sample is:
4×2×(w-cw+1)×(h-ch+1)4×2×(wc w +1)×(hc h +1)
实施例3Example 3
在本实施例中,针对在新的环境下得到数据特征改变,如何捕捉新环境和原来的环境通用的特征和模式,提高模型的复用性的问题;本发明迁移到新环境后的数据特征改变,使用自注意力机制使其更好的利用先验知识从新数据中学习到辐射源指纹特征。In this embodiment, in order to obtain changes in data characteristics in a new environment, how to capture the common characteristics and patterns of the new environment and the original environment and improve the reusability of the model; the data characteristics after the present invention is migrated to the new environment Change, using the self-attention mechanism to better utilize prior knowledge to learn radiation source fingerprint features from new data.
自注意力机制是一种注意力机制,它是一种网络的构型,旨在解决神经网络接收的输入是很多大小不一的向量,并且不同向量之间有一定的关系,但是实际训练的时候无法充分发挥这些输入之间的关系而导致模型性能下降的问题。自注意力机制可以通过计算每个向量与其他向量之间的相似度来解决这个问题,然后将这些相似度作为权重来加权求和,从而得到一个加权和向量,这个向量就是自注意力机制的输出。以下是本发明模型的基本流程:The self-attention mechanism is an attention mechanism. It is a network configuration that aims to solve the problem that the input received by the neural network is many vectors of different sizes, and there is a certain relationship between different vectors, but the actual training When the relationship between these inputs cannot be fully exploited, the performance of the model decreases. The self-attention mechanism can solve this problem by calculating the similarity between each vector and other vectors, and then use these similarities as weights to weight and sum, thereby obtaining a weighted sum vector, which is the self-attention mechanism. output. The following is the basic process of the model of this invention:
首先,将输入序列中的每个辐射源信号经过组合的信号预处理方式进行数据增强,生成一系列样本。First, each radiation source signal in the input sequence is data enhanced through a combined signal preprocessing method to generate a series of samples.
接着,将输入序列中的每个样本转换为向量表示,并添加位置编码。Next, each sample in the input sequence is converted into a vector representation and positional encoding is added.
接着,将向量表示输入到编码器中,编码器由多个相同的层组成,每个层都包含多头注意力机制和前馈神经网络。Next, the vector representation is fed into the encoder, which consists of multiple identical layers, each containing a multi-head attention mechanism and a feed-forward neural network.
然后,将编码器的输出输入到解码器中,解码器也由多个相同的层组成,每个层都包含多头注意力机制、前馈神经网络和编码器-解码器注意力机制。The output of the encoder is then input into the decoder, which is also composed of multiple identical layers, each containing a multi-head attention mechanism, a feedforward neural network, and an encoder-decoder attention mechanism.
最后,将解码器的输出转换为目标序列样本。Finally, the output of the decoder is converted into target sequence samples.
本发明使用了一种称为Shifted Window的新型局部注意力机制,可以在不增加计算复杂度的情况下使得计算全局感受野,这种计算方式可以使得捕捉新场景与旧场景的关系更加高效,并且能够获取特征库所有与输出样本点有关系的信息。全局感受野的计算方法是从当前层开始,逐层向下计算。对于每一层,计算输出特征图上的一个像素点对应于输入图像上的一个区域,这个区域包含了输入图像上所有与该像素点有关系的信息。这种方法可以在不增加计算复杂度的情况下增加全局感受野。以下是计算自注意力的流程:The present invention uses a new local attention mechanism called Shifted Window, which can calculate the global receptive field without increasing the computational complexity. This calculation method can make capturing the relationship between new scenes and old scenes more efficient. And it can obtain all the information related to the output sample points in the feature library. The calculation method of the global receptive field is to start from the current layer and calculate downward layer by layer. For each layer, a pixel on the calculated output feature map corresponds to an area on the input image. This area contains all the information related to the pixel on the input image. This approach can increase the global receptive field without increasing computational complexity. The following is the process for calculating self-attention:
首先,通过将查询向量与键向量进行点积,得到一个分数向量。接着,将分数向量除以一个可调整的缩放因子,以避免分数过大或过小。First, a score vector is obtained by taking the dot product of the query vector with the key vector. Next, the score vector is divided by an adjustable scaling factor to avoid scores that are too large or too small.
然后,将缩放后的分数向量输入到softmax函数中,以获得注意力权重。Then, the scaled score vector is input into the softmax function to obtain the attention weights.
最后,将注意力权重与值向量进行加权平均,以获得最终的上下文向量(Attention),这个向量可以为每个输入位置分配一个权重,以便更好地捕捉输入序列中的重要信息。Finally, the attention weight and the value vector are weighted and averaged to obtain the final context vector (Attention), which can assign a weight to each input position to better capture important information in the input sequence.
以下是用于计算自注意力的公式:Here is the formula used to calculate self-attention:
Q,K,V分别表示查询向量、键向量和值向量,dk表示可调整的缩放因子。Q, K, V represent the query vector, key vector and value vector respectively, and d k represents the adjustable scaling factor.
实施例4Example 4
在本实施例中,针对如何为新任务提供更快、利用更少的资源的方法更新模型的参数的问题;本发明使用滑动窗口的方法使网络参数的更新降低计算复杂度,并提高模型的训练速度和推理速度。In this embodiment, the problem of how to provide a faster and less resource-intensive method for updating model parameters for new tasks is addressed. The present invention uses a sliding window method to reduce the computational complexity of updating network parameters and improve the accuracy of the model. Training speed and inference speed.
本发明使用的Shifted Window的局部注意力机制是一种分层Transformer,它的表示是用移位窗口方法计算的。移位窗口方案通过将self-attention计算限制在不重叠的局部窗口上,同时还允许跨窗口连接,从而带来更高的效率。The local attention mechanism of Shifted Window used in this invention is a hierarchical Transformer, and its representation is calculated using the shifted window method. The shifted window scheme brings higher efficiency by limiting the self-attention calculation to non-overlapping local windows while also allowing cross-window connections.
ViT从全局窗口角度计算自注意力,计算量比较大,Shifted Window在局部窗口内计算自注意力,窗口以不重叠的方式均匀地划分。假设每个窗口划分为M×M大小的子窗口,全局MSA模块和基于h×w大小划分样本的窗口的计算复杂度为:ViT calculates self-attention from the perspective of the global window, which requires a relatively large amount of calculation. Shifted Window calculates self-attention within the local window, and the windows are evenly divided in a non-overlapping manner. Assuming that each window is divided into M×M size sub-windows, the computational complexity of the global MSA module and the window based on h×w size divided samples is:
Ω(MSA)=4hwC2+2(hw)2CΩ(MSA)=4hwC 2 +2(hw) 2 C
Ω(W-MSA)=4hwC2+2M2hwCΩ(W-MSA)=4hwC 2 +2M 2 hwC
移动窗口的方式,可以让窗口和窗口之间进行通信,并且具有上下文的信息。同时在原始计算自注意力的公式中的Q,K,V时加入了相对位置编码B。The method of moving windows allows communication between windows and contextual information. At the same time, relative position coding B is added to Q, K, and V in the original formula for calculating self-attention.
实施例5Example 5
在本实施例中,针对在模型更新的基础上,如何通过分类器使用已训练好的网络对辐射源进行分类的问题;本发明对于将模型的输出映射到特定类别的一层神经网络的分类方法,在数据处理任务中使用softmax函数。In this embodiment, the problem of how to use a trained network to classify radiation sources through a classifier based on model update is addressed; the present invention is for the classification of a layer of neural network that maps the output of the model to a specific category method, using the softmax function in data processing tasks.
softmax可以在一维数据处理任务中,softmax函数可以将输入数据中的每个元素都映射到0到1之间,并且所有元素的和为1,从而使得输出数据中的每个元素都可以被看作是一个概率值。这种方法可以有效地将输入数据中的信息转化为概率分布,从而提高模型的性能。softmax函数将一个向量映射到一个概率分布,用于在本次分类任务中将神经网络的输出转换为类别概率。softmax函数将神经网络的输出作为输入,并将其映射到一个概率分布,其中每个元素表示一个类别的概率。softmax函数的公式如下,xi是输入向量中的第i个元素,n是向量的长度:Softmax can be used in one-dimensional data processing tasks. The softmax function can map each element in the input data to between 0 and 1, and the sum of all elements is 1, so that each element in the output data can be regarded as a probability value. This method can effectively transform the information in the input data into a probability distribution, thereby improving the performance of the model. The softmax function maps a vector to a probability distribution and is used to convert the output of the neural network into class probabilities in this classification task. The softmax function takes as input the output of a neural network and maps it to a probability distribution, where each element represents the probability of a class. The formula of the softmax function is as follows, x i is the i-th element in the input vector, and n is the length of the vector:
在二维数据处理任务中,全连接层可以将输入数据中的每个像素都与输出数据中的每个像素相连,从而使得输出数据中的每个像素都可以由输入数据中的所有像素共同决定。这种方法可以有效地提取输入数据中的特征,从而提高模型的性能。全连接层使用多层感知机这种种前向结构的人工神经网络,包含输入层、输出层及多个隐藏层。多层感知机作为一个有向图,由多个节点层所组成,每一层都全连接到下一层。除了输入节点,每个节点都是一个带有非线性激活函数的神经元(或称处理单元)。In two-dimensional data processing tasks, the fully connected layer can connect every pixel in the input data to every pixel in the output data, so that every pixel in the output data can be common to all pixels in the input data. Decide. This method can effectively extract features from the input data, thereby improving the performance of the model. The fully connected layer uses a forward-structured artificial neural network such as a multi-layer perceptron, including an input layer, an output layer and multiple hidden layers. As a directed graph, a multilayer perceptron is composed of multiple node layers, and each layer is fully connected to the next layer. Except for the input node, each node is a neuron (or processing unit) with a nonlinear activation function.
实施例6Example 6
本发明使用组合的信号预处理方式进行数据增强,利用短时傅里叶变换与时域数据的一维向量和二维向量增强方式使得数据集的样本量得到了几个数量级的提升,从而拓展数据量,使模型得到更多信息。使用自注意力机制使其更好的利用先验知识从新数据中学习到辐射源指纹特征。即使在新的环境下得到数据特征改变,也能通过这种方式捕捉新环境和原来的环境通用的特征和模式,提高模型的复用性。使用滑动窗口的方法使网络参数的更新降低计算复杂度,并提高模型的训练速度和推理速度,计算复杂度减少到了原来的(M/h)2,即子窗口,带来更高的效率和训练速度。模型的输出映射到特定类别的一层神经网络的分类方法,在双通道时域一维数据处理任务中使用softmax函数。在变化域(频域等)二维数据处理任务中使用全连接层。The present invention uses a combined signal preprocessing method for data enhancement, and uses short-time Fourier transform and one-dimensional vector and two-dimensional vector enhancement methods of time domain data to increase the sample size of the data set by several orders of magnitude, thereby expanding The amount of data allows the model to get more information. The use of self-attention mechanism makes it better to use prior knowledge to learn radiation source fingerprint features from new data. Even if the data characteristics change in the new environment, the common characteristics and patterns of the new environment and the original environment can be captured in this way, improving the reusability of the model. Using the sliding window method reduces the computational complexity of updating network parameters and improves the training speed and inference speed of the model. The computational complexity is reduced to the original (M/h) 2 , that is, the sub-window, which brings higher efficiency and Training speed. A classification method in which the output of the model is mapped to a specific class of one-layer neural network, using the softmax function in a dual-channel time domain one-dimensional data processing task. Fully connected layers are used in two-dimensional data processing tasks in the changing domain (frequency domain, etc.).
图3为使用传统技术残差网络resnet50在新场景数据集训练和测试80代的表现,左图train_acc和valid_acc分别代表训练集和测试集识别准确率曲线;右图的train_loss和valid_loss代表训练集和测试集损失函数曲线。目标域损失函数曲线的没有收敛表明,新场景的数据和任务和原场景差异很大导致现有技术残差网络resnet50无法适应新场景。Figure 3 shows the performance of the traditional technology residual network resnet50 in the new scene data set training and testing of the 80th generation. The train_acc and valid_acc on the left represent the training set and test set recognition accuracy curves respectively; the train_loss and valid_loss on the right represent the training set and Test set loss function curve. The lack of convergence of the target domain loss function curve shows that the data and tasks of the new scene are very different from the original scene, causing the existing technology residual network resnet50 to be unable to adapt to the new scene.
图4为使用传统技术残差网络resnet50在新场景数据集的识别准确率混淆矩阵。表中对应0-15标签的目标为待识别目标,对角线的准确率较低表明resnet50在新场景数据集下不能准确的识别待识别目标。Figure 4 shows the recognition accuracy confusion matrix of the new scene data set using the traditional technology residual network resnet50. The targets corresponding to labels 0-15 in the table are targets to be identified. The low accuracy of the diagonal line indicates that resnet50 cannot accurately identify targets to be identified in the new scene data set.
图5为使用本发明在相同数据集训练和测试80代的表现,左图train_acc和valid_acc分别代表训练集和测试集识别准确率曲线;右图的train_loss和valid_loss代表训练集和测试集损失函数曲线。目标域损失函数曲线的收敛表明,本发明能够适应这种数据和任务和原场景差异很大的新场景。Figure 5 shows the performance of using the present invention in 80 generations of training and testing on the same data set. The train_acc and valid_acc on the left represent the recognition accuracy curves of the training set and the test set respectively; the train_loss and valid_loss on the right represent the loss function curves of the training set and the test set. . The convergence of the target domain loss function curve shows that the present invention can adapt to this new scenario where the data and tasks are very different from the original scenario.
图6使用本发明在新场景数据集的识别准确率混淆矩阵。表中对应0-15标签的目标为待识别目标,对角线的准确率较高表明本发明技术在新场景下可以较为准确的识别待识别目标。Figure 6 shows the recognition accuracy confusion matrix of the new scene data set using the present invention. The targets corresponding to labels 0-15 in the table are targets to be identified. The higher accuracy of the diagonal line shows that the technology of the present invention can more accurately identify targets to be identified in new scenarios.
以上公开的本发明优选实施例只是用于帮助阐述本发明。优选实施例并没有详尽叙述所有的细节,也不限制该发明仅为所述的具体实施方式。显然,根据本说明书的内容,可作很多的修改和变化。本说明书选取并具体描述这些实施例,是为了更好地解释本发明的原理和实际应用,从而使所属技术领域技术人员能很好地理解和利用本发明。本发明仅受权利要求书及其全部范围和等效物的限制。The preferred embodiments of the invention disclosed above are only intended to help illustrate the invention. The preferred embodiments do not describe all details, nor do they limit the invention to the specific implementations described. Obviously, many modifications and variations are possible in light of the contents of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can better understand and utilize the present invention. The invention is limited only by the claims and their full scope and equivalents.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310767307.3A CN116894207A (en) | 2023-06-27 | 2023-06-27 | An intelligent radiation source identification method based on Swin Transformer and transfer learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310767307.3A CN116894207A (en) | 2023-06-27 | 2023-06-27 | An intelligent radiation source identification method based on Swin Transformer and transfer learning |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116894207A true CN116894207A (en) | 2023-10-17 |
Family
ID=88312955
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310767307.3A Pending CN116894207A (en) | 2023-06-27 | 2023-06-27 | An intelligent radiation source identification method based on Swin Transformer and transfer learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116894207A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117113063A (en) * | 2023-10-19 | 2023-11-24 | 北京齐碳科技有限公司 | Encoder, decoder, codec system and method for nanopore signals |
-
2023
- 2023-06-27 CN CN202310767307.3A patent/CN116894207A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117113063A (en) * | 2023-10-19 | 2023-11-24 | 北京齐碳科技有限公司 | Encoder, decoder, codec system and method for nanopore signals |
CN117113063B (en) * | 2023-10-19 | 2024-02-02 | 北京齐碳科技有限公司 | Encoding and decoding system for nanopore signals |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Shon et al. | Unsupervised pre-training of imbalanced data for identification of wafer map defect patterns | |
CN113947114B (en) | Gas turbine rotor fault diagnosis method based on Transformer neural network and axis track | |
CN113343924B (en) | Modulation signal identification method based on cyclic spectrum characteristics and generation countermeasure network | |
CN112183269B (en) | A target detection method and system suitable for intelligent video surveillance | |
CN114626461B (en) | Cross-domain object detection method based on domain adaptation | |
CN117893481B (en) | Hybrid wafer defect identification and segmentation method based on self-supervision contrast learning | |
CN114972904B (en) | A zero-shot knowledge distillation method and system based on adversarial triplet loss | |
CN113936333A (en) | Action recognition algorithm based on human body skeleton sequence | |
CN116704431A (en) | On-line monitoring system and method for water pollution | |
Lee et al. | Semi-supervised learning for simultaneous location detection and classification of mixed-type defect patterns in wafer bin maps | |
CN117876842A (en) | A method and system for detecting anomalies of industrial products based on generative adversarial networks | |
CN114544172A (en) | Rotary machine fault diagnosis method, system and medium based on deep confidence network | |
Jain et al. | LogoNet: Layer-aggregated attention centernet for logo detection | |
CN116894207A (en) | An intelligent radiation source identification method based on Swin Transformer and transfer learning | |
CN118568650A (en) | Industrial anomaly detection method and system based on fine-grained text prompt feature engineering | |
CN118351594A (en) | Motion gesture recognition method based on machine learning | |
Singh et al. | Recognition of Scanned Handwritten digits using Deep Learning | |
Kacem et al. | Disentangled face identity representations for joint 3d face recognition and neutralisation | |
CN114998609B (en) | A multi-class commodity target detection method based on dense feature extraction and lightweight network | |
CN116452874A (en) | A Fine Classification Method for Complex Objects Based on Dual-Channel Attention Mechanism | |
Kacem et al. | Disentangled face identity representations for joint 3D face recognition and expression neutralisation | |
CN114494827A (en) | A small target detection method for detecting aerial pictures | |
Li et al. | Adaptive Multi-branch Feature Fusion Attention Network for Few-Shot Image Classification | |
Dai et al. | A low-complexity visual tracking approach with single hidden layer neural networks | |
Wang et al. | MADB-RemdNet for Few-Shot Learning in Remote Sensing Classification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |