Nothing Special   »   [go: up one dir, main page]

Modulation Recognition With GNU Radio, Keras, and

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

2017 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

Modulation Recognition with GNU Radio, Keras, and


HackRF
Dr. Jack L. Ziegler, Dr. Robert T. Arn, Dr. William Chambers
Northrop Grumman Corporation
Mission Systems
Aurora, Colorado

Abstract—Recognition and classification of the modulation


format of received signals in real time is a challenging but A. Raw I/Q
necessary task for the intelligence community. Without prior The raw, unprocessed, I/Q data comes almost directly from
knowledge of the received data, such as power, frequency, and the output of a receiver’s analog-to-digital converter. We
phase, coupled with real-world concerns such as signal utilize the standard practice of transitioning the signal from the
degradation and interference, the task of reconstructing the sent over-the-air carrier frequency to an intermediate frequency of
information is made even more complex. Our approach for our choice. Building off the work of Oshea et. al [9], who has
classifying modulation types of live over-the-air signals, a led the effort of using I/Q data as inputs to neural networks,
precursor step to demodulation, involves using software defined we are able to recognize signal modulations and specific
radio plus two simple and inexpensive transceivers to train a pseudorandom sequences of direct sequence spread spectrum
series of neural networks over a set of three data types.
(DSSS) signals.
Keywords—GNU Radio; spectral correlation; modulation B. Power Spectrum
recognition; convolutional neural network, software defined radio
The power spectral density (PSD), or power spectrum for
I. INTRODUCTION short, represents the power of a signal as a function of
frequency across the bandwidth of the signal. This property is
In the past year, modulation recognition (ModRec) with estimated in the digital domain using the Discrete Fourier
software defined radio (SDR) has become easier with the Transform (DFT), where an FFT size controls the resolution
release of publications and software tools for signal analysis and amount of time averaging a processed signal will have
and deep learning. Deep learning, a buzz word for neural when the sample rate is fixed. The PSD is used for energy
networks with many layers, is most widely known for image detection, and we also use as a method for signal detection.
recognition. However, its fundamental role as a statistical Detection is established both with a modal base threshold as
framework for pattern recognition is immediately extendable well as bin-wise neural network classification.
to recognizing the patterns found in digitally processed
signals, in particular for our case, modulation type recognition C. Spectral Correlation Density / FFT Accumulation Method
and signal detection. The spectral correlation density (SCD), a cyclostationary
The recent popularity of the open source platform GNU feature, describes the cross-correlation of a signal in the
Radio has led to an abundance of supporting documentation frequency domain. This function shows the amount of
and Out-of-Tree (OOT) modules that enable extensions of correlation of the frequency component, f, with the frequency
example solutions to more complex and analogous problems components of f – ½ alpha and f + ½ alpha. Real-time analysis
[3]. Also, just as important, the release of the high-level needs the SCD to be estimated with a particular frequency
python library Keras [4] for solving neural networks has resolution and time averaging time step. The FFT
allowed researchers to concentrate on problem solving rather accumulation method (FAM), estimates the SCD and has
than code development. Classification techniques and efficient already been implemented with gr-specest and gr-inspector [1]
signal generation for convolutional neural networks (CNNs) in for immediate use. We attempt to optimize the “hyper-
the domain of modulation recognition have gained recent parameters” of time and frequency resolution for our neural
success in research [10] and in open source software [1, 2, 6, networks while noting that true optimization of these
9]. Our approach for competing in the 2017 DySpan Battle of parameters is not currently feasible for real time classification.
the ModRecs competition/workshop builds upon these
III. SOFTWARE TOOLS
classification techniques and open source software tools.
Our software tools stem from open source SDR platforms
II. CLASSIFICATION TECHNIQUES and deep learning libraries, specifically TensorFlow [5], which
Our machine learning tool of choice is Deep Learning, for can be utilized from the Keras [4] library.
which Keras [4] is used. Within this domain, we are currently A. GNU Radio
using three classification techniques to recognize different
To train our neural networks, we use GNU Radio and the
modulation types. Each uses a different form of input data
GNU Radio Companion GUI to construct and compute
which is fed into the first layer of a neural network.

978-1-5090-2830-6/17/$31.00 ©2017 IEEE


2017 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

simulated I/Q and PSD data with known modulation types. IV. HARDWARE
These tools enable us to visualize the signal construction via Due to its popularity, ample documentation, performance,
flow graphs as well as immediately converting these graphs to
and low cost, we will choose the USRP HackRF One, from
python code. GNU Radio is a powerful open source SDR that
also allows us to build upon other’s modules, specifically that Great Scott Gadgets [13]. We use two HackRF transceivers
from gr-inspector, RadioML, and DARPA’s Spectrum with 1-6 GHz specific antennas. While only one receiver is
Collaboration Challenge. necessary for participation in the competition, we are
preparing by creating a live over-the-air training environment
B. GR-Inspector similar to what we anticipate experiencing at the event.
GR-Inspector [1] is a signals intelligence (SIGINT) based Training the neural networks with larger numbers of
(OOT) module for GNU Radio that enables signal detection training samples generally results in more accurate
using an energy threshold, signal separation using band pass classification. To handle this data in a timely manner, we use
filters, and signal classification using predefined or user two high-performance GPU workstations for training neural
defined TensorFlow graphs / neural networks. This module networks and testing different combinations of hyper-
works with another OOT module, gr-specest, to generate and parameters (number and types of layers, batch size,
visualize FAM data. The “Models” GIT repo [2] of gr- optimizers, input data size/resolution, etc.). Each workstation
inspector provides the framework for this data generation is equipped with four Nvidia GTX 1080 GPUs. This allows us
which we use to train the TensorFlow neural networks. to train 8 neural networks each with an 8 GB foot print.
C. RadioML Data Generation Alternatively, we can train two neural networks more
The work of O’shea et. al [10] which used I/Q data as efficiently by using GPU data parallelism with the TensorFlow
inputs to CNN for modulation recognition has been expanded [5] backend of Keras. After training is completed, the
upon with an improved dynamic channel model [9]. This execution time of the neural networks classification is short in
published data generation tool, RadioML [14], constructs a comparison.
user defined number of training samples for 11 modulation
V. APPROACH
types over SNR values ranging from -20 to 20 dB. We modify
this transmitter module to include all 30 modulation types Our approach for participation in the Battle of the
specified for the Battle of the ModRecs. ModRecs extends and combines our modified versions of
freely available GitHub code from GNU Radio [3], gr-
D. SC2 Hurdle 2: Random Band Plan Generator inspector [1], RadioML [14], and the SC2 Hurdles [6].
The SC2 hurdles [6, 7] directed competitors to classify 30 Starting with simulated data, we use model parallelism with
frequency bins within a 1 MHz bandwidth for which there I/Q, PSD, and FAM data [1, 8] to train neural networks. These
were zero to three different signals in each bin. Our solution, deep networks have multiple convolutional and dense layers
which recorded an 100% classification accuracy, used the that are merged into one classifying layer. We have expanded
provided band plan generator to create thousands of random the modulation types available in the RadioML and gr-
single combinations. We converted these to a power spectrum inspector/models data generator codes [9, 2] to include
data type as input to our neural network. For this competition, modulation types in the provided Battle of the ModRecs list
we adopt a similar approach for signal generation, now [12].
utilizing 500 rather than 30 bins.
For the task of generating data, we are testing two
E. Keras, Theano, and TensorFlow approaches. One, use gr-inspector and/or our PSD based
Keras [4] is a powerful deep learning library which can be neural network to first detect and separate individual signals
paired with Theano and TensorFlow [5] back ends. Using which are then converted into IQ, PSD, and FAM formats for
these tools we have, in-house, improved on the RadioML a merged network classification. Two, if computationally
example networks by merging three neural networks, each of feasible, assume a signal could be in every 20 kHz frequency
which took a different data type (I, Q, and a 2D array of I and bin and use these in a 31 class neural network, where one class
Q). These networks had 4 one/two dimensional convolutional is designated as “no signal present”. The second approach is
layers which merged into two dense layers, the last of which time efficient with input data as a high resolution PSD, yet due
had 11 nodes for classification. to the extra time expense of the band-pass filtering step, IQ
and FAM based detection cannot be applied indiscriminately
For the SC2 challenge, we utilized Keras libraries for to all bins.
modulation classification by feeding the power spectrum into
two convolutional layers followed by two dense layers. The We generate and train a series of neural networks on
whole 1 MHz spectrum cut into bin centered pieces. This simulated data across a range of -20 to 20 dB SNR values in
allowed us to use a frequency shifted version of the data with a our preliminary steps. Then, we generate a similar set of data
width slightly larger the maximum signal bandwidth to that is then transmitted and subsequently received by two
classify each frequency bin. In other words, 30 instances of the HackRF One transceivers [11]. The simplicity of SDR and
same neural network were used separately for each bin and the GNU Radio allows us to remove a “file sink” and add a
input data included adjacent bins in order to classify varying “USRP sink” block in the data flow. This enables a quick
signal bandwidths that could occupy anywhere from 1 to 4 transition of our data generation from simulation to
bins. transmission. At the receiving end, the same data storing style
is adopted, letting us to immediately train another series of
2017 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

neural networks based on live data. These two series of neural While we hope to win the battle, we are approaching the
networks (SDR and SDR + transmitted based) will showcase event as an opportunity to share ideas, and learn from other
the difference between the devices’ unique noise environment. competitors and the event itself.
As described for the battle [12], the center frequency range TABLE I. MODULATION TYPES
of transmission will be between 1 and 6 GHz and the
instantaneous bandwidth will be 10 MHz. The minimum Data Types Modulation Category Modulation
single signal bandwidth will be 20 KHz, and short bandwidth AM-SSB-WC
AM-SSB-SC
signals will be contained within wideband signals; however,
AM AM-DSB-WC
immediately adjacent signals will not overlap. Therefore, our Analog AM-DSB-SC
approach is to create a randomly changing set of signals across AM-VSB
a 10 MHz baseband that is transmitted with a carrier frequency FM FM
within the 2.4 to 2.5 GHz ISM FCC band. As discussed in our 2-FSK
FSK 4-FSK
software tools section, we extended the random signal “band 8-FSK
plan” generator from the SC2 hurdle 2 repository [6], to 500 MSK GMSK
frequency bins of 20 kHz each. We will also add a select BPSK
number of wide signals, for example DSSS signals, that will QPSK
contain short bandwidth signals within its frequency range. OQPSK
PSK
8-PSK
Our randomly calculated set of band plans [6] will be changed 16-PSK
every 100 ms. This database of generated training data will be 32-PSK
on the order of 10 GB after conversion from digital signal to 16-APSK
training data form (PSD, FAM, and IQ). 10 GB is a reasonable 32-APSK
Digital APSK
64-APSK
limit for training a neural network overnight with our high- 128-APSK
powered GPU workstations. 16-QAM
32-QAM
We have extended the RadioML/transmitter python QAM 64-QAM
module generator from the current 11 modulation types to 128-QAM
include the 30 modulation types for the battle. The list of 256-QAM
signal types, as organized in Table 1, is diverse and contains OOK
ASK 4-ASK
both analog and digital modulations. The analog signals 8-ASK
include two categories, of amplitude and frequency DSSS
SS
modulation, specifically: AM-SSB-WC, AM-SSB-SC, AM- FHSS
DSB-WC, AM-DSB-SC, AM-VSB, FM. The digital signals
are grouped into the 7 categories of frequency shift keying
(FSK), minimum shift keying (MSK), phase shift keying REFERENCES
(PSK), amplitude phase shift keying (APSK), quadrature 1. https://github.com/chrisruk/gr-inspector
amplitude modulation (QAM), amplitude shift keying (ASK), 2. https://github.com/chrisruk/models
and spread spectrum (SS). 3. gnuradio.org
4. https://keras.io
At this point it is appropriate to mention our last
5. tensorflow.org
potentially planned approach. Instead of immediately
6. https://github.com/SpectrumCollaborationChallenge/phase1-hurdles
classifying the modulation type with one neural network, a
7. https://spectrumcollaborationchallenge.com
decision tree comprising of multiple neural networks will be
tested. For example, classifications of analog or digital at the 8. M. Sung, “Characterizing cyclostationary feature of digital modulated
signal with empirical measurements using spectral correlation fuction,”
first layer splits to (FM or AM) and (FSK, MSK, APSK, Thesis, Air Force Institute of Technology, Wright-Patterson, Ohio,
QAM, ASK, or SS). In this approach, there will be a total of 9 2011. http://www.dtic.mil/dtic/tr/fulltext/u2/a544634.pdf
neural networks. (Note that the MSK neural network does 9. T. O'Shea and N. West, “Radio machine learning dataset generation
nothing as we only have GMSK for the MSK category). with gnu radio,” Proceedings of the GNU Radio Conference. 2016.
10. T. O'Shea, J. Corgan, and T. Clancy, “Convolutional Radio Modulation
VI. SUMMARY Recognition Networks,” arXiv preprint arXiv:1602.04105, 2016.
Our approach for participation in the DySpan ModRec 11. https://greatscottgadgets.com/hackrf
battle has been outlined. It involves modeling all modulation 12. http://dyspan2017.ieee-dyspan.org/workshop/ieee-dyspan-2017-
workshop-battle-modrecs/call-papers
types with SDR, generating a multitude of random band plans,
prototyping with channel simulated signals, and developing 13. https://greatscottgadgets.com/hackrf
live over-the-air training of model parallelized CNNs for 14. https://github.com/radioML
classification. The precursor to the final classification by the
model merged CNNs, is to rather than using an energy
threshold, use a neural network to conduct the bin based
detection with the PSD as input. After detection, IQ, PSD,
and FAM datatypes are input to CNNs and then data is merged
for the final classification.

You might also like