Lightweight processing method of multi-method composite modulation type recognition model

By building a high-performance electromagnetic signal modulation type identification network ResNet on FPGA, and combining it with FPGM pruning and quantization technology, the application problem of existing modulation identification methods on resource-constrained devices has been solved, and it has been achieved under different signal-to-noise ratio conditions. Efficient modulation type identification.

CN114676629BActive Publication Date: 2024-09-03XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210271933.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2024-09-03
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

Existing modulation identification methods cannot flexibly adapt to communication scenarios with different transmission channels and additional noise, and the application of deep learning models on resource-constrained devices is limited by high memory and high throughput server dependence.

Method used

Design and build a high-performance electromagnetic signal modulation type identification network ResNet. Through FPGM pruning algorithm and quantization technology, the network is lightweighted on FPGA, pruning 97% of the parameters, and combining Euclidean distance calculation and shift Register design to achieve fully parallel and partially parallel implementation solutions.

Benefits of technology

It achieves high-performance modulation type identification on resource-constrained devices and maintains good performance, especially under signal-to-noise ratio conditions of 5dB and above, and avoids performance degradation through a combination of quantization and pruning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676629B
    Figure CN114676629B
Patent Text Reader

Abstract

The invention discloses a lightweight processing method for a multi-means composite modulation type recognition model, designs and builds a high-performance electromagnetic signal modulation type recognition network ResNet, and collects and generates data sets containing multiple modulation types under various signal-to-noise ratios from an FPGA; trains the network based on the data sets containing multiple modulation types under various signal-to-noise ratios; progressively prunes the network through an FPGM pruning algorithm in combination with the amount of FPGA resources until 97% of the parameters of each layer are pruned; calculates the similarity of fixed-point numbers and floating-point numbers in combination with Euclidean distance, determines a quantization ratio that can express the best performance of the network, and derives the quantized parameters; pre-processes IQ data on the FPGA, then fuses a BN layer and a convolutional layer and designs full parallel and partial parallel implementation schemes based on a shift register, then uses Matlab to analyze the maximum and minimum values ​​of output data of each layer to determine the truncation standard of the data; and finally verifies the correctness of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to cognitive radio related communication technology, and in particular relates to a multi-means composite modulation type recognition model lightweight processing method. Background Art

[0002] With the widespread use of various radio devices, there are more and more radiation sources in the electromagnetic environment, the electromagnetic spectrum is becoming more and more congested, and a large number of communication signals for different purposes overlap in the electromagnetic space, creating an increasingly complex electromagnetic environment. In order to better monitor and analyze these signals, researchers have proposed cognitive radio technology, and modulation recognition is one of the key technologies in the field of cognitive radio technology. The basic task of communication signal modulation recognition is to determine the modulation mode of the received signal in an environment with a large number of interference signals and noise. For this purpose, two recognition methods based on decision theory or feature-based have been developed. However, these two methods cannot flexibly adapt to communication scenarios with different transmission channels and additional noise.

[0003] With the development of deep learning theory, artificial intelligence technology has begun to be applied to all walks of life, and some research results have been achieved using deep learning to complete modulation recognition. However, since the improvement of deep learning model performance requires large data samples and deep structures, the construction of these networks must rely on high-memory, high-throughput servers. Therefore, in order to apply deep learning to resource-constrained devices, it is necessary to convert neural networks trained based on large data samples into small data samples, and further to lightweight complex networks. Summary of the invention

[0004] In view of this, the main purpose of the present invention is to provide a lightweight processing method for a multi-method composite modulation type recognition model.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] The embodiment of the present invention provides a multi-method composite modulation type recognition model lightweight processing method, the method comprising:

[0007] Design and build a high-performance electromagnetic signal modulation type recognition network ResNet, and collect and generate data sets containing multiple modulation types under various signal-to-noise ratios from FPGA;

[0008] Training the network based on a data set containing multiple modulation types under various signal-to-noise ratios;

[0009] The network is pruned progressively using the FPGM pruning algorithm and the FPGA resources until 97% of the parameters are pruned at each layer.

[0010] Combine Euclidean distance to calculate the similarity between fixed-point numbers and floating-point numbers, determine the quantization ratio that can express the best performance of the network, and derive the quantized parameters;

[0011] First, the IQ data is preprocessed on the FPGA. Then, the BN layer and the convolution layer are integrated and based on the shift register, a full parallel and partial parallel implementation scheme is designed. Then, Matlab is used to analyze the maximum and minimum values ​​of the output data of each layer and determine the data truncation standard.

[0012] Finally, verify the correctness of the network.

[0013] In the above scheme, the high-performance electromagnetic signal modulation type recognition network ResNet is designed and built, and data sets containing multiple modulation types under various signal-to-noise ratios are collected and generated from FPGA. Specifically, a ResNet network is built, and 6 convolution blocks are divided according to the number of output channels, with a total of 21 convolution layers, 1 average pooling layer and 1 fully connected layer. A spectrum sensing system based on FPGA and AD9361 is used, and 12 modulation type signals with a range of -10dB to 20dB are exported using ILA: ASK, BPSK, QPSK, 8PSK, 16QAM, 32QAM, 64QAM, 128QAM, 256QAM, MSK, 2FSK, 4FSK, and they are organized into data sets in a ratio of 4:1.

[0014] In the above scheme, the network is pruned progressively by the FPGM pruning algorithm in combination with the amount of FPGA resources until 97% of the parameters of each layer are pruned, specifically: pruning m convolution kernels from the i-th convolution layer, finding m convolution kernels with the smallest sum of Euclidean distances from the remaining convolution kernels from the convolution kernels of the current layer; deleting m convolution kernels and the feature maps corresponding to these convolution kernels; deleting m input channel parameters of the next layer of convolution kernels according to the pruned feature maps; creating a new convolution kernel matrix according to the pruning results of the current layer and the next layer, and copying the remaining weights to the new model; comparing the number of DSP resources under the three parallel designs, taking the full parallel design scheme of input channels that requires the least resources as the standard, and pruned the network according to the FPGM algorithm, and adopting a progressive pruning scheme of 5 times in the pruning process, that is, after each pruning, the network will be retrained until 97% of the parameters of each layer are pruned.

[0015] In the above scheme, the similarity between fixed-point numbers and floating-point numbers is calculated by combining Euclidean distance, the quantization ratio that can express the best performance of the network is determined, and the quantized parameters are derived. Specifically, the Q value is selected multiple times, and the parameters are imported into the FPGA model each time the quantization is completed, and the fixed-point output of each layer is saved; then, based on the Euclidean distance, the output of each layer is verified. The smaller the Euclidean distance, the greater the data similarity; the larger the Euclidean distance, the smaller the data similarity.

[0016]

[0017] where {x1,x2,...,x n} represents the n floating point numbers output by the i-th layer of the neural network, {y1,y2,...,y n} represents the result of converting the n fixed-point numbers output by the i-th layer of FPGA into floating-point numbers. Finally, the parameters that best express the network are exported from Pytorch.

[0018] In the above scheme, the IQ data is preprocessed on the FPGA first. Specifically, the I and Q data collected by the hardware are I(n) and Q(n) respectively, and the sequence length is N. The mean is obtained first:

[0019]

[0020]

[0021] Then calculate the standard deviation of the two sets of data:

[0022]

[0023]

[0024] Finally, according to the obtained mean and standard deviation, the normalized I and Q data can be calculated by the following formula:

[0025]

[0026]

[0027] In order to avoid normalization to obtain a positive number less than 1, the quantization operation is advanced and combined with the above formula to obtain the following formula:

[0028]

[0029]

[0030] In the above scheme, the fusion of the BN layer and the convolution layer is based on the shift register, specifically: for the convolution layer, assuming that the weight of a convolution kernel is W, the convolution process is to use W to perform sliding window calculation in its input feature map; assuming that an element in W is w, and an element in the input feature map is x, the calculation process for w and x is as follows:

[0031] y conv =w·x+b

[0032] For the BN layer, determine the mean variance of the elements in the mini-batch, then subtract the mean divided by the standard deviation from x, and finally use γ and β to perform an affine transformation to get the final BN output. The specific process is as follows:

[0033]

[0034]

[0035]

[0036]

[0037] Among them, the first one is the mean formula, the second one is the variance formula, the third one is the normalization formula, and the fourth one is the affine transformation formula. Substituting the convolutional layer formula into the BN layer formula, we get the following formula:

[0038]

[0039] Among them, γ, β, μ, σ 2 These are the parameters of the BN layer.

[0040] In the above scheme, the implementation scheme of the full parallel and partial parallel design is specifically as follows: when performing the full parallel design of the Conv1 layer, first design 30 shift registers to cache the IQ two-way data respectively. When all registers are full, perform convolution multiplication operations, and then design a full-pipeline adder to accumulate the results of the convolution multiplication; when performing the full parallel design of the input channel of the Conv2_1 layer, first group and splice the convolution kernels according to the input channels and save them permanently, then repeatedly read the input parameters a number of times equal to the number of output channels, and perform convolution operations with the convolution kernel parameters of the same format. At this time, the results equal to the number of input channels are obtained, each corresponding to an input channel and including the results of all output channels, and then the results are added correspondingly according to the input channels to obtain the final output result; the output results are output in a serial manner, the serial results are disassembled, and then stored in multiple RAMs respectively, waiting for the next convolution operation.

[0041] In the above scheme, Matlab is used to analyze the maximum and minimum values ​​of the output data of each layer to determine the truncation standard of the data, specifically: truncate decimals and integers respectively, and truncate decimals according to the rounding method to keep the bit width at 16 bits; after each layer is built, we need to simulate the output data of the layer through Vivado Simulator. During the simulation process, the output data of the layer is first written into a text document through the file writing operation, and then the Matlab program is used to analyze the data in the text document to find the maximum and minimum values ​​of the current layer data, and finally the integer part is truncated according to the maximum and minimum values.

[0042] In the above scheme, the correctness of the verification network is specifically as follows: a set of data is read arbitrarily in the data set, which contains 12 modulation modes, 256 groups of each, 512×2 data in each group, and a total of 3072 groups of data. The data is decomposed into a .coe file recognizable by Xilinx FPGA through a python script, and the file is associated with Rom. The convolution module determines the final result based on this data.

[0043] Compared with the prior art, in order to avoid the performance degradation caused by lightweight, the present invention selects a more complex ResNet residual neural network model for electromagnetic signal recognition; the present invention adopts a compression method combining pruning and quantization. On the one hand, 97% of the parameters in each layer are pruned, and the network still has good performance under the signal-to-noise ratio of more than 5db, which is of concern. On the other hand, a 19-bit quantization scheme that can best express the model is selected through the Euclidean distance test, thereby realizing the quantization of the parameters; the present invention chooses a method of directly performing logic design, and in the actual implementation process, a full parallel and partial parallel scheme is used to realize the deployment of ResNet on a resource-constrained device (FPGA). BRIEF DESCRIPTION OF THE DRAWINGS

[0044] 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:

[0045] Figure 1 It is the selected ResNet structure diagram;

[0046] Figure 2 is the amount of DSP resources required by the FPGA under the three parallel schemes;

[0047] Figure 3 It is the test accuracy comparison between the pruned network and the original network;

[0048] Figure 4 This is the ResNet structure diagram after pruning;

[0049] Figure 5 is the amount of DSP resources required for a fully parallel design of ResNet input after pruning;

[0050] Figure 6 are some parameter values ​​before and after quantization;

[0051] Figure 7 It is the structural division of ResNet implemented by FPGA;

[0052] Figure 8 This is the operation flow of FPGA to implement the Conv1 layer convolution;

[0053] Fig. 9 The data flow of the Conv2_0 layer is designed in full parallelism;

[0054] Fig.10 It is a single-layer computing process designed with full parallelism in the input channels.

[0055] Fig.11 This is the data flow of the Conv2_1 layer designed according to the full parallel design of the input channels.

[0056] Fig.12 This is the display of FPGA judgment results (part 1).

[0057] Fig.13 It is the basis for FPGA decision result. DETAILED DESCRIPTION

[0058] 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.

[0059] 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.

[0060] The present invention firstly selects a ResNet model with a complex structure as a modulation recognition network, and then uses the FPGM algorithm to prune the network 5 times through a repeated progressive pruning scheme, pruning 50% of the parameters each time, and then uses the Euclidean distance to test the similarity between the quantized parameters and the floating-point parameters, and determines a 19-bit quantization scheme that can more accurately express the network. Finally, a full-parallel and partial-parallel combination implementation scheme is directly designed on FPGA based on Verilog code, the truncation standard is determined using Matlab, and the feasibility of the multi-means lightweight method is verified through test simulation.

[0061] The embodiment of the present invention provides a multi-method composite modulation type recognition model lightweight processing method, the method comprising:

[0062] Step 1.1, build Figure 1 The ResNet network shown in the figure is divided into 6 convolution blocks (21 convolution layers in total) according to the number of output channels, 1 average pooling layer and 1 fully connected layer.

[0063] Step 1.2: Based on the spectrum sensing system of FPGA and AD9361, use ILA to export 12 modulation type signals with a range of -10dB to 20dB: ASK, BPSK, QPSK, 8PSK, 16QAM, 32QAM, 64QAM, 128QAM, 256QAM, MSK, 2FSK, and 4FSK. And organize them into data sets.

[0064] Compared with general neural networks, the ResNet network introduces leapfrogging connections that can enhance the flow of information between layers. The spectrum sensing system based on FPGA and AD9361 uses ILA to export signals of 12 modulation types.

[0065] Step 2.1, import the data set, set the batch parameter to 100, the epoch parameter to 10, the learning rate to 0.001 in the network, train the network, and derive the test accuracy under the optimal parameters.

[0066] Based on the Pytorch platform, the network is trained on the server and the optimal network parameters are saved.

[0067] Step 3.1, use the FPGM pruning algorithm to prune the network. The process of pruning m convolution kernels from the i-th convolution layer is as follows:

[0068] a. Find m convolution kernels from the convolution kernels of the current layer whose sum of Euclidean distances to the remaining convolution kernels is the smallest.

[0069] b. Delete m convolution kernels and the feature maps corresponding to these convolution kernels (that is, delete the m convolution kernels and output feature matrix of the i-th layer).

[0070] c. Delete the m input channel parameters of the next layer of convolution kernel according to the pruned feature map (i.e., delete the m input channels in the convolution kernel of the i+1th layer).

[0071] d. Create a new convolution kernel matrix based on the pruning results of the current layer and the next layer, and copy the remaining weights to the new model.

[0072] Step 3.2, compare Figure 2 The number of DSP resources under the three parallel designs is taken as the standard, and the network is pruned according to the method in step 3.1. In the pruning process, a five-step progressive pruning scheme is adopted, that is, after each pruning, the network will be retrained until 97% of the parameters of each layer are pruned, and the following is obtained: Figure 3 The test accuracy and Figure 4 The final network structure and Figure 5 The shown network building on the FPGA requires the least amount of DSP resources;

[0073] The FPGM pruning algorithm based on geometric median is selected. Considering the 900 DSP resources of the FPGA used and the speed requirements of the entire system, the network is pruned progressively, that is, the network is trained once after each pruning until a network model that can be deployed on the FPGA is obtained.

[0074] Step 4.1, such as Figure 6 As shown in the figure, the network parameters are quantized based on the floating point number conversion method. The specific formula is as follows:

[0075] y=x×2 Q

[0076] The Q value is the decimal width agreed upon by the fixed-point method, x is a floating-point number, and y is a fixed-point number.

[0077] In step 4.2, in order to find the best quantization solution, the Q value is selected multiple times. After each quantization, the parameters are imported into the FPGA model and the fixed-point output of each layer is saved. Then, the output of each layer is verified based on the Euclidean distance. The smaller the Euclidean distance, the greater the data similarity; the larger the Euclidean distance, the smaller the data similarity.

[0078]

[0079] where {x1,x2,...,x n} represents the n floating point numbers output by the i-th layer of the neural network, {y1,y2,...,y n} represents the result of converting the n fixed-point numbers output by the i-th layer of FPGA into floating-point numbers. Finally, the parameters that best express the network are exported from Pytorch.

[0080] like Figure 7 As shown, the present invention implements a lightweight neural network on an FPGA using a partially parallel and fully parallel solution, and the specific steps are as follows:

[0081] Step 5.1, first pre-process the IQ data, normalize it and then quantize it. The processing process is as follows:

[0082] The I and Q data collected by the hardware are I(n) and Q(n) respectively, and the sequence length is N. First, get the mean value:

[0083]

[0084]

[0085] Then calculate the standard deviation of the two sets of data:

[0086]

[0087]

[0088] Finally, according to the obtained mean and standard deviation, the normalized I and Q data can be calculated by the following formula:

[0089]

[0090]

[0091] In order to avoid normalization to obtain a positive number less than 1, we advance the quantization operation and merge it with the above formula to obtain the following formula:

[0092]

[0093]

[0094] Step 5.2, when designing the convolutional layer, in order to simplify the program design, the present invention adopts the method of fusing the BN layer and the convolutional layer. The detailed process is as follows:

[0095] For convolutional layers:

[0096] Assuming that the weight of a convolution kernel is W, the convolution process is to use W to perform sliding window calculation in its input feature map; assuming that an element in W is w and an element in the input feature map is x, the calculation process for w and x is as follows:

[0097] y conv =w·x+b

[0098] For the BN layer:

[0099] It is necessary to calculate the mean variance of the elements in a mini-batch, then subtract the mean from x and divide it by the standard deviation, and finally use γ and β to perform an affine transformation to get the final BN output. The specific process is as follows:

[0100]

[0101]

[0102]

[0103]

[0104] Among them, the first one is the formula for finding the mean, the second one is the formula for finding the variance, the third one is the normalization formula, and the fourth one is the affine transformation formula. Substituting the convolutional layer formula into the BN layer formula, we get the following formula:

[0105]

[0106] Among them, γ, β, μ, σ 2 These are the parameters of the BN layer.

[0107] Step 5.3, such as Figure 8 As shown in the figure, when designing the Conv1 layer in full parallelism, 30 shift registers are first designed to cache the IQ data separately (15 each). When all the registers are full, the convolution operation is performed. Then a full-pipeline adder is designed to accumulate the results of the convolution.

[0108] When designing the Conv2_0 layer in full parallelism, first design three shift registers to cache the output of the previous layer. When all registers are full, perform convolution operations. Then design a fully pipelined adder to accumulate the results of convolution. Fig. 9 This is the overall design of Conv2_0.

[0109] like Fig.10 As shown, when designing a fully parallel input channel, first group and splice the convolution kernels according to the input channel (the parameters of the same input channel are spliced ​​together) and save them permanently. Then read the input parameters repeatedly for a number of times equal to the number of output channels, and perform convolution operations with the convolution kernel parameters of the same format. At this time, a number of results equal to the number of input channels will be obtained, each corresponding to an input channel, and containing the results of all output channels. These results are then added together according to the input channels to obtain the final output result. The result is output in serial mode. In order to facilitate the implementation of subsequent network layers, the serial results need to be disassembled and then stored in multiple RAMs respectively, waiting for the next convolution operation. As shown Fig.11This is the overall design of Conv2_1 implemented based on the above ideas.

[0110] In step 5.4, decimals and integers are truncated respectively. Decimals are truncated by rounding to keep the bit width at 16 bits. After each layer is built, we need to simulate the output data of the layer through Vivado Simulator. During the simulation process, the output data of the layer is first written into a text document through a file write operation, and then the data in the text document is analyzed using the Matlab program to find the maximum and minimum values ​​of the current layer data, and finally the integer part is truncated according to the maximum and minimum values. After many experiments, the maximum value of the integer part of the first six modules does not exceed 7 (3 binary digits). However, in order to ensure the security of the entire system, the integer bit width is set to 5 bits (the maximum decimal number that can be represented is 31) during the implementation of ResNet.

[0111] Step 5.5, such as Fig.12 , 13 This is the verification of the result. After the overall structure is implemented, the result of data verification is entered. The detailed process is as follows: read a set of data at random in the data set (12 modulation modes, 256 groups for each mode, 512×2 data for each group, 3072 groups of data in total), decompose the data into a .coe file recognizable by Xilinx FPGA through a python script, associate the file with Rom, and the convolution module determines the final result based on this data. In this example, the 60th group of data with the modulation mode of 8PSK is used to complete the verification.

[0112] First, the IQ data collected by the hardware needs to be processed, and then the ResNet network is divided into 5 large blocks. Each block contains 2 residual structures. Each residual structure contains 2 convolutional layers, 2 BN layers, and 2 Relu activation layers. Due to the relatively complex network structure, it is necessary to design the interaction method, implementation method, data storage method, etc. of each block. At the same time, in order to fully utilize the parallelism of FPGA, it is necessary to implement as many parallel operations as possible.

[0113] Then, the data bit width was truncated during the calculation process, and finally the correctness of the network function was verified through simulation of multiple sets of data, confirming the feasibility of the lightweight method with multiple means.

[0114] Simulation conditions

[0115] 1. The original ResNet network and the new network based on the FPGM algorithm were trained by five progressive prunings. The specific settings are as follows:

[0116] (1) 12 modulation types with parameters ranging from -10dB to 20dB (starting from -10dB, with a step size of 2, for a total of 16 signal-to-noise ratios): ASK, BPSK, QPSK, 8PSK, 16QAM, 32QAM, 64QAM, 128QAM, 256QAM, MSK, 2FSK, and 4FSK;

[0117] (2) The learning rate is 0.001, the epoch is 10, and the batch is 100;

[0118] (3) The two networks have a total of 21 convolutional layers and 10 residual blocks, and both use the ReLU function as the activation function.

[0119] 2. Simulate the network built by FPGA and set it as follows:

[0120] (1) All network parameters are quantized to 19 bits, and the network structure design strictly follows the method described in the present invention;

[0121] (2) Randomly read a set of data in the data set (12 modulation modes, 256 groups for each mode, 512×2 data per group, a total of 3072 groups of data), decompose the data into a .coe file recognizable by Xilinx FPGA through a python script, and associate the file with Rom. The convolution module determines the final result based on this data.

[0122] Two groups were randomly selected from the 12 modulation modes for functional verification.

[0123] Simulation Results

[0124] 1. If Figure 3 As shown in the figure, under the condition of signal-to-noise ratio below 5dB, pruning causes a large loss in network performance, with the highest loss near 0dB, and the performance dropped by about 14%. However, under the more concerned signal-to-noise ratio conditions of 5dB and above, the network shows good performance. Among them, the performance loss is the largest at 5dB, which drops by about 3%. At the same time, the larger the signal-to-noise ratio, the smaller the performance loss. Therefore, the network obtained by pruning 97% of the parameters of each layer can still be used as an effective modulation type recognition network, and the current progressive pruning scheme is feasible.

[0125] 2. This example only demonstrates the verification of the 60th group of data with 8PSK modulation mode: Fig.12 (a) shows 12 output results after the fully connected layer, each corresponding to a modulation method; Fig.12 (b) shows the final judgment result, which is the number corresponding to the maximum value obtained by comparing the 12 values ​​in (a). Fig.13The judgment is correct when testing other data, proving that the compression method combining pruning and quantization can design a lightweight neural network that can be deployed on resource-constrained devices.

[0126] 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 lightweight processing method for modulation type recognition model with multiple means, characterized in that: The method includes: Design and build a high-performance electromagnetic signal modulation type recognition network ResNet, and collect and generate data sets containing multiple modulation types under various signal-to-noise ratios from FPGA; Training the network based on a data set containing multiple modulation types under various signal-to-noise ratios; The network is pruned progressively using the FPGM pruning algorithm and the FPGA resources until 97% of the parameters are pruned at each layer. Combine Euclidean distance to calculate the similarity between fixed-point numbers and floating-point numbers, determine the quantization ratio that can express the best performance of the network, and derive the quantized parameters; First, the IQ data is preprocessed on the FPGA. Then, the BN layer and the convolution layer are integrated and based on the shift register, a full parallel and partial parallel implementation scheme is designed. Then, Matlab is used to analyze the maximum and minimum values ​​of the output data of each layer and determine the data truncation standard. Finally, verify the correctness of the network; The network is pruned progressively by the FPGM pruning algorithm in combination with the amount of FPGA resources until 97% of the parameters of each layer are pruned, specifically: m convolution kernels are pruned from the i-th convolution layer, and m convolution kernels with the smallest sum of Euclidean distances from the remaining convolution kernels are found from the convolution kernels of the current layer; m convolution kernels and the feature maps corresponding to these convolution kernels are deleted; m input channel parameters of the convolution kernel of the next layer are deleted according to the pruned feature maps; a new convolution kernel matrix is ​​created according to the pruning results of the current layer and the next layer, and the remaining weights are copied to the new model; the number of DSP resources under three parallel designs is compared, and the network is pruned according to the FPGM algorithm with the input channel full parallel design scheme requiring the least resources as the standard, and a progressive pruning scheme of 5 times is adopted in the pruning process, that is, the network is retrained after each pruning until 97% of the parameters of each layer are pruned; The method combines the Euclidean distance to calculate the similarity between fixed-point numbers and floating-point numbers, determines the quantization ratio that can express the best performance of the network, and derives the quantized parameters. Specifically, the Q value is selected multiple times, and the parameters are imported into the FPGA model each time the quantization is completed, and the fixed-point output of each layer is saved; then, based on the Euclidean distance, the output of each layer is verified. The smaller the Euclidean distance, the greater the data similarity; the larger the Euclidean distance, the smaller the data similarity. where {x1,x2,...,x n } represents the n floating point numbers output by the i-th layer of the neural network, {y1,y2,...,y n } represents the result of converting the n fixed-point numbers output by the i-th layer of FPGA into floating-point numbers, and finally the parameters that best express the network are exported from Pytorch; The implementation scheme of the full parallel and partial parallel design is specifically as follows: when performing the full parallel design of the Conv1 layer, firstly, 30 shift registers are designed to cache the IQ two-way data respectively. When all the registers are full, the convolution multiplication operation is performed, and then a full-pipeline adder is designed to accumulate the results of the convolution multiplication; when performing the full parallel design of the input channel of the Conv2_1 layer, firstly, the convolution kernels are grouped and spliced ​​according to the input channels and permanently saved, and then the input parameters are repeatedly read a number of times equal to the number of output channels, and the convolution operation is performed with the convolution kernel parameters of the same format, at this time, the results equal to the number of input channels are obtained, each corresponding to an input channel, and including the results of all output channels, and then the results are added correspondingly according to the input channels to obtain the final output result; the output result is output in a serial manner, the serial results are disassembled, and then stored in multiple RAMs respectively, waiting for the next convolution operation.

2. The lightweight processing method of the multi-means composite modulation type recognition model according to claim 1 is characterized in that: The invention discloses a high-performance electromagnetic signal modulation type recognition network ResNet, and collects and generates data sets containing multiple modulation types under various signal-to-noise ratios from FPGA. Specifically, a ResNet network is built, and 6 convolution blocks are divided according to the number of output channels, with a total of 21 convolution layers, 1 average pooling layer and 1 fully connected layer. A spectrum sensing system based on FPGA and AD9361 is used, and 12 modulation type signals with a range of -10dB to 20dB are exported using ILA: ASK, BPSK, QPSK, 8PSK, 16QAM, 32QAM, 64QAM, 128QAM, 256QAM, MSK, 2FSK and 4FSK, which are then organized into data sets in a ratio of 4:

1.

3. The lightweight processing method of the multi-method composite modulation type recognition model according to claim 2 is characterized in that: The IQ data is preprocessed on the FPGA. Specifically, the I and Q data collected by the hardware are I(n) and Q(n) respectively, and the sequence length is N. The mean is obtained first: Then calculate the standard deviation of the two sets of data: Finally, according to the obtained mean and standard deviation, the normalized I and Q data sets are calculated by the following formula: In order to avoid normalization to obtain a positive number less than 1, the quantization operation is advanced and combined with the above formula to obtain the following formula:

4. The lightweight processing method of the multi-means composite modulation type recognition model according to claim 3 is characterized in that: The fusion of the BN layer and the convolution layer is based on the shift register. Specifically, for the convolution layer, assuming that the weight of a convolution kernel is W, the convolution process is to use W to perform sliding window calculation in its input feature map; assuming that an element in W is w, and an element in the input feature map is x, the calculation process for w and x is as follows: y conv =w·x+b For the BN layer, determine the mean variance of the elements in the mini-batch, then subtract the mean divided by the standard deviation from x, and finally use γ and β to perform an affine transformation to get the final BN output. The specific process is as follows: Among them, the first one is the mean formula, the second one is the variance formula, the third one is the normalization formula, and the fourth one is the affine transformation formula. Substituting the convolutional layer formula into the BN layer formula, we get the following formula: Among them, γ, β, μ, σ 2 These are the parameters of the BN layer.

5. The lightweight processing method of the multi-method composite modulation type recognition model according to claim 4 is characterized in that: The method of using Matlab to analyze the maximum and minimum values ​​of the output data of each layer and determine the data truncation standard is as follows: truncate decimals and integers respectively, and truncate decimals by rounding off to keep the bit width at 16 bits; after each layer is built, we need to simulate the output data of the layer through Vivado Simulator; during the simulation process, the output data of the layer is first written into a text document through a file write operation, and then the Matlab program is used to analyze the data in the text document to find the maximum and minimum values ​​of the current layer data, and finally the integer part is truncated according to the maximum and minimum values.

6. The lightweight processing method of the multi-method composite modulation type recognition model according to claim 5 is characterized in that: The correctness of the verification network is specifically as follows: a set of data is read arbitrarily in the data set, the data set contains 12 modulation modes, 256 groups of each, 512×2 data in each group, and a total of 3072 groups of data. The data is decomposed into a .coe file recognizable by Xilinx FPGA through a python script, and the file is associated with Rom. The convolution module determines the final result based on this data.