Towards a GNU Radio CNN TensorFlow Block

tensor_xor_test.grc

Automatic Modulation Classification

I have been attempting to use the Spectral Correlation Function in order to recognise the modulation scheme used by various signals, however I have run into a number of difficulties with such an approach, which are outlined below.

I found the following awesome paper on an approach using neural networks – Convolutional Radio Modulation Recognition Networks – Timothy J. O’Shea , Johnathan Corgan , and T. Charles Clancy, which I implemented a version of through the use of TFlearn (a TensorFlow wrapper). Through this paper I also learned of the RadioML dataset which is an invaluable resource for training and testing the classifier.

Difficulties with SCF approach

I found the paper Improved PSK Classification Using Spectral Correlation Function – Jeevan Kuriakose, A.Rajesh and P.K.Bora, which shows how the SCF method I have been attempting to use, is unable to distinguish between different PSK schemes, without pre-processing the data, which resulted in my low accuracy.

You can see the similarity between the SCF of different PSK schemes generated by the FAM algorithm, through the excellent gr-specest GNU Radio block. gr-specest is a great library which is capable of obtaining the spectral correlation density of a signal via the Frequency Accumulation Method.

2psk

4psk

8psk

A CNN approach

Instead of the approach I had been attempting to use, where there is significant processing before passing the data to the ANN, their approach takes the complex data of a signal and applies it directly to the neural network. I find this approach especially fascinating as the network is able to learn from the raw data itself. I created a simple implementation using their model specification in TensorFlow via the TFlearn API. You can download that at train_cnn.py, which utilises the RadioML dataset for training and testing.

It is currently obtaining 92.79% accuracy at 18dB, which is significantly better than the SCF method I was attempting to use.

It is capable of recognising the following modulation schemes:

  • 8PSK
  • AM-DSB
  • AM-SSB
  • BPSK
  • CPFSK
  • GFSK
  • PAM4
  • QAM16
  • QAM64
  • QPSK
  • WBFM

TensorFlow & GNU Radio

GNU Radio provides the ability to write blocks through the use of Python, which makes it especially easy to make use of the TensorFlow API within them.

I created a block in Python, which is capable of allowing a user to load a TensorFlow model. I tested the block with a simple XOR ANN, which is essentially an Artificial Neural Network model, which is capable of producing an output which represents the bitwise xor of two inputs, which can be seen in the flow diagram below. The block is then capable of producing PMT output for the output neurons of the xor model.

tensor_xor_test.grc

I am planning on now converting the TFlearn implementation of the CNN, to a raw Tensor Flow implementation, which will then enable me to save the Tensor Flow graph so it can then be loaded through the TFModel block.

You can obtain the TFModel block from the dev_amc tree of https://github.com/gnuradio/gr-inspector