Signal modulation identification method based on small sample learning
A modulation recognition model based on time-frequency images, constructed using a few-shot learning method, utilizes feature extraction and metric networks to remove abnormal samples. By combining a hybrid attention mechanism and the Black Widow optimization algorithm, it solves the problem of missing labeled samples in wireless signal modulation recognition and achieves high-precision modulation recognition.
Patent Information
- Application Number
- CN202510996671.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
In the absence of labeled samples, existing deep learning methods have low accuracy in wireless signal modulation recognition, especially in complex electromagnetic environments where changes in signal-to-noise ratio cause sample anomalies that affect recognition performance.
We employ a few-shot learning approach, constructing a modulation recognition model based on time-frequency images. We utilize feature extraction and feature measurement networks to detect and remove anomalous samples. By combining a hybrid attention mechanism and the Black Widow optimization algorithm, we calculate the Euclidean distance to determine the modulation type.
It achieved a recognition accuracy of 95% under low signal-to-noise ratio conditions, which is better than similar few-shot learning models and improves recognition accuracy.
Smart Images

Figure CN120880848A_ABST
Abstract
Description
Technical Field
[0001] This application relates to a signal modulation recognition method based on few-sample learning, belonging to the field of wireless signal modulation recognition technology. Background Technology
[0002] Modulation identification, also known as modulation classification, is fundamentally about identifying the modulation scheme of radio signals under certain noise and interference environments. This provides a basis for further signal analysis and processing, and it is also a crucial characteristic for distinguishing different types of communication signals. In the military field, identifying signal modulation schemes is a prerequisite for reconnaissance of enemy radar. Once the modulation type is known, targeted reconnaissance and counter-reconnaissance strategies can be formulated to ensure friendly communications. In civilian applications, it can be used for radio management work such as signal confirmation, interference identification, and spectrum monitoring. Its task is to monitor whether legitimate radio stations strictly adhere to their assigned operating parameters, while simultaneously listening for interference and its sources from illegal stations. This prevents the illegal use and interference of the radio spectrum, providing management personnel with a basis for problem-solving and ensuring the normal operation of legitimate communications. However, with technological advancements, the electromagnetic environment is becoming increasingly complex. For example, in 6G communications, various modulation schemes are frequently used to achieve optimal communication performance. Therefore, identifying signal modulation schemes is becoming increasingly difficult, especially for signals from fast-moving targets such as connected vehicles and drone swarms, as well as in complex and ever-changing environments such as the ocean and those subject to adversarial attacks. This presents new challenges to existing modulation scheme identification technologies.
[0003] The most primitive modulation recognition was achieved through manual labeling by technicians. Because manual recognition involves significant human subjectivity and is affected by the technicians' knowledge level and experience, the recognition results are highly unstable. Especially under low signal-to-noise ratio conditions, where signals are severely interfered with by noise, it is difficult for the human eye to determine the modulation pattern solely from the signal waveform. With the rapid development of communication technology, research on signal modulation recognition has become more in-depth. In 1969, CSWeaver et al. first classified the signal modulation recognition problem as a pattern recognition problem, achieving a misclassification rate of 5%–10% in typical high-frequency environments. Subsequently, various recognition theories and methods emerged. Existing modulation recognition algorithms can be broadly classified into three categories: those based on likelihood functions, those based on feature extraction, and those based on deep learning. Currently, the third method is the most commonly used.
[0004] While conventional deep learning methods offer high recognition accuracy, they require a large amount of labeled data for training. In real-world communication environments, especially in fields such as electronic reconnaissance and space exploration, it is often difficult to acquire enough time and manpower to intercept sufficient signals, making model training extremely challenging. Furthermore, the problem of sample anomalies affecting recognition accuracy arises when the sample size is small.
[0005] Although deep learning methods have high recognition accuracy, they require a large amount of labeled data for training. In actual communication environments, especially in fields such as electronic reconnaissance and space exploration, it is usually difficult to have enough time and manpower to intercept enough signals, which makes model training very difficult. However, few-shot learning models can classify unlabeled samples using only a small amount of supervised information from labeled samples. In 2017, Snell proposed the Prototype Network (PN) in the paper "Prototypical networks for few-shot learning"[1], Sun proposed the improved Prototype Network in "Automatic Modulation Open-Set Recognition Based on Random Convolutional Prototype Network-MultiOCSVM"[2] in 2024, and Sung proposed the Relational Network (RN) in "Learning to compare: relation network for few-shot learning"[3] in 2018. All of these methods can effectively solve the modulation recognition problem under few-shot conditions, but all of these methods require the signal-to-noise ratio of the received data to be fixed. However, in complex electromagnetic environments such as electronic warfare, the enemy may suddenly release some interference, or the receiver may be affected by factors such as signal fading, making it impossible to obtain sample signals with the same signal-to-noise ratio. The signal samples corresponding to low signal-to-noise ratio will be severely distorted, resulting in a small number of abnormal samples in the received data measurement space, which often leads to model recognition errors. Summary of the Invention
[0006] To address the problem of how to improve the accuracy of wireless signal modulation recognition when there are few labeled samples and when sample abnormalities affect the accuracy of recognition, this application provides a signal modulation recognition method that can learn with a small number of samples while ensuring recognition accuracy.
[0007] The signal modulation recognition method based on few-shot learning in this application includes:
[0008] During the training phase, the received signals are converted into time-frequency images, and the time-frequency images are used to construct a training set, which includes a meta-support set and a meta-query set.
[0009] Construct a modulation recognition model, including a feature extraction network and a feature measurement network;
[0010] The time-frequency image is input into the feature extraction network, which extracts features from the time-frequency image to obtain a time-frequency feature map, which is then input into the feature measurement network.
[0011] The feature measurement network is used to detect anomalous sample maps in the meta support set and remove anomalous samples from the meta support set. Based on the remaining time-frequency feature maps in the meta support set after removing anomalous samples, the class prototypes of each category are calculated. The Euclidean distance between the time-frequency feature maps in the meta query set and the class prototypes of each category is calculated. The probability of the test sample belonging to each category is obtained based on the calculated Euclidean distance. The parameters of the feature extraction network are determined based on the obtained probabilities and the predicted labels.
[0012] The trained modulation recognition model is used to perform modulation recognition and prediction on the signal under test.
[0013] Preferably, the method for using a feature metric network to detect anomalous samples in the meta-support set and to remove anomalous samples from the meta-support set includes:
[0014] Calculate the Euclidean distance between the time-frequency feature maps of each pair of samples in each category of the meta support set, sort these distances from smallest to largest, and determine the sample in each category that is farthest from its time-frequency feature map of other samples of the same class, denoted as pc;
[0015] Calculate the mean of the time-frequency feature maps for samples other than pc in each category, and calculate... The distance d2′ from the mean, and The distance d2″ from pc;
[0016] When d2″>u×d2′, then pc is determined to be an abnormal sample, where u is a set value;
[0017] x i For the meta-query set D query The time-frequency image of the i-th sample to be tested. x represents i The time-frequency feature map obtained by inputting into the feature extraction network; This represents a feature extraction network. This represents the parameters of the feature extraction network.
[0018] Preferably, the class prototypes for each category are calculated based on the remaining time-frequency feature maps of the meta-support set after removing outlier samples:
[0019]
[0020] Among them, h v For the prototype of type v (v = 1, 2, ..., A), the meta-support set D support It includes Class A signals, with B samples per class of signal in the time-frequency image; x vbThe time-frequency image of the b-th sample of the v-th signal within the meta-support set. x represents vb The time-frequency feature map obtained by inputting into the feature extraction network;
[0021] The probability of each category is calculated using the Softmax activation function, and the time-frequency image x is obtained. i The probability of belonging to the vth category
[0022]
[0023] Among them, the type with the highest probability is selected as the predicted label.
[0024] As a preferred method, the method for determining u includes:
[0025] S1. Initialize the population, with a total population size of Z;
[0026] S2. The spider begins to move, searching for the optimal individual to mate and reproduce. The spider's position update model is as follows:
[0027]
[0028] in, Let i be the position of the i-th spider after the (t+1)th iteration. This is the current optimal position. It is the position of the r1th spider randomly selected from the population. α is the current position of the i-th spider, α and β are set motion parameters, and rand2 is a random number between {0,1};
[0029] S3. Determine the fitness function fitness(i) and calculate the sex pheromone of the i-th spider;
[0030]
[0031] Where I(i) is the total number of trials corresponding to the position of the i-th spider, and G(i) is the number of times the i-th spider is correctly identified;
[0032] The sex pheromone of the i-th spider is:
[0033]
[0034] In the formula, fitness max and fitness min These are the fitness values of the best and worst individuals in the population, respectively.
[0035] S4. When pheromone(i) ≤ k, update the parameters.
[0036]
[0037] In formula and The positions of the r1 and r2 black widow spiders are respectively, where r1 and r2 are the random population sizes in the range [1, Z], and r1 ≠ r2. σ is a random binary number in the range {0, 1}, and k is a set value.
[0038] S5. Re-evaluate the value of the fitness function fitness(i) and update the position of the optimal black widow spider and the optimal solution;
[0039] S6. Determine whether the result has converged or meets the maximum number of iterations. If so, output the position of the optimal Black Widow Spider, which is the global optimal solution. Otherwise, return to step S2, t = t + 1, and recalculate iteratively.
[0040] As a preferred method, the hybrid attention mechanism for obtaining refined feature maps includes:
[0041] Feature map F is the input to the hybrid attention mechanism. When feature map F is input to the channel attention mechanism, channel attention weights M are obtained. c (F);
[0042] Channel attention weight M c Multiplying (F) by the feature map F yields the channel-weighted feature map F. c ;
[0043] Channel weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c );
[0044] Meanwhile, the channel weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c );
[0045] Frequency attention weight M f (F c ) and channel-weighted feature map F c Multiplying them together yields the frequency-weighted feature map F. f ;
[0046] Time attention weight M t (F c ) and channel-weighted feature map F c Multiplying them together yields the time-weighted feature map F. t ;
[0047] Frequency-weighted feature map Ff With time-weighted feature map F t After concatenating the channels, a 1×1 convolution operation is performed to obtain a refined feature map F′, which is used as the output of the 2nd, 4th, 6th, or 8th convolutional block.
[0048] Preferably, the feature map F is input into the channel attention mechanism to obtain the channel attention weights M. c The methods in (F) include:
[0049] Feature map F is simultaneously input into global max pooling and global average pooling to obtain two feature maps. Each feature map undergoes a one-dimensional convolution operation. The two results are concatenated, and the concatenated result is activated by the Sigmoid activation function to generate channel attention weights M. c (F).
[0050] As a preferred option, channel-weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c The methods include:
[0051] Channel weighted feature map F c Average pooling is performed along the time axis to obtain the feature map F corresponding to channel g. g,x g = 1, 2, ..., C, where C represents the number of channels and x represents the time axis;
[0052] Feature map F g,x After three cascaded 3×3 convolutional layers, frequency features are obtained. These frequency features are then activated by a Sigmoid activation function to generate frequency attention weights M. f (F c ).
[0053] As a preferred option, channel-weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c The methods include:
[0054] Channel weighted feature map F c Average pooling is performed along the frequency axis to obtain the feature map F corresponding to channel g. g,y g = 1, 2, ..., C, where C represents the number of channels and y represents the frequency axis;
[0055] Feature map F g,y After passing through three cascaded 3×3 convolutional layers, the temporal features are obtained. These temporal features are then activated by the Sigmoid activation function to generate temporal attention weights M. t (F c ).
[0056] The beneficial effects of this application are that it fully explores the time-frequency features of signals and proposes a signal modulation recognition method based on few-shot learning. This method uses time-frequency images as input and utilizes a hybrid attention mechanism to fully explore the key features of the signal's time-frequency images in the channel, time, and frequency dimensions. It maps the time-frequency images of a small number of labeled samples and the samples to be identified to a unified metric space. The feature measurement part determines the modulation type of the sample to be identified by comparing the distance between the time-frequency feature map (feature vector) of the sample to be identified and the class prototypes of different modulation signals. Simultaneously, the Black Widow optimization algorithm is used to eliminate outliers to ensure recognition performance. Experimental results show that the recognition accuracy of this method reaches up to 95%, surpassing similar few-shot learning models. Attached Figure Description
[0057] Figure 1 This is a schematic diagram illustrating the principle of radar signal processing.
[0058] Figure 2 This is a diagram illustrating few-sample learning.
[0059] Figure 3 This is a schematic diagram illustrating the principle of the modulation recognition model in a specific embodiment of this application;
[0060] Figure 4 This is a schematic diagram illustrating the principle of the feature measurement network in a specific embodiment of this application;
[0061] Figure 5 This is a schematic diagram of the feature metric network when d2″>u×d2′;
[0062] Figure 6 A schematic diagram illustrating the principle of a hybrid attention feature extraction network;
[0063] Figure 7 This is a structural diagram of the hybrid attention mechanism in a specific embodiment of this application;
[0064] Figure 8 This is a structural diagram of the channel attention mechanism in a specific embodiment of this application;
[0065] Figure 9 This is a structural diagram of the frequency attention mechanism in a specific embodiment of this application;
[0066] Figure 10 This is a structural diagram of the time attention mechanism in a specific embodiment of this application;
[0067] Figure 11 The STFT (Short-time Fourier transform) time-frequency image of a portion of the modulated signal under SNR=18dB conditions;
[0068] Figure 12 This is the confusion matrix of PN in scenario 1;
[0069] Figure 13 For scenario 1, the PRF (Precision, Recall, F1 score) of PN.
[0070] Figure 14 This is the confusion matrix of the RN in scenario 1;
[0071] Figure 15 The PRF of the RN in scenario 1;
[0072] Figure 16 This is the confusion matrix of HMPN in scenario 1;
[0073] Figure 17 The PRF of HMPN in scenario 1;
[0074] Figure 18 This is the confusion matrix of PN in scenario 2;
[0075] Figure 19 For scenario 2, the PRF of PN;
[0076] Figure 20 This is the confusion matrix of the RN in scenario 2;
[0077] Figure 21 The PRF of RN in scenario 2;
[0078] Figure 22 This is the confusion matrix of HMPN in scenario 2;
[0079] Figure 23 This is the PRF of HMPN in scenario 2. Detailed Implementation
[0080] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0081] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0082] The present application will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the application.
[0083] This application designs a signal modulation recognition model based on a hybrid mechanism prototype network in the context of few-shot learning. The model employs a task-based learning strategy, utilizing a feature extraction network to map the time-frequency images of samples with a small number of labels and the time-frequency images of the sample to be identified to a unified metric space. The feature metric network determines the modulation type of the sample to be identified by comparing the distance between the time-frequency feature map of the sample to be identified and the class prototypes of different modulation types, and removes outlier samples, thus ensuring the model's recognition accuracy. The principle of few-shot learning is as follows: Figure 2 As shown. The few-shot learning model can classify unlabeled samples using only a small amount of supervised information from labeled samples. Therefore, this implementation fully utilizes the time-frequency characteristics of the signal and proposes a modulation recognition model based on the idea of few-shot learning to solve the modulation recognition problem in the absence of labeled samples. The signal modulation recognition method based on few-shot learning in this implementation includes:
[0084] Constructing modulation recognition models, such as Figure 3 As shown, it includes a signal preprocessing network, a feature extraction network, and a feature measurement network;
[0085] After the receiver samples the signal, the signal preprocessing network processes the input signal to obtain a time-frequency image, which visualizes the changes of the modulated signal in time and frequency.
[0086] The obtained time-frequency image is input into the feature extraction network, which extracts features from the time-frequency image to obtain a time-frequency feature map;
[0087] The obtained time-frequency feature map is input into the feature measurement network, and the feature measurement network outputs the predicted label.
[0088] During the training phase, the dataset constructed by the signal preprocessing network consists of a meta-support set and a meta-query set. After processing by the signal preprocessing network, the feature extraction network uses a convolutional neural network with a hybrid attention mechanism to extract features. Subsequently, the extracted time-frequency feature maps are input into the feature metric network. In this process, it is necessary to remove the time-frequency feature maps of outlier samples in the meta-support set to ensure recognition performance. Then, the mean of the time-frequency feature maps (feature vectors) of the remaining meta-support set samples of the same type is calculated to obtain the class prototypes of each category. By comparing the Euclidean distance between the time-frequency feature maps of the meta-query set samples and the class prototypes of each category, the relationship between the time-frequency image of the signal and the modulation type is established. The probability of the test sample belonging to each category is obtained based on the calculated Euclidean distance. The predicted label is determined based on the obtained probability, and the network parameters are updated based on the predicted label and the loss.
[0089] During the testing phase, the signal is also processed by the signal preprocessing network to establish the support set and query set. The trained feature extraction network extracts the time-frequency features, which are then passed to the feature measurement network to calculate the distance between the time-frequency feature map of the query set sample and various prototypes, thereby realizing the modulation recognition of the query set sample.
[0090] For feature measurement networks:
[0091] In a few-shot learning A-way B-shot task (where there is A class of signals and B samples for each class), the feature measurement part will evaluate the data on the meta-support set D. support The time-frequency feature maps of the mid-time-frequency image are calculated for each category, and this mean is regarded as the class prototype for each modulation category within the meta-support set, where A represents the number of modulation categories and B represents the number of samples for each category. The prototype h of the v-th (v=1,2,…,A) category... v The calculation formula is:
[0092]
[0093] In the formula, x vb The time-frequency image of the b-th sample of the v-th signal within the meta-support set. This represents a feature extraction network. These represent the parameters of the feature extraction network. x represents vb The time-frequency feature map is input into the feature extraction network. The class prototype is located at the center of the sample space of signals of the same type, and it can be used to characterize the spatial information of that class. After obtaining the class prototype for each type of signal, the feature extraction part extracts the meta-query set D using the same method. query The time-frequency image x of the current sample to be tested i Corresponding time-frequency feature map Subsequently, the feature measurement part calculates the Euclidean distance between the time-frequency feature and various prototypes according to equation (2).
[0094]
[0095] Then, the probability of each category is calculated using the Softmax activation function, and the time-frequency image x of the test sample is obtained. i The probability of belonging to the vth category The calculation formula is shown in (3). x i If the time-frequency features are closer to a certain class prototype, it means that the probability of the test sample belonging to that type is greater. The type with the highest probability among all types is selected as the final discrimination result.
[0096]
[0097] During the backpropagation stage, the cross-entropy loss function is used to calculate the error between the predicted value of the meta-query set sample and the true label to update the feature parameters of the feature extraction network. Figure 4 This demonstrates the working principle of the feature measurement network. In a 3-way 5-shot task, the feature measurement part computes the time-frequency feature map. The classification is performed by calculating the Euclidean distances d1 to d3 between the Euclidean distances of the sample samples and the class prototypes h1 to h3 of the three support sets.
[0098] Because the amount of data under small sample conditions is limited, the recognition results are highly susceptible to noise at low signal-to-noise ratios. Since the number of samples is extremely small, this implementation only considers the case where at most one anomalous sample exists in each category of signal. The feature measurement network in this embodiment is also used to detect and remove anomalous samples; the method for detecting anomalous samples includes:
[0099] Calculate the Euclidean distance between the time-frequency feature maps of each pair of samples in each category of the meta support set, sort these distances from smallest to largest, and determine the sample that is farthest from its class in each category, denoted as pc;
[0100] Calculate the mean of the samples other than pc in each category, and calculate... The distance d2′ from the mean, and The distance d2″ from pc;
[0101] When d"2>u×d'2, then pc is determined to be an abnormal sample, where u is a set value;
[0102] x i For the meta-query set D query The time-frequency image of the current sample to be tested. x represents i The time-frequency feature map obtained by inputting into the feature extraction network; This represents a feature extraction network. These represent the parameters of the network.
[0103] Specifically, such as Figure 4 As shown, suppose there are three types of modulated signals: O, P, and Q. Each type of signal has five samples, and their respective time-frequency feature maps are o1~o5, p1~p5, and q1~q5, with corresponding class prototypes h1, h2, and h3, respectively. Normally, the time-frequency feature maps of signals O, P, and Q are concentrated near their respective class prototypes h1, h2, and h3. However, when individual signal samples are interfered with, their corresponding time-frequency feature maps will deviate from the time-frequency feature maps of other samples, such as... Figure 5 As shown, the time-frequency feature maps corresponding to signals O and Q are concentrated near their respective class prototypes h1 and h3. Assume x iThis is actually a time-frequency image of a class P signal. In this case, p1 to p4 are concentrated around h2, while p5 is farther from h2. This means that p5's features differ significantly from p1 to p4, making it an outlier time-frequency feature image caused by noise. Because the data volume is small under small sample conditions, even a single outlier sample can affect the estimation results. When p5 is far from the time-frequency feature image of the query set samples... When the distance is relatively large, it is easy to increase the size of the class prototype h2 and... The distance causes x i For time-frequency images classified as Class O or Class Q signals, p5 needs to be removed to ensure signal recognition accuracy. The specific steps are as follows:
[0104] (1) Calculate the Euclidean distance d between each pair of time-frequency characteristic maps p1 to p5. 12 =|p1-p2|, d 13 =|p1-p3|, d 14 =|p1-p4|, d 15 =|p1-p5|, d 23 =|p2-p3|, d 24 =|p2-p4|, d 25 =|p2-p5|, d 34 =|p3-p4|,
[0105] d 35 =|p3-p5|, d 45 =|p4-p5|;
[0106] (2) Sort these distances from smallest to largest, assuming there are d. 12 <d 13 <d 14 <d 23 <d 24 <d 34 <d 15 <d 25 <d 35 <d 45 ;
[0107] (3) Since the distance between the abnormal sample and other samples is much greater than the distance between other samples, it can be determined that p1, p2, p3 and p4 are not time-frequency feature maps of the abnormal sample, while whether p5 is a time-frequency feature map of the abnormal sample needs further judgment.
[0108] (4) Then, using the average of p1, p2, p3, and p4, p 1234 = (p1+p2+p3+p4) / 4 is the mean of the new sample time-frequency feature map, and x is calculated. i Corresponding time-frequency feature map With p1234 distance as well as Distance from p5 like Figure 5 As shown, when d2″>u×d2′, p5 and If the distance d2″ is too far, p5 can be considered to be a time-frequency feature map of an abnormal sample, where the value of u can be determined by a certain criterion or ergonomic experiment.
[0109] This implementation uses the Black Widow Optimization Algorithm (BWOA) to determine the optimal multiplier u value. The multiplier u value to be determined is regarded as the position of the individual Black Widow spider. The specific steps are as follows:
[0110] (1) Initialize the population.
[0111]
[0112] In the formula and These represent the lower and upper limits of the spider's position value, respectively, and are set here to... Z represents the total population size. Usually, setting the number of spider populations to 60 will yield good results. rand1 represents a random number between (0,1).
[0113] (2) The spider begins to move, searching for the optimal individual to mate and reproduce. The initial movement parameters α and β are chosen as α = 0.5 and β = 1, and movement is generally linear and spiral. Then, a random number rand2 between (0,1) is generated. The mathematical model for position updating is:
[0114]
[0115] In the formula, Let i be the position of the i-th spider after the (t+1)th iteration. This is the current optimal position. It is the position of the r1th spider randomly selected from the population. It represents the current position of the i-th spider.
[0116] (3) Determine the fitness function and calculate the sex pheromone. Here, fitness(i) is defined as the modulation recognition accuracy corresponding to the position of the i-th spider.
[0117]
[0118] Where I(i) represents the total number of trials corresponding to the position of the i-th spider, and G(i) represents the number of correct identifications corresponding to the position of the i-th spider. To avoid cannibalism, male spiders generally avoid mating with female spiders with lower sex pheromones. The expression for the sex pheromone of the i-th spider is:
[0119]
[0120] In the formula, fitness max and fitness min These are the fitness values of the best and worst individuals in the population, respectively.
[0121] (4) Update the search agent. Individuals with lower sex pheromones will not be selected. When pheromone(i) ≤ k, the spider is considered to have low sex pheromones. In this embodiment, k = 0.3, and the update parameter is then used.
[0122]
[0123] In formula and Let r1 and r2 be the positions of the r1 and r2 black widow spiders, respectively. r1 and r2 are the random population sizes in the range [1, Z], and r1 ≠ r2. σ is a random binary number in the range {0, 1}.
[0124] (5) Re-evaluate the fitness function value and update the position of the best black widow spider and the optimal solution.
[0125] (6) Determine whether the result has converged or meets the maximum number of iterations. If so, output the position of the optimal black widow spider, which is the global optimal solution. Otherwise, t = t + 1, return to step (2) to recalculate.
[0126] This implementation method improves recognition accuracy by removing abnormal samples.
[0127] During testing, the feature measurement network uses the same method for both the support set and the query set to remove outlier samples and calculate the distance between the time-frequency feature map of the query set samples and various prototypes, thereby achieving modulation recognition of the query set samples.
[0128] For signal preprocessing networks:
[0129] Compared to traditional time-domain and frequency-domain images, time-frequency images can demonstrate how a signal changes over time and frequency, which is one of the key distinctions between radio signals with different modulation modes. By performing time-frequency transformation on the received signal, the modulation identification problem can be transformed into a time-frequency image identification problem. Therefore, to leverage mature technologies in the field of few-sample image recognition, in a preferred embodiment, the signal preprocessing network of this implementation uses STFT time-frequency images as a visual representation of the signal, and inputs the time-frequency images into the model in the form of tasks for training and testing.
[0130] Assuming the receiver has C array element channels, the continuous signal r received by the g-th (g = 1, 2, ..., C) array element channel is first processed. g (t) is converted to a sampling frequency of f s discrete-time signal r g (k), assuming w(·) represents the window function, then r g (k) After windowing and converting to the frequency domain, the STFT transformation result is:
[0131]
[0132] Where q, n, and g are the time frame, frequency frame, and array element channel index corresponding to the time-frequency transformation, respectively; k is the discrete-time sampling point; T and F are the sampling periods for time and frequency, respectively; H and W are the total number of time sampling points and the total number of frequency sampling points for each signal sample, respectively; and j is an imaginary number. The time-frequency image of the signal is obtained by calculating R... g This is obtained by squaring the magnitude of (q,n), i.e.:
[0133] S g (q,n)=|R g (q,n)| 2 , q=1,...,H,n=1,...,W,g=1,2,...,C(10)
[0134] Where S g (q,n) represents the original signal r. g The time-frequency image of (t) is such that each position on the time-frequency image corresponds to a point determined by time, frequency and array element channels.
[0135] For feature extraction networks:
[0136] The feature extraction network in this embodiment is implemented by connecting eight convolutional blocks in sequence. After the 2nd, 4th, 6th and 8th convolutional blocks extract the feature maps, they are then processed by a hybrid attention mechanism to obtain refined feature maps. The hybrid attention mechanism in this embodiment is based on the channel attention mechanism and combines the time attention mechanism and the frequency attention mechanism, so that the model can fully extract the feature information of the time and frequency image in the channel, time and frequency dimensions.
[0137] Because convolutional neural networks (CNNs) possess powerful feature extraction capabilities, prototype networks often use them to extract image features. However, to enable CNNs to achieve even better feature extraction capabilities under limited computational resources, this implementation incorporates a hybrid mechanism to make the model focus more on features beneficial to time-frequency image classification. Unlike natural images processed in computer vision, the horizontal and vertical axes of wireless signal time-frequency images have clear physical meanings, representing signal representations in the time and frequency dimensions. This implementation combines a channel attention mechanism with a time attention mechanism and a frequency attention mechanism to form a hybrid attention mechanism module, enabling the network to capture the correlations of time-frequency images of different modulation categories in the channel, time, and frequency directions. Specifically, this implementation constructs a CNN consisting of 8 convolutional blocks as the backbone network for time-frequency feature extraction to automatically learn the deep features of the input time-frequency image. The module structure is as follows: Figure 6 As shown.
[0138] The first, third, fifth, and seventh convolutional blocks each consist of a convolutional layer, a batch normalization (BN) layer, a ReLU activation function, and a max pooling layer, all connected in sequence. The second, fourth, sixth, and eighth convolutional blocks each consist of a convolutional layer, a batch normalization (BN) layer, a ReLU activation function, a max pooling layer, and a hybrid attention mechanism, all connected in sequence, to capture key information from the time-frequency image across multiple dimensions. The kernel size in each of the eight convolutional blocks is 3×3, and the number of kernels is 4, 4, 8, 8, 16, 16, 32, and 32, respectively. Assuming the original time-frequency image has 2 array element channels (C=2) and a total of 224 time and frequency sampling points (H=W=224) per signal sample, the image size is adjusted sequentially from 224×224 to 112×112, 56×56, 28×28, 14×14, 7×7, 4×4, 2×2, and 1×1 using a 2×2 kernel max pooling operation to reduce computational overhead. Finally, the refined feature map F′ output from the 8th convolutional block is obtained and used for subsequent class prototype calculations and distance metrics. Figure 6 The output dimensions and parameter settings of the hybrid attention feature extraction module are shown in Table 1 below.
[0139] Table 1 Parameters of Hybrid Attention Feature Extraction Module
[0140]
[0141] In a preferred embodiment, the hybrid attention mechanism of this implementation is as follows: Figure 7 As shown; the method for obtaining a refined feature map using a hybrid attention mechanism in this embodiment includes:
[0142] Suppose the feature map input to the hybrid attention mechanism is Here Let F be a set of real numbers with dimensions C×H×W, where C, H, and W represent the number of channels (corresponding to the number of array element channels), height (corresponding to the number of time sampling points), and width (corresponding to the number of frequency sampling points), respectively. The feature map F is input into the channel attention mechanism to obtain the channel attention weights M. c (F);
[0143] Channel attention weight M c Multiplying (F) by the feature map F yields the channel-weighted feature map F. c :
[0144]
[0145] in This is the symbol for element-wise product.
[0146] Channel weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c );
[0147] Meanwhile, the channel weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c );
[0148] Frequency attention weight M f (F c ) and channel-weighted feature map F c Multiplying them together yields a frequency-weighted feature map.
[0149]
[0150] Time attention weight M t (F c ) and channel-weighted feature map F c Multiplying them together yields a time-weighted feature map.
[0151]
[0152] Frequency-weighted feature map F f With time-weighted feature map F t After concatenating along the channel dimensions, a 1×1 convolution operation is performed to obtain a refined feature map. Then F′ is used as the input to the next layer. The whole process can be summarized as follows:
[0153] F′=f 1×1 ([F f ;F t ])(14)
[0154] In a preferred embodiment, the channel attention mechanism is as follows: Figure 8 As shown, the feature map F is input into the channel attention mechanism to obtain the channel attention weights M. c The methods in (F) include:
[0155] Feature map F is simultaneously input into global max pooling and global average pooling, resulting in two pools of size F. The feature maps are processed by performing one-dimensional convolution operations on each feature map. The two results are then concatenated, and the concatenated result is activated by the Sigmoid activation function to generate attention weights M. c (F).
[0156] Therefore, the channel attention weights are represented as follows:
[0157] M c (F)=δ(f e (AvgPool(F))+f e (MaxPool(F)))(15)
[0158] Where δ() is a Sigmoid activation function, f e () represents a one-dimensional convolution operation, AvgPool() and MaxPool() represent global average pooling and global max pooling operations, respectively, and e represents the size of the one-dimensional convolution kernel, which is adapted to the number of channels C. Its calculation formula is as follows:
[0159]
[0160] Here, γ and l are hyperparameters used to calculate the mapping between e and C; following the research experience of other scholars, these are set to 2 and 1 respectively. Then, the attention weights M obtained for different channels are... c (F) is multiplied by F channel by channel to complete the weighting operation.
[0161] In a preferred embodiment, the frequency attention mechanism is as follows: Figure 9 As shown, the channel-weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c The methods include:
[0162] Channel weighted feature map F c Perform 1×H average pooling along the time axis to obtain the feature map F corresponding to channel g. g,x g = 1, 2, ..., C, where C represents the number of channels and x represents the time axis;
[0163] Feature map F g,x After three cascaded 3×3 convolutional layers, frequency features are obtained. These frequency features are then activated by a Sigmoid activation function to generate frequency attention weights M. f (F c Each convolutional layer contains a 3×3 convolutional kernel.
[0164] In a preferred embodiment, the time attention mechanism is as follows: Figure 10 As shown, the channel-weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c The methods include:
[0165] Channel weighted feature map F c Perform average pooling with a kernel size of 1×W along the frequency axis to obtain the feature map F corresponding to channel g. g,y g = 1, 2, ..., C, where C represents the number of channels and y represents the frequency axis;
[0166] Feature map F g,y After passing through three cascaded 3×3 convolutional layers, the temporal features are obtained. These temporal features are then activated by the Sigmoid activation function to generate temporal attention weights M. t (F c Each convolutional layer contains a 3×3 convolutional kernel.
[0167] Because this application combines temporal attention, frequency attention, and outlier removal mechanisms on top of the channel attention mechanism, the modulation recognition model in this application is called the Hybrid Mechanism Prototype Network (HMPN).
[0168] Simulation experiment:
[0169] Although the RML2016.10a dataset is widely used in modulation recognition tasks, its limited feature set of only 128 sampling points per signal sample prevents it from providing more detailed characteristics. Therefore, this application mimics the software radio generation environment of the RML2016.10a benchmark dataset, generating 12 signal types: 8PSK, CPFSK, QAM16, QAM64, QAM256, WBFM, AM-SSB, BPSK, QPSK, AM-DSB, GFSK, and PAM4. However, the number of sampling points is expanded from 128 to 1024. The center frequencies of the 9 digital signals and 3 analog modulation types are set to 902MHz and 100MHz, respectively. Within a signal-to-noise ratio (SNR) range of -4dB to 18dB, a 2dB SNR interval step is set, generating 1000 signal samples for each type under each SNR condition.
[0170] Based on this, this application follows the STFT time-frequency conversion setting, using samples with a frame length of 8 and a 90% overlapping Kaiser window. Figure 11 The image shows the time-frequency images of six modulation modes—AM-SSB, GFSK, CPFSK, QAM16, BPSK, and WBFM—after removing the coordinate axes, under a signal-to-noise ratio of 18dB. The time-frequency images of signals from different modulation modes differ in both texture and color.
[0171] During the training process of the simulation experiment, an episode-based training mode was adopted, meaning that the model performed the same A-way B-shot task in both the training and testing phases. The experiment selected six types of modulation signals—QPSK, CPFSK, QAM64, 8PSK, WBFM, and AM-SSB—to form the training set, and the remaining six types—BPSK, AM-DSB, QAM16, QAM256, GFSK, and PAM4—as the test set. The training set was used to randomly select metadata support sets and metadata query sets according to their categories during the training phase, while the test set was used to generate the support sets and query sets during the testing phase. Predicted labels were calculated according to formula (3).
[0172] Simulation analysis:
[0173] (1) Effectiveness analysis of different identification models and mechanisms
[0174] To investigate the impact of the hybrid mechanism implemented in the feature extraction module on recognition performance, two experiments were conducted. First, it was assumed that the received data consisted of samples with a signal-to-noise ratio of 0dB. Then, the recognition models were modified based on HMPN: the model without any mechanism was defined as HMPN-1; the model without channel attention was defined as HMPN-2; the model without time-frequency attention was defined as HMPN-3; and the model without outlier removal was defined as HMPN-4. These four models were trained and tested using both 5-way 10-shot and 5-way 5-shot task modes. Table 2 lists the average recognition accuracy of these five models in 1000 test tasks.
[0175] Table 2. Average recognition accuracy of models with different mechanisms (samples at 0dB)
[0176]
[0177] As shown in Table 2, the recognition accuracy of all four models in the 5-way 10-shot mode is higher than that in the 5-way 5-shot mode. In both task modes, the HMPN model effectively captures the different importance of signals in the channel, time, and frequency dimensions, acquiring important multi-dimensional features. This results in its recognition accuracy being higher than HMPN-1 (without any mechanism), HMPN-2 (without a channel attention mechanism), and HMPN-3 (without a time-frequency attention mechanism), while being roughly equal to HMPN-4 (without an outlier removal mechanism). Furthermore, HMPN-2's recognition accuracy is better than HMPN-3, indicating that the gain from focusing on the frequency and time dimensions in time-frequency images is greater than that from focusing on the channel dimension.
[0178] Next, assuming that the received data includes one sample with a signal-to-noise ratio of -4dB and the rest with samples with a signal-to-noise ratio of 12dB, and other conditions are the same as above, Table 3 lists the corresponding experimental results.
[0179] Table 3 Comparison of average recognition accuracy of models with different mechanisms (samples at 12dB and -4dB)
[0180]
[0181] As shown in Table 3, the recognition accuracy of these four models in the 5-way 10-shot mode is also higher than that in the 5-way 5-shot mode. Furthermore, the recognition accuracy of the HMPN model is the best in both task modes. The recognition accuracy of HMPN-4 without an anomaly removal mechanism is only slightly higher than that of HMPN-1 without any mechanism, but lower than that of HMPN-2 without channel attention mechanism and HMPN-3 without time-frequency attention mechanism. This indicates that the anomaly removal mechanism at this time successfully removes anomaly samples that are affected by noise, making the model classify the signal more accurately.
[0182] (2) Comparison of recognition accuracy of different modulation recognition schemes
[0183] To explore the advantages of the Hybrid Prototypical Network (HMPN) proposed in this application compared to other modulation recognition methods, two additional few-shot models were selected for experiments: Prototypical Network (PN) (proposed by Snell in "Prototypical networks for few-shot learning") and Relational Network (RN) (proposed by Sung in "Learning to compare: relation network for few-shot learning"). All three few-shot models (PN, RN, and HMPN) underwent meta-training in a 5-way 5-shot task mode, and the average recognition accuracy was calculated for 1000 test tasks. Similarly, it was initially assumed that the received data included one sample with a signal-to-noise ratio (SNR) of -4dB, and the rest with a SNR of 4dB, designated as Scenario 1; then, it was further assumed that the received data included one sample with a SNR of -4dB, and the rest with a SNR of 16dB, designated as Scenario 2. Figures 12-23 The confusion matrix, precision, recall, and F1 score (PRF) of these models are given for scenario 1 and scenario 2 respectively.
[0184] These experimental results show that when the received data has inconsistent signal-to-noise ratios, the HMPN method proposed in this application significantly outperforms PN and RN, mainly due to the outlier removal mechanism. As the signal-to-noise ratio increases, the differences between the three models gradually decrease, but PN and RN still lag behind HMPN. This is because PN, RN, and the proposed HMPN are all metric-based few-shot learning networks. Benefiting from the gain brought by the hybrid mechanism, HMPN achieves better recognition results than PN and RN.
[0185] While this application has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of this application. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of this application as defined by the appended claims. It should be understood that different dependent claims and features herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other embodiments.
Claims
1. A signal modulation recognition method based on few-sample learning, characterized in that, include: During the training phase, the received signals are converted into time-frequency images, and the time-frequency images are used to construct a training set, which includes a meta-support set and a meta-query set. Construct a modulation recognition model, including a feature extraction network and a feature measurement network; The time-frequency image is input to the feature extraction network, which extracts features from the time-frequency image to obtain a time-frequency feature map, and then inputs the time-frequency feature map to the feature measurement network. The feature measurement network is used to detect anomalous sample images in the meta support set and remove anomalous samples from the meta support set. The class prototypes of each category are calculated from the remaining time-frequency feature maps of the meta-support set after removing abnormal samples. The Euclidean distance between the time-frequency feature maps in the meta-query set and the class prototypes of each category is calculated. The probability of the test sample belonging to each category is obtained based on the calculated Euclidean distance. The parameters of the feature extraction network are determined based on the obtained probabilities and the predicted labels. The trained modulation recognition model is used to perform modulation recognition and prediction on the signal under test.
2. The signal modulation recognition method based on few-shot learning according to claim 1, characterized in that, The method for detecting anomalous samples in the meta-support set by the feature measurement network and removing anomalous samples from the meta-support set includes: Calculate the Euclidean distance between the time-frequency feature maps of each pair of samples in each category of the meta support set, sort these distances from smallest to largest, and determine the sample in each category that is farthest from its time-frequency feature map of other samples of the same class, denoted as pc; Calculate the mean of the time-frequency feature maps for samples other than pc in each category, and calculate... The distance d2′ from the mean, and The distance d2″ from pc; When d2″>u×d2′, then pc is determined to be an abnormal sample, where u is a set value; x i For the meta-query set D query The time-frequency image of the i-th sample to be tested. x represents i The time-frequency feature map obtained by inputting into the feature extraction network; This represents a feature extraction network. This represents the parameters of the feature extraction network.
3. The signal modulation recognition method based on few-shot learning according to claim 2, characterized in that, Based on the remaining time-frequency feature maps of the meta-support set after removing outlier samples, the class prototypes for each category are calculated as follows: Among them, h v For the prototype of type v (v = 1, 2, ..., A), the meta-support set D support It includes Class A signals, with B samples per class of signal in the time-frequency image; x vb The time-frequency image of the b-th sample of the v-th signal within the meta-support set. x represents vb The time-frequency feature map obtained by inputting into the feature extraction network; The probability of each category is calculated using the Softmax activation function, and the time-frequency image x is obtained. i The probability of belonging to the vth category Among them, the type with the highest probability is selected as the predicted label.
4. The signal modulation recognition method based on few-shot learning according to claim 2, characterized in that, The methods for determining u include: S1. Initialize the population, with a total population size of Z; S2. The spider begins to move, searching for the optimal individual to mate and reproduce. The spider's position update model is as follows: in, Let i be the position of the i-th spider after the (t+1)th iteration. This is the current optimal position. It is the position of the r1th spider randomly selected from the population. α is the current position of the i-th spider, α and β are set motion parameters, and rand2 is a random number between {0,1}; S3. Determine the fitness function fitness(i) and calculate the sex pheromone of the i-th spider; Where I(i) is the total number of trials corresponding to the position of the i-th spider, and G(i) is the number of times the i-th spider is correctly identified; The sex pheromone of the i-th spider is: In the formula, fitness max and fitness min These are the fitness values of the best and worst individuals in the population, respectively. S4. When pheromone(i) ≤ k, update the parameters. In formula and The positions of the r1 and r2 black widow spiders are respectively, where r1 and r2 are the random population sizes in the range [1, Z], and r1 ≠ r2. σ is a random binary number in the range {0, 1}, and k is a set value. S5. Re-evaluate the value of the fitness function fitness(i) and update the position of the optimal black widow spider and the optimal solution; S6. Determine whether the result has converged or meets the maximum number of iterations. If so, output the position of the optimal Black Widow Spider, which is the global optimal solution. Otherwise, return to step S2, t = t + 1, and recalculate iteratively.
5. The signal modulation recognition method based on few-sample learning according to claim 1, characterized in that, Methods for obtaining refined feature maps using hybrid attention mechanisms include: Feature map F is the input to the hybrid attention mechanism. The feature map F is input to the channel attention mechanism to obtain the channel attention weights M. c (F); The channel attention weight M c (F) is multiplied by the feature map F to obtain the channel-weighted feature map F. c ; Channel weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c ); Meanwhile, the channel weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c ); The frequency attention weight M f (F c ) and the channel weighted feature map F c Multiplying them together yields the frequency-weighted feature map F. f ; The time attention weight M t (F c ) and the channel weighted feature map F c Multiplying them together yields the time-weighted feature map F. t ; Frequency-weighted feature map F f With time-weighted feature map F t After concatenating the channels, a 1×1 convolution operation is performed to obtain a refined feature map F′, which is used as the output of the 2nd, 4th, 6th, or 8th convolutional block.
6. The signal modulation recognition method based on few-shot learning according to claim 5, characterized in that, The feature map F is input into the channel attention mechanism to obtain the channel attention weights M. c The methods in (F) include: Feature map F is simultaneously input into global max pooling and global average pooling to obtain two feature maps. Each feature map undergoes a one-dimensional convolution operation. The two results are concatenated, and the concatenated result is activated by the Sigmoid activation function to generate channel attention weights M. c (F).
7. The signal modulation recognition method based on few-sample learning according to claim 5, characterized in that, The channel weighted feature map F c The input is fed into the frequency attention mechanism to obtain the frequency attention weights M. f (F c The methods include: The channel weighted feature map F c Average pooling is performed along the time axis to obtain the feature map F corresponding to channel g. g,x g = 1, 2, ..., C, where C represents the number of channels and x represents the time axis; Feature map F g,x After three cascaded 3×3 convolutional layers, frequency features are obtained. These frequency features are then activated by a Sigmoid activation function to generate frequency attention weights M. f (F c ).
8. The signal modulation recognition method based on few-sample learning according to claim 5, characterized in that, The channel weighted feature map F c The input is fed into the temporal attention mechanism to obtain the temporal attention weights M. t (F c The methods include: The channel weighted feature map F c Average pooling is performed along the frequency axis to obtain the feature map F corresponding to channel g. g,y g = 1, 2, ..., C, where C represents the number of channels and y represents the frequency axis; Feature map F g,y After passing through three cascaded 3×3 convolutional layers, the temporal features are obtained. These temporal features are then activated by the Sigmoid activation function to generate temporal attention weights M. t (F c ).
9. A signal modulation recognition device based on few-shot learning, comprising a storage device, a processor, and a computer program stored in the storage device and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the signal modulation recognition method based on few-sample learning as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the signal modulation recognition method based on few-sample learning as described in any one of claims 1 to 7.