Broadband spectrum sensing method and device for enhancing attention mechanism and position coding
By introducing enhanced attention mechanisms and position coding methods in broadband spectrum perception, the problem of poor performance of traditional spectrum perception in low signal-to-noise ratio environments is solved, and more efficient spectrum resource utilization and better reconstruction probability are achieved.
Patent Information
- Application Number
- CN202411717916.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Traditional spectrum perception methods have poor performance in low signal-to-noise ratio environments, and the hardware equipment sampling rate required for broadband sampling is extremely high, making it difficult to effectively utilize spectrum resources.
A broadband spectrum perception method with enhanced attention mechanism and position encoding is adopted. By undersampling and dimensionality reduction of broadband spectrum signals, combined with the attention mechanism of the Transformer model and the position encoding of the convolutional network, signal characteristics are extracted and classified and identified.
In a low signal-to-noise ratio environment, the accuracy of spectrum perception and reconstruction probability are significantly improved, the requirements for hardware equipment sampling rate are reduced, and the problem of low spectrum resource utilization is effectively solved.
Smart Images

Figure CN119561635A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of radio communication technology, and in particular relates to a broadband spectrum sensing method and device with enhanced attention mechanism and position coding. Background Art
[0002] Spectrum is an important and non-renewable resource. The number of mobile IoT devices is expected to reach billions in the next few years, and they require a large amount of spectrum to transmit multimedia data and interact with each other. The demand for spectrum is increasing day by day, and the contradiction between the low utilization rate of spectrum resources and the shortage of spectrum resources is becoming increasingly acute. Spectrum sensing is a promising solution to the problem of spectrum scarcity. Traditional spectrum sensing has disadvantages such as poor perception performance under low signal-to-noise ratio conditions, and when facing wideband sampling, according to the Nyquist sampling theorem, the sampling rate of the required hardware equipment will reach an extremely high level. In the past decade, various wideband spectrum sensing methods based on sub-Nyquist sampling have been proposed to overcome the need for high-speed ADCs. Deep learning algorithms have the ability to autonomously extract complex and nonlinear features in wideband spectrum. At present, deep learning technology is increasingly being used for spectrum perception tasks.
[0003] Deep learning models can help users understand, analyze, and make decisions in complex radio environments in the future. With the improvement and popularization of hardware computing power, the application of deep learning on the edge is becoming more and more mature. Researchers have begun to study more trainable models to complete spectrum sensing related tasks. The models currently used by researchers to solve spectrum sensing are mostly CNN or RNN models. We noticed that models such as CNN and RNN are good at extracting local detail information, while the Transformer model is good at managing long dependencies between input sequence elements and promoting parallel processing.
[0004] The Transformer model has a global receptive field and can model the whole world, while the convolutional neural network only has a local receptive field. Models with a global receptive field fundamentally have the ability to process more complex data. They can build relationships between all inputs and are very suitable for mining the relationships between various signals appearing over very wide frequency bands. However, there are currently few studies on using the Transformer model to solve spectrum sensing problems.
[0005] In summary, spectrum is a non-renewable and valuable resource. With the rapid increase in the number of mobile intelligent Internet devices, the demand for spectrum has increased sharply, but the contradiction of low utilization has become more and more prominent. Traditional spectrum sensing methods perform poorly in low signal-to-noise ratio environments, and the hardware requirements for wideband sampling are too high.
[0006] In recent years, the combination of sub-Nyquist sampling technology and deep learning has become an effective way to address these challenges. In particular, deep learning can autonomously extract complex features in the spectrum, which has promoted progress in the field of spectrum sensing. Unlike CNN and RNN, which are good at extracting local information, the Transformer model shows great potential with its global receptive field and ability to process complex data relationships. Summary of the invention
[0007] In view of this, the main purpose of the present invention is to provide a broadband spectrum sensing method and device with enhanced attention mechanism and position coding.
[0008] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0009] An embodiment of the present invention provides a broadband spectrum sensing method with enhanced attention mechanism and position coding, the method comprising:
[0010] Perform undersampling and dimension reduction processing on the broadband spectrum signal to obtain a preprocessed signal;
[0011] Performing enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism;
[0012] Performing position encoding on the preprocessed signal to obtain enhanced signal position information;
[0013] Input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features;
[0014] The signal features output by the feature extraction network are classified and identified to obtain the spectrum sensing results.
[0015] In the above scheme, the broadband spectrum signal is subjected to undersampling and dimension reduction processing to obtain a preprocessed signal, specifically comprising: according to X(f)=Φ -1 Y(f) determines the original signal; where Y(f) is the sampling vector, and f represents the frequency of the signal in the frequency domain axis;
[0016] Generating estimated data by PCA (Principal Component Analysis) on the original signal;
[0017] Use PCA to reduce the dimension of the data and select the main components;
[0018] The frequency spectrum information of the signal is obtained through FFT (Fast Fourier Transform).
[0019] In the above scheme, the pre-processed signal is subjected to enhanced attention mechanism processing to obtain the signal after the enhanced attention mechanism processing, which specifically includes: the enhanced attention mechanism processing includes: performing feature extraction on the query vector q, and then determining the similarity between the query vector q and the key vector k of the local information after feature extraction as a weight, wherein a convolution layer is added after the query vector q to extract local features, and then attention calculation is performed to obtain the final output result.
[0020] In the above scheme, the determination of the similarity between the query vector q and the key vector k as the weight specifically includes: Determine the weights, where T is the matrix transpose operation, q is the matrix representing the query vector in the attention mechanism, k is the matrix representing the key vector in the attention mechanism, and d k is the dimension of the key vector.
[0021] In the above scheme, a convolution layer is added after the q vector to extract local features, specifically including: Determine; among them, is the activation value of position (i, j) in the kth feature map, F is the size of the convolution filter, C is the number of input channels, and W m,n,l,k is the weight of the convolution filter at position (m, n) in the lth input feature map and the kth output feature map, X is the value of the input feature map at the corresponding position, and b k is the bias of the kth output feature map.
[0022] In the above scheme, the attention calculation is performed again to obtain the final output result, specifically including: according to Headout = Concat (Attention1, Attention2, K, Attention h )W o Get the final output result; Among them, Attention h Based on The output value of the h-th attention mechanism is obtained, Concat is the concatenation of the outputs of all attention heads, W o It is a linear transformation matrix used to map the concatenated result to the final output dimension.
[0023] In the above scheme, the position encoding of the preprocessed signal to obtain the enhanced signal position information is specifically: using three convolutional layers to extract invisible position information of the preprocessed signal to obtain the enhanced signal position information;
[0024] In the above scheme, the signal features output by the feature extraction network are classified and identified to obtain spectrum sensing results, specifically including: fusing the position information and the signal features processed by the attention mechanism, according to Obtain the classification and recognition results; where f is its representation in the frequency domain, is the output value of the lth prediction sub-band.
[0025] The embodiment of the present invention further provides a broadband spectrum sensing device with enhanced attention mechanism and position coding, comprising:
[0026] A data preprocessing module is used to perform undersampling and dimension reduction processing on the broadband spectrum signal to obtain a preprocessed signal;
[0027] An enhanced attention mechanism module is used to perform enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism;
[0028] A position encoding module, used for performing position encoding on the preprocessed signal to obtain enhanced signal position information;
[0029] A feature extraction network is used to input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features;
[0030] The classification and recognition module is used to classify and recognize the signal features output by the feature extraction network to obtain spectrum sensing results.
[0031] Compared with the prior art, the present invention can better restore the spectrum occupancy, especially at low signal-to-noise ratio, and has a better spectrum reconstruction probability compared with other models. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to disclose a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0033] Figure 1 A structural diagram of a broadband spectrum sensing method with enhanced attention mechanism and position coding is provided for an embodiment of the invention;
[0034] Figure 2 An internal detail diagram of an attention mechanism in a broadband spectrum sensing method with enhanced attention mechanism and position encoding is provided for an embodiment of the invention;
[0035] Figure 3 An example diagram of position coding design in a broadband spectrum sensing method with enhanced attention mechanism and position coding is provided for an embodiment of the invention;
[0036] Figure 4 An overall network structure diagram of an EAPC-WSS model in a broadband spectrum sensing method with enhanced attention mechanism and position coding is provided for an embodiment of the invention;
[0037] Figure 5 Comparison of the reconstruction probability between the present invention and the other two models;
[0038] Figure 6 For the ablation experiment of the present invention;
[0039] Figure 7 Comparison of reconstruction probabilities between the present invention and various methods;
[0040] Figure 8 is the reconstruction probability of the model under different sampling channels. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0042] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, article or device. In the absence of more restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, article or device including the element.
[0043] The embodiment of the present invention provides a broadband spectrum sensing method with enhanced attention mechanism and position coding, the method comprising the following steps:
[0044] Step 101: performing undersampling and dimensionality reduction processing on the broadband spectrum signal to obtain a preprocessed signal;
[0045] Specifically, according to X(f)=Φ -1 Y(f) determines the original signal; where Y(f) is the sampling vector, f represents the frequency of the signal in the frequency domain axis, and undersampling can greatly reduce the requirements on the hardware;
[0046] Generating estimated data by PCA (Principal Component Analysis) on the original signal;
[0047] Use PCA to denoise the data and select the components that mainly contain spectral information;
[0048] The preprocessed signal matrix containing spectrum information is obtained through FFT (Fast Fourier Transform).
[0049] The signal matrix after denoising can reduce the impact of noise on the output of the later model;
[0050] The present application selects a method that can effectively focus on long-range dependencies in signals, weight important information, and adaptively focus on key parts of the input when processing spectral signals.
[0051] Step 102: Performing enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism;
[0052] Specifically, the enhanced attention mechanism processing includes: performing feature extraction on the query vector q, and then determining the similarity between the query vector q and the key vector k of the local information after feature extraction as a weight, wherein a convolution layer is added after the query vector q to extract local features, and then performing attention calculation to obtain the final output result of the enhanced attention mechanism, that is, the signal after the enhanced attention mechanism processing.
[0053] according to Determine the attention mechanism weights, where T is the matrix transpose operation, q is the matrix representing the query vector in the attention mechanism, and k is the matrix representing the key vector in the attention mechanism. The calculation of q and k is obtained by multiplying two learnable parameter matrices with the preprocessed signal matrix. k is the dimension of the key vector.
[0054] according to Determine the activation value; where, is the activation value of position (i, j) in the kth feature map, F is the size of the convolution filter, C is the number of input channels, and W m,n,l,k is the weight calculated by the convolutional network added in the attention mechanism at the position (m, n) of the convolutional filter in the lth input feature map and the kth output feature map, X is the value of the input feature map at the corresponding position, and b k is the bias of the kth output feature map. The activation value of the entire feature map of the q vector is calculated by this formula and then replaced by the original value to participate in the calculation of the output value of the attention mechanism.
[0055] According to Headout = Concat(Attention1, Attention2, K, Attention h )W o Get the final output result; Among them, Attention h Based on The output value of the h-th attention mechanism is obtained, Concat is the concatenation of the outputs of all attention heads, W o It is a linear transformation matrix used to map the concatenated result to the final output dimension.
[0056] Step 103: performing position encoding on the preprocessed signal to obtain enhanced signal position information;
[0057] Specifically, if Figure 3 As shown, three convolutional layers are used to extract invisible position information from the preprocessed signal to obtain enhanced signal position information;
[0058] Extract clearer spectrum information from the enhanced signal location information and integrate it into the network;
[0059] The designed positional encoding is simpler than the original positional encoding and can improve generalization ability, effectively improving the model's ability to acquire spectral information.
[0060] Step 104: Input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features;
[0061] Step 105: Classify and identify the signal features output by the feature extraction network to obtain spectrum sensing results.
[0062] Specifically, the signal features after fusion of position information and attention mechanism processing are analyzed according to Obtain the classification and recognition results; where f is its representation in the frequency domain, is the output value of the lth prediction sub-band.
[0063] The example of the present invention can better restore the spectrum occupancy, especially at low signal-to-noise ratio, and has a better spectrum reconstruction probability compared to other models. The use of the EAPC-WSS model can better perceive global information, and adding convolution to extract local information on the basis of the original global information can obtain more spectrum information, reaching the lowest signal-to-noise ratio of the test, and the model reconstruction rate is increased by about 25% based on the original information. At the lowest signal-to-noise ratio, the present invention is improved by about 30% compared to other models, which is obviously a significant improvement over other models.
[0064] In the embodiment of the present invention, the software environment of the simulation experiment is: 64-bit Win10 operating system, matlab2023a, pytorch 2.1.2, CUDA 12.2. The hardware environment is: 28-core Intel(R) Xeon(R) Gold 6330 CPU@2.00GHz, NVIDIA GeForce RTX 3090 with 24GB video memory, and the deep learning framework used is Pytorch.
[0065] The present invention implements the method of first superimposing random Gaussian white noise on multiple sinc signals generated by matlab, and then performing MWC undersampling and PCA denoising on the signals. The training set uses a signal with a frequency band number N of 6, a channel number m of 25, and a signal-to-noise ratio (SNR) of [0, -1, -2, ..., -10] dB, and the signal generation of each signal-to-noise ratio uses a generated median of {0.2, 0.4, 0.6, 0.8} plus a case where the median is arbitrarily generated, and 200 data are generated for each case, and a total of 11,000 data are used to train the model. Using this method can ensure that the model obtains more and richer spectrum information in the training stage to face the verification of signals with uncertain signal-to-noise ratios in real spectrum situations, and enhance the generalization ability of the model.
[0066] Step 1: Wideband spectrum signal generation
[0067] In matlab, firstly, the original signal is superimposed by three parameter-settable sinc functions, that is, the original signal has N = 6 frequency bands. The original signal is calculated by the following formula:
[0068]
[0069] Among them, t represents the time of the original signal in the time domain, E i represents the energy coefficient of the i-th subband, B max represents the maximum width of the subband, τ i refers to the time offset of the ith subband, f ci Refers to the center frequency of the i-th subband. After obtaining the original signal, a Gaussian white noise signal is randomly generated, and then the randomly generated Gaussian white noise and the original signal are used as the final generated signal. Then, the pseudo-random sequence signal is mixed with the simulation signal to obtain a shifted low-frequency signal. Then, the shifted low-frequency signal is undersampled by MWC through m channels, and the undersampled signal is Fourier transformed to obtain a sampling vector. The mixed signal is Fourier transformed to obtain the observation matrix. Then, the support set of the original signal, the inverse of the observation matrix Φ, and the noise obtained after sampling and the sampling vector Y(f) after the output is superimposed are passed into the preprocessing module as data sets.
[0070] Matlab generates a simulated signal with a signal-to-noise ratio of [0, -1, -2, ..., -10] dB. The bandwidth of the signal is 50 MHz, and the number of frequency bands N is 6. The signal generation for each signal-to-noise ratio uses the signal median of {0.2, 0.4, 0.6, 0.8} plus a case where the median is randomly generated. 200 data are generated for each case, for a total of 11,000 data.
[0071] Step 2: Perform MWC undersampling on the generated simulation signal
[0072] MWC undersampling is a sub-Nyquist sampling method for sparse broadband analog signals. It has a good recovery effect for sparse broadband sampling and is used for data sampling. In this method, the analog signal is first multiplied by a periodic waveform through a set of modulators, and then low-pass filtered and uniformly sampled at a low rate, so that its sampling rate is much lower than the Nyquist rate. Use m sets of parallel channels, each channel uses a different mixing signal to mix the data. Then, the support set of the original signal, the inverse of the observation matrix Φ calculated according to the mixing signal, the noise obtained after sampling, and the sampling vector Y(f) after the output superposition are sent to the preprocessing module as data.
[0073] In the data preprocessing module, the original signal is calculated according to formula (2).
[0074] X(f)=Φ -1 Y(f) (2)
[0075] Among them, f represents the frequency of the signal in the frequency domain axis. After calculating the original signal according to formula (2), we use PCA to generate estimated data. PCA (Principal Component Analysis) is used to reduce the dimension of the data and select the main components. The spectrum information of the signal is obtained through FFT (Fast Fourier Transform), and the data set is divided into a training set and a test set in a ratio of 7:3.
[0076] Step 3: De-noise the sampled signal
[0077] Principal component analysis is a statistical method commonly used for dimensionality reduction and feature extraction. It can also be used for data denoising. The basic idea of PCA denoising is to project high-dimensional data into a lower-dimensional principal component space to retain the main features of the data and remove noise. Its core principle is that noise is usually distributed on the secondary components of the data, while the main components carry the most important information; by retaining the main components and removing the secondary components, noise can be effectively removed. PCA dimensionality reduction is used to generate estimated data. The PCA function in the scikit-learn package is used directly to achieve dimensionality reduction, and the principal component in the function is set to 1. Considering that the spectrum information is more intuitive, FFT is used to obtain the spectrum of the signal and use it as a training data set. After this step, the signal after PCA denoising is obtained.
[0078] Step 4: Build an enhanced attention mechanism
[0079] When calculating the final attention, the attention mechanism in Transformer first calculates the similarity between each q and k and uses it as the weight. The weight calculation is as follows:
[0080]
[0081] Among them, T represents the matrix transpose operation, the q matrix represents the query vector in the attention mechanism, the k matrix represents the key vector in the attention mechanism, and the d k is the dimension of the key vector, divided by The purpose is to normalize the output so that the output value remains within a reasonable range. The i-th and j-th weight outputs are normalized by multiplying the transpose of the i-th q matrix and the j-th k matrix in multiple groups q and k.
[0082] Through the matrix dot product formula, we can know that the more similar the two are, the larger the value obtained, so it can be used to calculate the similarity. In the preprocessing, the signal is projected onto a dimension with large spectral information variance, but in the frequency domain, there is still Gaussian white noise that is still spread throughout the spectrum after filtering out the part. Since the received signal is a sparse spectrum signal in the spectrum, the energy of the signal is more concentrated in several frequency bands. We want the network to pay more attention to the original spectrum signal between the Gaussian white noise that is spread throughout the spectrum and the original spectrum signal that is only concentrated in a few frequency bands. The convolutional network has the ability to extract network features. Therefore, a layer of convolutional network is designed in the attention mechanism, and the convolutional network calculation formula is as follows:
[0083]
[0084] in, refers to the activation value at position (i, j) in the kth feature map. F refers to the size of the convolution filter, C refers to the number of input channels, and 1 is subtracted from F and C to ensure that the index starts from 0. W m,n,l,k is the weight of the convolution filter at position (m,n) in the lth input feature map and the kth output feature map, and X is the value of the input feature map at the corresponding position. k is the bias of the kth output feature map. In the convolutional network, each multiplication with the convolution kernel can extract the local features of the input data and realize the abstraction of features. Combining this feature with the attention mechanism, a convolution layer is added after q. The features of q are extracted before calculating the weights. When calculating the weights, the model pays more attention to the local information in the spectrum information to improve the prediction accuracy of the spectrum. In the design, a layer of convolution with zero padding is used to operate on q. The convolution kernel is 3*3 in size. After the convolution operation, the dimension of q remains unchanged.
[0085] Then the multi-head attention mechanism is calculated, and the output value of the multi-head attention mechanism is as follows:
[0086]
[0087] Among them, q is the query vector that indicates the degree of attention of the current element to other elements, which determines the attention allocation. k is the key vector that provides the basis for the relevance of each element to other elements and is used to calculate similarity. v is the value vector that contains the actual information, which is finally used to generate the output after the attention weight calculation. h represents the number of attention mechanism heads. It turns out that i,j The query is replaced by a designed one with a convolutional layer After the vector is calculated again, v j Represents the jth value vector. The attention to local information in the spectral information is added to the attention mechanism.
[0088] Finally, the output of the multi-head attention mechanism is as follows:
[0089] Headout=Concat(Attention1,Attention2,K,Attention h )W o (6)
[0090] Among them, Attention h is the output value of the hth attention mechanism calculated according to formula (5). Concat refers to concatenating the outputs of all attention heads. o Is a linear transformation matrix used to map the concatenated result to the final output dimension.
[0091] In each Encoder, in the Self-Attention mechanism of the Transformer model, feature information is incorporated by introducing a convolutional layer after q, hoping that the network can learn different spectral information from the features. And a multi-head attention mechanism is used to generate multiple sets of q, k, and v vectors, which allows the network to focus on the relationship between the input spectral vectors from different angles. The signal matrix is processed. These four Encoder architectures process the signal matrix in turn, and each Encoder module contains a self-attention mechanism and a feedforward neural network. In this way, the model can gradually extract the abstract features of the signal at different levels, making the final representation richer and more meaningful.
[0092] Step 5: Build enhanced positional encoding
[0093] Traditional position coding requires an independent code to be provided for each input position, and when facing long sequences and large-scale data, it is more complicated and has poor generalization ability because it needs to design specific position codes for each position independently. Many researchers have found that using convolutional networks to complete position coding can extract invisible position information. It enables the network to learn implicit position information through learnable network parameters. In the network, the convolutional network can obtain the absolute position information of the spectrum, and the zero-filling layer can enable the model to perceive the edge information of the spectrum, that is, the relative position information. Through continuous training, the network can identify more invisible position information, and the residual network makes the network pay more attention to the original spectrum information from a structural perspective. Through this design, the position coding module not only reduces the complexity of the design, but also improves the generalization ability of the model and enhances the reconstruction probability of the model.
[0094] In order to let the network know that the spectrum information is ordered and expect the network to learn features from the sequence, a three-layer zero-filled residual convolutional network (RPE) is designed. The final output format of RPE is as follows:
[0095] OutPut=RPE(InPut)+InPut(8)
[0096] Among them, RPE represents the model used to process Input, and the output is equal to the processed input plus the input itself.
[0097] In order to discuss the rationality of the RPE structure, the different numbers of convolutional layers with residuals are compared with the position encoding method of the VIT model. The reconstruction probability when the number of channels m = 25, N = 6 with PCA denoising is shown in Table 1. It can be seen from the table that compared with the position encoding method of the VIT model, the proposed RPE structure has a better performance, especially when SNR = -8dB, its reconstruction rate is seven percentage points higher. In the comparison with convolutional networks of different layers, the model has the best reconstruction rate in terms of the full signal-to-noise ratio.
[0098] Table 1: Reconstruction rate of different position encoding methods (%)
[0099] Structure -10dB -8dB -6dB -4dB -2dB 0dB 4-layer-CNN 46.28 62.24 74.52 81.4 84.88 88.48 3-layer-CNN 63.68 77.08 83.28 89 89.32 91.32 2-layer-CNN 56.5 72.12 81 85 87.34 90.4 1-layer-CNN 60.8 74.9 83.8 85.9 88.3 91 VITmodelmethod 60.36 70.76 77.88 84.2 85.2 88.16
[0100] Step 6. The preprocessed data is passed into the model structure
[0101] The model structure is as follows Figure 4As shown. The signal vector first passes through the linear Embedding layer. This step is to fix the separated L d-dimensional vectors to N dimensions to obtain a more refined expression. After linear processing, the signal is sent to the designed RPE module. In the module, the implicit positional relationship is learned through the convolution layer, and the learned relationship is put into the signal and output to the next layer. The output is sent to four Encoder architectures with the same structure but different parameters. In each Encoder, in the Self-Attention mechanism of the Transformer model. After the Encoder, the model is transformed in dimension through one-dimensional convolution and relevant feature information is extracted. Finally, the obtained representation is classified through MLP, and the final prediction result is obtained through the activation function. The final output is as follows:
[0102]
[0103] Among them, after inferring the output value in formula (2), the output value of the predicted sub-band is obtained, and f represents its representation in the frequency domain. Refers to the output value of the lth prediction sub-band. The sigmoid function is used to perform nonlinear transformation on the output value of the sub-band, limiting the output value to between 0 and 1.
[0104] The training data is trained after PCA denoising. In order to show how much PCA processing helps the model, the signal without PCA processing is verified. And under the same training method, that is, only different processing is performed on the data, the influence of other preprocessing methods on the reconstruction probability of the model is compared. That is, the reconstruction probability with SVD (Singular Value Decomposition) and DAE (Denoising Auto-Encoder) is compared. Table 2 shows the comparison of the reconstruction probability performance of the validation set under the conditions of m=20, n=6, after PCA processing and unprocessed data, and under the methods of SVD and DAE. It can be seen that under different signal-to-noise ratios, the reconstruction probability of the model after PCA denoising is obviously higher than the reconstruction probability without using preprocessing methods, and slightly higher than the reconstruction probability using SVD. And after experiments, the preprocessing method of DAE is not suitable for preprocessing of broadband spectrum, and its self-supervised learning will cause the spectrum to lose some of its original information. When three linear layers are used, its reconstruction probability reaches the highest, but it is still lower than the reconstruction probability without using preprocessing. And through experiments, it is found that the more linear layers there are and the more complex the network is, the lower the probability of model reconstruction is, and the more difficult it is to restore the original spectrum state.
[0105] Table 2: Comparison of reconstruction probability of different preprocessing methods (%)
[0106]
[0107]
[0108] Since the signal without PCA processing can better show the performance of the model itself. To this end, the TFF-aDCNN network and the DLVSS network are found to compare the reconstruction accuracy of the model. TFF-aDCNN and DLVSS are based on MWC specific sampling settings, and the DLVSS network needs to be slightly adjusted to test the performance of the model. When the same data set as the TFF_aDCNN network is used for training, that is, the training method is changed, and 8500 data are trained separately at each signal-to-noise ratio, the performance under the signal-to-noise ratio is verified separately. The accuracy comparison is as follows: Figure 5 As shown in Figure 2, it can be seen that when the parameters designed in MWC sampling are m=20 and N=6, the reconstruction probability of EAPC-WSS is significantly higher than that of TFF-aDCNN network and DLWSS network, which shows that the model has better performance than them.
[0109] RPE and different multi-head attention schemes were designed. In order to verify the improvement of the model by these two methods, the cases without RPE and using the original multi-head attention mechanism were tested. The effectiveness of the two proposed methods was verified under different signal-to-noise ratios. Both methods use a signal sampling scheme with sampling channels m=25 and frequency bands n=6. The results are shown in Figure 2. Figure 6 As shown in Figure 2, it can be seen that the lower the signal-to-noise ratio, the higher the improvement in the reconstruction probability.
[0110] The same dataset and training method as the TFF_aDCNN network were used for training. That is, the dataset was first subjected to PCA denoising. Under each signal-to-noise ratio condition, the training set had 8,500 data and the test set had 1,500 data. The reconstruction probability comparison of the unadjusted TFF_aDCNN network, SwSOMP, SOMP and other networks was tested. The results were Figure 7 As shown in the figure, it can be seen that the reconstruction probability of the model is greatly improved compared with these networks under low signal-to-noise ratio conditions, and the effect is better than these solutions in the full signal-to-noise ratio range, which proves the superiority of the model performance.
[0111] The reconstruction probability of the model under different signal-to-noise ratios and channels is compared, where the SNR is designed to be {-10, -8, -6, -4, -2, 0} dB. The model pursues the highest possible reconstruction probability under single-node and low signal-to-noise ratio. The number of channels m has three channels, {15, 20, 25}. The number of channels refers to the number of channels used to sample the signal under MWC downsampling. The larger the m, the more sampling channels there are, and the more spectral information is obtained. In actual situations, it means that the hardware conditions are more stringent. The purpose of selecting a range of channel numbers is to study the impact of different sampling densities on signal reconstruction performance. Therefore, pursuing low-channel high reconstruction rate is also a direction, which represents the saving of hardware resources. Figure 8 is the reconstruction probability of the model under different signal-to-noise ratios and different sampling channels.
[0112] The embodiment of the present invention further provides a broadband spectrum sensing device with enhanced attention mechanism and position coding, comprising:
[0113] The data preprocessing module is used to perform undersampling and dimension reduction processing on the broadband spectrum signal to obtain a preprocessed signal;
[0114] The enhanced attention mechanism module is used to perform enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism;
[0115] The position encoding module is used to perform position encoding on the preprocessed signal to obtain enhanced signal position information;
[0116] The feature extraction network is used to input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features;
[0117] The classification and recognition module is used to classify and recognize the signal features output by the feature extraction network to obtain spectrum sensing results.
[0118] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.
Claims
1. A broadband spectrum sensing method with enhanced attention mechanism and position coding, characterized in that: The method includes: Perform undersampling and dimension reduction processing on the broadband spectrum signal to obtain a preprocessed signal; Performing enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism; Performing position encoding on the preprocessed signal to obtain enhanced signal position information; Input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features; The signal features output by the feature extraction network are classified and identified to obtain the spectrum sensing results.
2. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 1, characterized in that: The method of performing undersampling and dimensionality reduction processing on the broadband spectrum signal to obtain a preprocessed signal specifically includes: according to X(f)=Φ -1 Y(f) determines the original signal; where Y(f) is the sampling vector, and f represents the frequency of the signal in the frequency domain axis; Generating estimated data by PCA (Principal Component Analysis) on the original signal; Use PCA to denoise the data and select the components that mainly contain spectral information; The preprocessed signal matrix containing spectrum information is obtained through FFT (Fast Fourier Transform).
3. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 1 or 2, characterized in that: The enhanced attention mechanism processing is performed on the preprocessed signal to obtain the signal after the enhanced attention mechanism processing, specifically including: the enhanced attention mechanism processing includes: extracting features from the query vector q, and then determining the similarity between the query vector q and the key vector k of the local information after feature extraction as a weight, wherein a convolution layer is added after the query vector q to extract local features, and then attention calculation is performed to obtain the final output result of the enhanced attention mechanism.
4. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 3, characterized in that: The determining of the similarity between the query vector q and the key vector k as a weight specifically includes: Determine the attention mechanism weight, where T is the matrix transpose operation, q is the matrix representing the query vector in the attention mechanism, k is the matrix representing the key vector in the attention mechanism, and d k is the dimension of the key vector.
5. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 4, characterized in that: A convolution layer is added after the q vector to extract local features, specifically including: Determine the activation value; where, is the activation value of position (i, j) in the kth feature map, F is the size of the convolution filter, C is the number of input channels, and W m,n,l,k is the weight calculated by the convolutional network added in the attention mechanism at the position (m, n) of the convolutional filter in the lth input feature map and the kth output feature map, X is the value of the input feature map at the corresponding position, and b k is the bias of the kth output feature map.
6. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 5, characterized in that: The attention calculation is then performed to obtain the final output result, specifically including: according to Headout = Concat (Attention1, Attention2, K, Attention h )W o Get the final output result; Among them, Attention h Based on The output value of the h-th attention mechanism is obtained, Concat is the concatenation of the outputs of all attention heads, W o It is a linear transformation matrix used to map the concatenated result to the final output dimension.
7. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 6, characterized in that: Position encoding is performed on the preprocessed signal to obtain enhanced signal position information, specifically: three convolutional layers are used to extract invisible position information from the preprocessed signal to obtain enhanced signal position information.
8. The broadband spectrum sensing method with enhanced attention mechanism and position coding according to claim 7, characterized in that: The signal features output by the feature extraction network are classified and identified to obtain spectrum sensing results, specifically including: fusion position information and signal features processed by the attention mechanism, according to Obtain the classification and recognition results; where f is its representation in the frequency domain, is the output value of the lth prediction sub-band.
9. A broadband spectrum sensing device with enhanced attention mechanism and position coding, characterized in that: include: A data preprocessing module is used to perform undersampling and dimension reduction processing on the broadband spectrum signal to obtain a preprocessed signal; An enhanced attention mechanism module is used to perform enhanced attention mechanism processing on the preprocessed signal to obtain a signal processed by the enhanced attention mechanism; A position encoding module, used for performing position encoding on the preprocessed signal to obtain enhanced signal position information; A feature extraction network is used to input the signal processed by the enhanced attention mechanism and the signal after position encoding into the feature extraction network to obtain signal features; The classification and recognition module is used to classify and recognize the signal features output by the feature extraction network to obtain spectrum sensing results.
Citation Information
Patent Citations
Intelligent broadband spectrum sensing technology based on pre-training basic model
CN115209418A
Frequency spectrum sensing method for transforming feature attention
CN115361080A
Spectrum sensing method based on Transform multi-head attention mechanism network under Alpha noise
CN115694692A