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

Primary User Activity Prediction in DSA Networks
using Recurrent Structures
Debashri Roy∗ , Tathagata Mukherjee† , Mainak Chatterjee∗ Eduardo Pasiliao‡∗ Computer Science† Computer Science‡ Munitions Directorate

University of Central Florida
Orlando, FL 32826{debashri, mainak}@cs.ucf.edu

University of Alabama
Huntsville, AL 35899{tm0130}@uah.edu

Air Force Research Laboratory
Eglin AFB, FL, 32542{eduardo.pasiliao}@us.af.mil

Abstract—For unlicensed (secondary) users to opportunistically access the shared radio spectrum on a non-interfering basis,
it is important that they are able to sense the transmission
activities of the licensed (primary) users. However, spectrum
sensing expend a considerable amount of energy and time,
which can be reduced by reliably predicting the primary user
activities. In this paper, we present recurrent neural networkmodels which are able to accurately predict the primary users’
activity in dynamic spectrum access (DSA) networks so thatthe secondary users can opportunistically access the unused
spectrum. Using Universal Software Radio Peripheral (USRP)
Software Defined Radios (SDRs), we collect over-the-air datafrom 8 primary users and train the learning models that we
use in conjunction with a central spectrum sensor. We startby implementing two machine learning models: (i) traditional
linear regression and (ii) neural network model using Long ShortTerm Memory (LSTM). These models are able to predict the
primary users’ activity with 75% and 97% accuracy respectively.
To further improve the prediction accuracy, we exploit the
spatio-temporal correlation in the collected data by implementing
a Convolutional LSTM model– which achieves 99% accuracy
for predicting the long-term activity of primary users. The
experimental results demonstrate that the proposed models areable to successfully predict the primary users’ activities, thereby
reducing both the under-utilizations and interference violations
in DSA networks.

Keywords: Primary Users, Prediction Models, Long ShortTerm Memory, Convolutional LSTM, Spatio-temporal Property, DSA networks.
I. I NTRODUCTION
The ever-increasing demands for spectrum access from different emerging wireless applications have made it necessary
to better manage and utilize the radio spectrum. The successful deployment of such spectrum management approaches
requires intelligent and adaptive systems, in order to accurately
assess the radio environment such that unlicensed (secondary)users are able to opportunistically access the spectrum oflicensed (primary) users when such spectrum is not in use,
thereby increasing the spectrum utilization. However, such
spectrum management and deployment practices must take
into account the fact that spectrum access policies prohibit
any interference violation by the secondary users (SUs) when
primary users (PUs) use the spectrum. The Citizens Broadband
Radio Service (CBRS) [1] is an example of a DSA implementation, where variety of commercial users share the 3.5 GHzband with incumbent federal and non-federal licensed users.

978-1-7281-2376-9/19/$31.00 ©2019 IEEE

The Federal Communications Commission (FCC) [2] mandated that all SUs must release the occupied spectral bands
as soon as any PU starts to transmit on that band, ensuring
uninterrupted availability to the licensed users. To ensure this,the SUs must have knowledge about the spectrum availability.
This awareness is typically achieved by sensing the transmission activities on the target spectrum bands using various
techniques like: use of beacons, geolocation database, andlocal energy sensing at the receivers [3], [4].
In this paper, we focus on spectrum sensing performed ata central spectrum sensor (SS), as the use of a centralized SS
has broaden applications and lower infrastructure costs [5].
We illustrate the various aspects of spectrum sensing in Fig.
1. The first row represents the PU’s ON-OFF activity and theremaining rows show the SU’s activities that include sensing
and transmissions when PU is in the OFF state. Note thatthe first two strategies do not involve separate SS and we
also assume that the SUs sense the spectrum continuously.
The last two strategies involve the SUs deciding to accessthe spectrum based on the information obtained from a local
centralized SS. Thus in the first case, a conservative strategy
is imposed on the SU for use of the channel. The cognitive
SU continuously senses the channel and whenever it finds thatthe channel is free, it transmits in the next timestamp, goingback to the sensing state after that. The second strategy isalso conservative but here the SU transmits in bursty mode.
Both these conservative strategies aim to avoid interference
violations; however, under-utilization is high. As for the third
strategy, the spectrum sensors send information to secondary
user whenever it senses the channel to be free. The secondary
user transmits from one timestamp and consults the spectrum
sensor for the next timestamp. Note that here we assume thatthe time taken to consult the spectrum sensor is less than
the spectrum sensing time. This assumption coupled with thestrategy minimizes the under-utilization of the previous two
strategies. The fourth strategy is proposed in this paper. In
this case, the spectrum sensor is intelligent and trained overthe historical data of primary user activity. It can predict the
primary use’s activity for the next timestamp. The secondary
user uses that prediction to transmit in bursty mode. It isevident from all the four strategies that long term prediction
from the SS enables the SU to transmit efficiently over theshared channel by minimizing both the under-utilization and2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

PU
Time

SU transmitting

Strategy 1

SU Transmission = 7

SU transmitting in
Bursty mode

Strategy 2

SU Transmission = 12

SU with SS

Strategy 3

SU Transmission = 11
SS Involvement = 14

SpectrumSensorStrategy 4

SU with SS (Bursty mode)

SU Transmission = 13
SS Involvement = 4

SpectrumSensorPU Present

PU Absent

Consulting SS

SU Sensing

Under Utilization

SU Transmitting

Interference Violation

Fig. 1. Typical Spectrum Sensing Scenarios

the interference violations.
In this paper, we propose neural network models based onLong Short Term Memory (LSTM) and convolutional LSTM
(ConvLSTM) to predict the primary user’s future inactive time.
We use both the LSTM and ConvLSTM based neural networkmodels for exploiting the recurrent structure in historical overthe-air data from each primary user. To the best of ourknowledge, this paper is the first one to propose a strategy forlong term prediction of the activity of the primary user [6].
The main contributions of this paper are: (1) We propose threemachine learning based models for long-term prediction of
the primary user’s activity. They are: (i) Linear regression;(ii) Recurrent neural network (RNN) with Long Short Term
Memory (LSTM) cells; and (iii) RNN using Convolutional
LSTM (ConvLSTM) cells. (2) Using a testbed, we record
transmission activities of 8 software defined radios (USRP
B210) [7], which are used as primary users. We collect overthe-air I/Q data from these radios using a RTL-SDR [8].
I/Q values are the Inphase (I) and Quadrature (Q) phasecomponents of the signal. (3) A central spectrum sensing
module is trained using the proposed models on the collected
dataset for multiple epochs by minimizing the mean squared
error over the training data. The trained models are then usedby the spectrum sensor and used for long-term prediction of
the activities of the primary user, to be used by the secondaryusers during the deployment phase. (4) We deployed thetrained version of all the models in a spectrum sensor andpredicted the shared channel availability for the secondaryusers with 75%, 97%, and 99% accuracy respectively for linear
regression, LSTM, and ConvLSTM. Note that intuitively the
ConvLSTM based model is able to achieve this high accuracy
by exploiting the spatio-temporal correlation present within

the recurrent structure of the collected I/Q data. (5) We also
show through testbed evaluation that the proposed models candecrease interference violations by 0.2%, 99.3%, and 100% forlinear regression, LSTM and ConvLSTM models, respectively.
Under-utilizations are decreased by 98.9%, 99.5%, and 100%
respectively, for the aforementioned models.
In the next section, we present a survey of the existing
primary user prediction models followed by system modeland problem formulation in section III and different prediction
models in section IV. The testbed setup and experimental
results are presented in section V. Conclusions are drawn in
the last section.
II. R ELATED W ORKS
In this section, we discuss the main premise for using
learning techniques for the primary user’s activity prediction
modeling. We also present some previous important work inthis area that have used machine learning techniques.
Various traditional methods of spectrum sensing and theirapplications have been presented in [5]. The idea of cooperative spectrum sensing was presented as the solution tosecurity related problems in the spectrum sensing domain.
Though the concept of estimating spectrum usage in multiple
dimensions such as time, frequency and space, was introduced,
no prediction attempts were made. In [9], the authors presented
opportunistic spectrum access based on a Markovian modelthat accounted for the bursty nature of ON/OFF traffic models.
Through empirical results, the authors have shown that the
selection of a channel for the secondary user will depend on
the probability distribution of the primary user’s traffic as wellthe elapsed OFF time. This paper established the feasibility of2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

using PU usage modeling for designing the spectrum accessmethods for SU bursty traffic.
There are few existing researches on spectrum sensing andprediction that use machine learning based techniques. An
artificial neural network based approach for spectrum sensing
in noisy environment was proposed in [10]. The simulation
results accomplished better sensing reliability than traditional
techniques for signals with low signal-to-noise ratio (SNR).
A machine learning based spectrum prediction approach was
proposed in [11]. A multi-layer perception (MLP) based neuralnetwork was used to predict the primary user’s activity, theresulting model was validated through extensive simulations.
In [6], the authors give an analytical overview of various
existing methods for spectrum prediction, that are basedon: moving average, autoregressive models, hidden Markov
models, Bayesian interference and static neighbor graph. It
was established that all these models have limited scope for
accurate long-term prediction. A deep cooperative sensing
scheme was proposed by Lee et al. in [12]. A convolutional
neural network (CNN) model was proposed to exploit both
spectral and spatial correlation of individual sensing outcomesfor multiple PUs and SUs. All these studies demonstrate thenecessity of a practical long-term spectrum usage prediction
method for the PUs that leverage machine learning techniques.
Our focus is on the effectiveness of recurrent neural networks [13] which have been used extensively for modelingtemporal data such as speech [14]. There is limited amount ofwork that recognizes the potential of using recurrent structuresin the Radio frequency (RF) domain. Though such use of I/Qdata for building machine learning systems for communication
has been limited in the past, recently it has been used inseveral applications [15]–[18]. RF data (being a time seriesdata) has both spatial and temporal property within the I/Q
components. However, to the best of our knowledge there is
no recurrent neural network based application which exploits
both the spatial and temporal property of the RF data and usethat for a long-term prediction model for PU’s presence orabsence.
III. P ROBLEM D ESCRIPTIONIn this section, we lay out the assumptions, present thesystem model, and formulate the problem.
A. Primary User Activity Pattern
The primary users alternate between ON (busy) and OF F
(idle) periods. Random variables ron and rof f determine
the duration of ON and OF F periods respectively. The
probability distribution of rON and rof f depends on thespecific activity pattern of the primary user. We assume thatthe primary user’s ON and OF F times are independently
and identically distributed and use a Poisson point process tomodel them. Thus we model the probability distributions for
the ON and OF F times of the primary users as:ron 1 −βonron ≥ 0(1)
fon (ron ; βon ) = βon e0ron < 0
rof f
 1 −βof f
fof f (rof f ; βof f ) = βof f e0

rof f ≥ 0(2)

rof f < 0where, βon and βof f are the mean ON and OF F times
respectively.
We define the activity factor of the primary users as theratio of the mean PU ON time to the sum of the mean of PU
ON and OF F times and thus this is given by:
P Uactivity =βonβon + βof f(3)

It must be noted that, it is not required to pre-define a model
for learning; the proposed prediction models are able to learn
any kind of PU activity pattern. We considered the Poissonprocess for our testbed experiments.
B. System Model
We assume that PUs and SUs co-exist in a geographicalarea. The SUs can utilize the spectrum bands when they are
not being used by the PUs. The PUs have priority and cantransmit when they need to. On the other hand, SUs always
have backlogged traffic to transmit and must yield to the PU assoon as they require the spectrum. The transmission times for
the PUs obey the pattern (distribution) as discussed earlier. As
a result of this system model, prior knowledge of PU activity isvital for SUs to effectively and efficiently share the spectrum.
We assume that there is a centralized spectrum sensor thatmonitors the PU transmission activities and maintains recordsof all past observations. The trained models corresponding to
the proposed neural network architectures are co-located withthe spectrum sensor and use the past observations as inputs inorder to predict the activity pattern of the PUs.
C. Problem Formulation
The trained neural network model predicts the primaryuser’s activity at time τ for the next Γ timestamps and the SS
sends that information to the secondary user. Depending on
the prediction information received from the spectrum sensor,
the secondary user schedules its transmission for the next Γtimestamps, thus minimizing the interference violation as wellas the under-utilization.
We denote the states of the primary user’s and secondaryuser’s transmission as sP U and sSU . The ON state of each isrepresented as 1, and OF F state as 0. We also denote tolerable
thresholds for interference violation and under-utilization as
Ithr , and Uthr respectively.
At time τ , the trained model predicts the PU activity forthe next Γ timestamps. In our system we let the SS informthe secondary user when it sees continuous PU inactivity formore than 50% of the predicted Γ timestamps. Note that thisis a heuristic for solving the underlying optimization problem
as given by equation 4. However in the most general setting,at the time τ , depending on the information received from theSS, the secondary user sets its state sSU to 0 or 1 for the2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

next Γ timestamps. Let Ich (t) denote the indicator variable attime t (τ < t ≤ τ + Γ), indicating whether the secondary user
causes interference to the primary user on channel ch. Note
that: Ich (t) = sP U (t) × sSU (t). Similarly, let Uch (t) denote
an indicator variable representing the under-utilization of chchannel at time t. Notice that: Uch (t) = sP U (t) + sSU (t),where + denotes the logical OR operation. sP U (t) and sSU (t)represent the PU’s and SU’s states respectively at time t. We
note that a conservative strategy for dynamic spectrum allocation will result in under-utilization, whereas an aggressive
strategy will lead to a considerable amount of interference
violation, as discussed in connection to Fig. 1.
The secondary user can transmit on the channel when the
primary user is in the OF F state (i.e., sP U = 0). It should
terminate its transmission as soon as the primary user starts totransmit (i.e., sP U = 1). However, while the SU is transmitting(τ < t ≤ τ +Γ), it will not be aware of this state change of thePU (that is it will not be able to detect the change in the Ich (t)states). Thus the possibility of having accurate knowledge ofIch (t) will depend on how well the neural network can model
the underlying probability distribution of the activity of the
primary user.
Finally, our objective is to maximally assign the secondary
user to the ON state constrained over the thresholds ofinterference violation (Ithr ) and under-utilization (Uthr ). Thus,
the general problem can be formulated as follows: let the
number of timestamps where the SU is active be denoted byη where η can takes values between τ + 1 and τ + Γ. Then the
problem can be formulated as that of maximizing η subject tothe constraints on the interference and under-utilization beingbounded above by the respective thresholds. Thus we have:max η
subject to

η
X
t=1
η
X

Ich (t) ≤ Ithr

(4)1) Temporal Property of I/Q data: Given T training samples (for T timestamps) where each sample is a vector of size
M , and each component of the vector is a tuple (I, Q) ∈ C
representing a number in the complex plane, we represent
this vector for a given time stamp t as xt = [[(I, Q)i ]t ; i =1, 2, · · · , M ] ∈ C M where t = 1, 2, · · · , T , and use it as an
input to the neural network. We use a sample size (M ) of
1024 as a default for our experiments. We want to find theprobability of sP U (t) = 0 for the next input vector (xt+1 ) fort = t + 1. The probability P (sP U (t) = 0|xt+1 ) can be writtenas:
P (sP U (t) = 0|xt+1 ) =P (xt |sP U (t) = 0)P (sP U (t) = 0)
P (xt |sP U (t) = 0)P (sP U (t) = 0) + P (xt |sP U (t) = 1)P (sP U (t) = 1)

(5)where P (xt |sP U (t) = 0) and P (xt |sP U (t) = 1) are theconditional probabilities of xt given sP U (t) was set to 0 and
1 respectively. P (sP U (t) = 0) and P (sP U (t) = 1) are themarginal probabilities, values of which will depend on theactivity factor of the primary user. The predicted value ofvector x at the next timestamp (t + 1) will depend on thepredicted value of the current one [20], which is given by:x̃t+1 = arg max(P (xt+1 |x̃t ))2) The LSTM Model: To exploit the temporal property, we
first use the idea of LSTM cells as shown in Fig. 2. In one
LSTM cell, there are typically (i) three types of gates: input(i), forget (f ), and output (o); and (ii) a state update of internalcell memory (c). The most important part of the LSTM cellis the “forget” gate, which at time t is denoted by ft . The
forget gates decide whether to keep a cell state memory (ct )or not. The forget gates are designed as per the equation (7) on
the input value xt at time t and output (ht−1 ) at time (t − 1).
Note that Wxf and bf represent the associated weight and bias
respectively, between input (x) and the forget gate (f ).
ft = σ(Wxf xt + Whf ht−1 + bf )Uch (t) ≤ Uthr

t=1

IV. P ROPOSED RNN BASED P REDICTION M ODELS
We present two types of neural network models thatleverage the temporal and spatio-temporal correlation in thehistorical data of the PU activities, in order to predict future
PU activities. We take the I/Q values of over-the-air signal data
as raw features for future state prediction, as the I/Q values
do not require further sophisticated signal processing. Hencethey are capable of providing an end-to-end solution for our
problem using machine learning techniques.
A. Recurrent Neural Network Model
Fully-connected and convolutional neural networks that are
traditionally used for deep learning lack the capability to
exploit the context available in temporal data. Additionally,
there is the problem of vanishing gradients, when trying to useback propagation with temporal data. Both these problems are
addressed by Recurrent Neural Networks (RNN) [19] which
we now describe in brief in the context of our problem.

(6)

xt+1

(7)

where, σ denotes the sigmoid activation function. Once ft
determines which memories to forget, the input gates (it )decide which cell states (cet ) to update as per equations (8)and (9).
it = σ(Wxi xt + Whi ht−1 + bi )(8)cet = tanh(Wxc xt + Whc ht−1 + bct−1 )(9)In equation (10), the old cell state (ct−1 ) is updated to the newcell state (ct ) using forget gates (ft ) and input gates (it ).
ct = ft ◦ ct−1 + it ◦ cet(10)where, ◦ is the Hadamard product. Finally, we filter the output
values through output gates (ot ) based on the cell states (ct )as per equations (11) and (12).
ot = σ(Wxo xt + Who ht + bo )(11)ht = ot ◦ tanh(ct )(12)2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

1) are the conditional probabilities of χt−γ, t given sP U (t)was set to 0 and 1 respectively. The predicted value of γlength sequence vector χ at timestamp t will depend on thepredicted value of the previously predicted γ length sequence[20], which is given by:(xt, ht-1)

σ
σ

ft

tanh

σ
ct-1

ot

ht

it
ct

tanh

χ̃t, t+γ = arg max (P (χt, t+γ |χ̃t−γ, t ))(14)

χt+1 ···χt+γ

tanh

tanh activation

sum over all elements

σsigmoid activation

Hadamard productFig. 2. LSTM Cell Architecture Used in the Proposed RNN Model

B. Convolutional Recurrent Neural Network
The recurrent neural networks using LSTM cells do notconsider the spatial information encoded in the input-to-stateor state-to-state transitions [20]. However, there are many
applications where spatio-temporal correlation exists within
the dataset. To address this issue, we use a convolution within
the recurrent structure of the RNN. We first discuss the spatiotemporal property of RF data and then model a convolutional
LSTM cell to exploit the same.
1) Spatio-temporal Property of I/Q Data: Suppose that aradio signal is represented as a time varying series over a
spatial region using R rows and C columns. Here R represents
the time varying nature of the signal and as such in our case it
represents the total number of time stamps at which the signal
was sampled (T in our case). C on the other hand represents
the total number of features sampled at each time stamp (inour case its 2048 since there are 1024 features sampled each of
dimension 2). Note that each cell corresponding to one valueof R and one value of C represents a particular feature (I orQ) at a given point in time. In order to capture the spatial
variation of the signal we need to consider samples from thesignal at consecutive time stamps. In our case we consider
time intervals of length γ and hence we represent this bysub-matrices of the original R × C matrix representing thewhole time varying signal. Each of these sub-matrices have γ
rows corresponding to the selected timestamps and C columns.
Thus in a nutshell: to capture the temporal property only, we
made use of a sequence of vectors for timestamps 1, 2, · · · , T ,namely, x1 , x2 , · · · , xT whereas now, to capture both spatial
and temporal properties, we introduce a new vector χt,t+γ ,which is formulated as: χt,t+γ = [xt , xt+1 , · · · , xt+γ−1 ]. So
the vector χt,t+γ eventually preserves the spatial properties
with an increment of γ in time. Thus, we get a sequence of newvectors χ1,γ , χγ,2γ , · · · χt,t+γ , · · · , χt+(ψ−1)γ,t+ψγ , where ψis bR/γc. We formulate the probability of primary user to beidle (P (sP U (t) = 0|χt, t+γ )) for the next γ-length sequenceas:
P (sP U (t) = 0|χt, t+γ ) =P (χt−γ, t |sP U (t) = 0)P (sP U (t) = 0)
P (χt−γ, t |sP U (t) = 0)P (sP U (t) = 0) + P (χt−γ, t |sP U (t) = 1)P (sP U (t) = 1)

(13)
The marginal probabilities for the primary user to be idle
or busy are modeled as P (sP U (t) = 0) and P (sP U (t) = 1)
respectively. P (χt−γ, t |sP U (t) = 0), and P (χt−γ, t |sP U (t) =It must be noted that in our case γ = Γ where Γ is as
described in Section III-C.
2) The ConvLSTM Model: We model the ConvLSTM cell
as presented in Fig. 3. It is similar to an LSTM cell, but the
input transformations and recurrent transformations are bothconvolutional in nature [20]. We formulate the input values,
cell state and hidden states as 3-dimensional vectors, where
the first dimension is the number of features (C/2) and varies
over time, and the last two dimensions contain the spatial
information (rows (R) and columns (C)).
We
represent
these
as:
(i)
the
inputs:χ1,γ , χγ,2γ , · · · χt,t+γ , · · · , χt+(ψ−1)γ,t+ψγ(previously
stated); (ii) cell outputs: C1 , · · · , Ct , and (iii) hidden states:
H1 , · · · , Ht . We represent the gates in a similar manner as in
the LSTM model. The parameters t, it , ft , ot , W , b have thesame meaning as in section IV-A2. The key operations aredefined in equations 15, 16, 17, 18, and 19. The probabilityof next γ-sequence to be in a particular class (from equation
13) is used within the implementation and execution of themodel.
it = σ(Wxi χt,t+γ + Whi Ht−1 + bi )(15)
ft = σ(Wxf χt,t+γ + Whf Ht−1 + bf )(16)

Ct = ft ◦ Ct−1 + it . tanh(Wxc χt,t+γ + Whc Ht−1 + bc )(17)
ot = σ(Wxo χt,t+γ + Who Ht−1 + bo )(18)

Ht = ot ◦ tanh(Ct )

(19)

Xt

σ
σ

ft

tanh

σ

ot

Ct-1

Ht

it
Ht-1
tanh

σ

Ct

tanh

tanh activation

sum over all elements

sigmoid activation

Hadamard productFig. 3. ConvLSTM Cell Architecture Used in the Proposed RNN Model

C. Proposed PU Activity Prediction Model
We propose two models based on recurrent neural networks
to train the spectrum sensor using the historical data of primaryuser activities. The objective is to learn every primary user’s
activity pattern and use it for scheduling SU activity. We also
use the traditional linear regression model for prediction inorder to test the performance of the neural network based

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

models against classical techniques. We present the training
strategy of each model in Fig. 4. First, we divide the dataset
into subsets for training and validation. In each epoch, we
validate the trained model on the validation data and dependingon the validation error we tune the hyper-parameters of eachmodel. A single epoch consists of a forward pass and abackward pass through the implemented architecture for theentire dataset. We normalize the data for both training andvalidation to balance each feature. We design three different
models using three different approaches on the normalizeddata.
LinearRegression

Training
DatasetTrainedModels50 Epochs
Normalize

LSTM

Predicted
Data

Dense

Validation
DatasetAccuracy

CompareConvLSTM

Primary User
Size (GB)
PU#1
3.26
PU#2
3.5
PU#3
3.29
PU#4
3.2
PU#5
3.14
PU#6
3.16
PU#7
3.1
PU#8
3.22
TABLE IC OLLECTED DATASET S IZES FOR D IFFERENT P RIMARY U SERS

duration of time. Determining the data collection time andmodel updating time are application specific. Once the spectrum sensor can get a primary user’s absence prediction fromthe trained model, it relays the information to the secondaryusers. The secondary users later access the idle channel in acooperative manner, details of which is beyond the scope of
this article. Now we are ready to describe our experimental
results.

Flatten50 Epochs

Test Dataset

PU1

Fig. 4. PU Activity Prediction Training of the Spectrum Sensor
PU2

Predicted
Output

256

Dense

512

Dropout = 0.5

Dropout = 0.5

Dropout = 0.5

ConvLSTM2D
Layer2
256

Dense

1024

Flatten

Dense(None,
2048)

ConvLSTM2D
Layer1

Data

Input

The details of the RNN with ConvLSTM cells is presented
in Fig. 5. The first two hidden layers consist of ConvLSTM
cells with 1024 and 256 filers respectively. The last two hidden
layers are Dense layers, applied after flattening the output fromthe last ConvLSTM layer. We also apply Dropout [21] of 0.5
between the different layers to avoid over-fitting of the trainedmodel. The LSTM implementation is also similar, with the
exception of not having the Flatten layer in between the LSTM
and Dense layers. Increasing the number of filters or layers
did not help in achieving higher accuracy for either of themodels. The output layer consists of a fully connected Dense
layer with 1 neuron to generate the predicted value. We runand validate the training data for 50 epochs for both the LSTM
and ConvLSTM models, beyond which we did not notice any
further improvement. During the testing phase, once we get
the predicted values, we compare them with the known values
for the test/validation dataset and estimate the accuracy of the
trained models.

1

1

Fig. 5. RNN Implementation with ConvLSTM Cells for PU Activity
Prediction

Next we present the conceptual overview of the deployment
phase of the proposed prediction models for a cognitive radio
network as shown in Fig. 6. The trained models are deployedwithin the spectrum sensor. The SS also collects and stores thehistorical data of all the primary users for enough time to build
a robust trained model. This trained model also gets updated on
the newly learned primary user’s activity after some specificSpectrum Sensor
Sense
ChannelTrainedModels

PUm

SU1
SU1

SUn

Fig. 6. Deployment of the Proposed PU Prediction Model

V. I MPLEMENTATION AND R ESULTS
In this section we present the details of our implementationand the experimental results.
A. Experimental Environment
In order to validate the proposed models, we collected overthe-air data in an indoor lab environment from 8 universal
software radio peripheral (USRP) B210s [7] acting as primaryusers. We name these 8 radios as PU#1 to PU#8. We collected
the dataset on an i7 machine with 16 GB RAM. We conducted
the proposed model training and evaluation on a Ryzen 8 Coresystem with 64 GB RAM, a GTX 1080 Ti GPU unit with 11
GB graphics memory.
B. Data Collection Environment
The data collection environment is presented in Fig. 7.
A random signal is generated using GNURadio [22] andmodulated with Quadrature Phase Shift Keying (QPSK). We
programmed the USRP B210s to alternate between ON or
OF F states such that the activity factor remained between 0.7
and 0.75. Thus, the collected dataset has more PU presence
data than absence, which helps the learning process. The
duration of ON and OF F times follows the model describedin Section III-A. We generated datasets of different sizes fordifferent PUs. Collected dataset sizes are presented in Table I.
The transmitted signal is received by a RTL-SDR [8] thatused the rtlsdr python library. The AND gate (in Fig. 7) after
the primary user block, is used to represent the fact that either

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

Parameters
Transmitter Gain
Transmitter Frequency
Bandwidth
Sample Size
Samples/Transmitter
Primary Users
Receiver# Primary Users

Values
45 dB
904 MHz (ISM)
200 KHz
1024
Variable
USRP B210
RTL-SDR
8

TABLE IIP RIMARY U SER T RANSMISSION C ONFIGURATION PARAMETERS

the noise or the signal from primary user is transmitted at aparticular timestamp. Primary user’s OF F time is the absenceof radio signal data, therefore it is represented as “Noise”.
We generate different datasets for all the primary users. The“over-the-air” transmission data was collected in an indoor lab
environment where the B210 transmitters and the RTL-SDR
receiver were at a distance of 10 feet with a direct line ofsight. Thus, the underlying channel can be best modeled as a
Rician fading channel. There was also multi-path effects dueto the reflections from the walls.

(rather than using a spectrum analyzer) in order to avoid theassociated costs and also in order to show the robustness of
our methods to imprecise measurements (as measurements insoftware are always inferior to actual hardware measurements).
From Fig. 9, we found that the noise floor was between -20 dB
and -30 dB. Fig. 10 shows that the signal strength for the 200
KHz (from 904.9 MHz to 904.1 MHz) channel was between
0 dB and 10 dB. We set the transmitter gain to 45 dB andcalculated the SNR as the difference between the noise floor
and the signal strength. Our calculated SNR was 5 dB - (-25dB) = 30 dB, with a 45 dB transmitter gain. It is to be notedthat the signal strengths (in dB) of noise and signal measuredby Spektrum is relative, but the difference between them isabsolute.

Noise
Timer

QPSK
Modulation

RandomSignalPrimary
User

Over The Air
Transmission

RandomData
Collection

Datasets

Fig. 9. Noise Floor Plot using Spektrum [23] Software

RTL-SDR

2

2

1

1

Quadrature

Quadrature

Fig. 7. Data Collection Procedure for each Primary User

0
-1

-2
-2

-1

0
Inphase

(a)

1

2

0
-1
-2
-2

-1

0
Inphase1

2(b)Fig. 8. I/Q Values Representation: (a) Signal Present (b) Noise

During the primary user’s ON time, the I/Q values wereorganized in a constellation (please refer to Fig. 8(a)). During
the primary user’s OF F time the I/Q values are random(please refer to Fig. 8(b)). Each data sample had 2048 entities
consisting of 1024 I and 1024 Q values. We chose 1024 assample size as it was sufficient to capture the spatial properties
and at the same time the training was not computationallyintensive. The configuration parameters for the radios are given
in Table II.
C. Signal to Noise Ratio of Data Collection Environment
To measure the signal to noise ratio (SNR) of the testbed environment, we use a RTL-SDR [8] dongle and Spektrum [23]which is an open source spectrum analyzer available for both
Windows and Linux. The screenshots of Spektrum are shownin Fig. 9 and 10 when the signal is absent and present respectively. We calibrate the SNR using the Spektrum software

Fig. 10. Signal Level Plot using Spektrum [23] Software

D. Used Machine Learning Libraries and Performance Metrics
We used Keras [24] as the frontend and Tensorflow [25]as the backend for desiging the proposed neural networkmodels. Keras is an overlay on neural network primitives with
Tensorflow [25] or Theano [26] that provides a customizableinterface for quick deployment of complex neural networks.
We also use Numpy, Scipy and Matplotlib Python libraries forlinear regression and other traditional methods.
“Accuracy” is used as the typical performance metric tomeasure the effectiveness of the proposed neural networks.
However, accuracy can sometimes be misleading and incomplete when the data is skewed. In our dataset, the total PU ON
time is greater than OFF times, making the dataset skewed.

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

A confusion matrix overcomes this problem by showing how
confused the classification model is on its predictions. It
provides more insights into the performance by identifying
not only the number of errors, but also the types of those, i.e.,
false positives and false negatives.
We use accuracy and confusion matrix to demonstrate thereliability of the proposed models. We show the interference
violation and under-utilization to show the feasibility and applicability of the proposed models in cognitive radio networks.
E. Experimental Results
We train three different machine learning models on thecollected dataset of each primary user. The linear regression
model was straight forward and trained with 90% of eachdataset. For both the LSTM and ConvLSTM based models,
we use 90%, 5%, and 5% of data for training, validation, andtesting respectively. During each training, we set the maximum
epoch to 50 with an early stopping condition, such as, if
there is no improvement of validation loss for consecutive 5
epochs, then the training is stopped. We choose 50 epochs
because we observed through multiple runs of training, thateach model reaches optimum accuracy within 50 epochs. We
use Adam [27] based optimization with 10e − 4 learning rate
and mean squared error loss for training both the LSTM and
ConvLSTM based models. We adjusted the hyper-parameter’svalues such that the model gives the best possible accuracy
with training time trade-off.
Once each model is trained, we predict each primary user’s
activity for the next 4000 timestamps using the proposedmodels. We only present last 50 timestamps of those 4000
timestamps in Fig 11, for better display quality and understanding. The plot demonstrates the primary user’s presence
and absence using a threshold on the received signal strength
indicator (RSSI) for PU#1. The threshold is application specific; it is set to -10 dB for our testbed. Although PU#1’s
activity factor was set between 0.7 to 0.75, we see moreabsence for the last 50 timestamps, which shows the robustnessof the data collection procedure. It is evident from the plotsthat the predicted values for both primary user’s presence
and absence are getting closer to actual values for LSTM
and ConvLSTM models, however, ConvLSTM yields the best
results. We observe similar results for the other primary users(PU#2 - P#8) as well.
1) Analysis on Proposed Prediction Models: The prediction
accuracy for all the primary users (PU#1 - PU#8), for all
the proposed models are presented in Table III. We noticethat linear regression gives 73-76% accuracy, whereas the
LSTM and ConvLSTM models manage to get 97%-99%
accuracies respectively. This phenomenon can be justified by
the presence of correlation within the recurrent structure of
RF data. The linear regression based model does not leveragethat property. The LSTM based model exploits only the
temporal property of that recurrent structure giving a better
accuracy (∼97%). However, ConvLSTM based model exploits
the spatio-temporal property within the data and hence gives(a) Presence@LR(b) Absence@LR(c) Presence@LSTM(d) Absence@LSTM(e) Presence@ConvLSTM(f) Absence@ConvLSTM

Fig. 11. Predictions of last few Timestamps for different Models for PU#1

the best accuracy(∼99% - 100%) among all the proposed
prediction models for all the 8 primary users.
2) Performance of ConvLSTM Model: The accuracies fortraining and validation are presented in Fig. 12 for PU#1. It isobserved that training and validation accuracy saturates withina few epochs of the start of training. The model behaves in thesame manner for the other PUs as well. Once the ConvLSTM
model is trained, we find the confusion matrices for all the
8 PUs for the next 4000 timestamps, as presented in Fig. 13.
Since the PU’s activity factor was set between 0.7 and 0.75, we
notice a skewed behavior for the total presence and absence
times of the primary users respectively. It is clear from theconfusion matrices that the ConvLSTM based model yields
negligible numbers of false positives and false negatives during
the deployment phase.
3) Analysis on Interference Violations and Underutilization: We calculate the total number of interference
violations (IV ) and under-utilization (U U ) for each model.
Table IV presents the total numbers and improvement of IV
and U U after using all the proposed learning models, overusing the conservative allocation strategies. It is clear that2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)

LinearRNN
RNN
Regression(LSTM) (ConvLSTM)
PU #1
73.98%
97.62%
100%
PU #2
77.60%
97.83%
99.95%
PU #3
75.15%
97.92%
100%
PU #4
75.15%
97.60%
99.98%
PU #5
75.80%
97.88%
99.98%
PU #6
74.58%
97.62%
99.98%
PU #7
74.72%
97.75%
100%
PU #8
76.75%
97.72%
99.98%TABLE III
ACCURACIES OF I MPLEMENTED M ODELS FOR DIFFERENT P RIMARYU SERSTechniquesFig. 12. Prediction accuracy for ConvLSTM

Conservative
LinearRegression
RNN-LSTM
RNN-ConvLSTM

Interference
Violation (IV )
1043
1041

IV
Change↓0.2%

Under
Utilization (U U )
1478
15

UU
Change↓98.9%

7
0↓99.3 %
↓100 %

6
0↓99.5%↓100%

TABLE IVC OMPARISON OF I NTERFERENCE V IOLATION AND U NDER - UTILIZATIONFOR THE P ROPOSED M ODELS FOR PU#1

(a) PU#1(b) PU#2(c) PU#3(d) PU#4(e) PU#5(f) PU#6(g) PU#7(h) PU#8

Fig. 13. Confusion Matrices for Prediction using ConvLSTM for 8 PUs

the long-term prediction from ConvLSTM based model has
no interference violation and under-utilization. Fig. 14 gives
the graphical overview of how the IV and U U change as thetime increases for all types of models. It is evident that the
cumulative number of interference violation is significantly
high for the conservative approach than the proposed learning
based models. However, the cumulative under-utilization ishigh for both the conservative and linear regression models.
The changes of LSTM and ConvLSTM based models are
not quite visible in this figure, so we present the enhanced
view of their changes in Fig. 15. In summary we haveshown that, (1) Linear regression based model gives 73-76%
accuracy for primary user’s activity prediction. (2) LSTM
based recurrent neural network model increases that accuracy
to 97% for the activity prediction of all the 8 primary users.
(3) ConvLSTM based RNN model gives the best accuracy(∼100%) for the long-term prediction of primary user’s
activity. (4) The ConvLSTM based model also decreased
the number of interference violations and under-utilizations
by 100% compared to the conservative one. (5) Trained
ConvLSTM based RNN models can be deployed in a central
spectrum sensor for a robust and efficient cognitive radio
network.
4) Computational Complexities: We focus on the computational time complexity for the training phase only, as thetrained model gives the output within constant time (O(1))
during the deployment phase. Computing the time complexity
for training a neural network is still evolving. In [28], theauthors proved that a neural network of depth δ can be trainedδin poly(s2 ), where s is the dimension of the input, andpoly(.) takes a polynomial time depending on the machine
configuration. Here s depends on the dataset size.
Suppose each dataset has T samples. As mentioned earlier,
we use 95% of data for training and validation purpose. The
complexity for RNN models with 6 layers using 95% of T data
6
samples for training and validation, is poly(0.95×T e32 ). For

2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN)(a) Interference Violations(b) Under-utilization

Fig. 14. Cumulative Interference Violations and Under-utilization for Conservative and all Proposed Models for PU#1

(a) Interference Violations(b) Under-utilization

Fig. 15. Enhanced Comparison of Cumulative Interference Violations andUnder-utilization for the Proposed Models for PU#1

linear regression model, the complexity is O(p2 T +p3 ), where
p is the number of features. The prediction complexity is O(p).
VI. C ONCLUSIONSThe opportunistic usage of spectrum by secondary users has
the possibility of leading to an uniform and efficient usageof overly crowded radio frequency bands. In this regard we
present the use of machine learning techniques to predict thepossible opportunities for such spectrum usage by secondaryusers. We investigate the spatio-temporal aspect of over-the-air
radio data for that purpose. The long-term pattern of primaryuser’s ON and OF F times are learned by the proposed
neural network models. The comparative analysis with linear regression shows that exploiting the recurrent structureswith respect to temporal and spatial variations achieves thebest possible accuracy, as seen from the proposed prediction
models. Leveraging the memory of earlier transmission helps
the sensing network to determine primary user activity pattern accurately over time. Successful implementation of the
proposed models will improve spectrum utilization and lower
interference violation for dynamic spectrum access networks.
R EFERENCES[1] Rulemakings 12-354 and 17-258, “3.5 GHz Band / Citizens Broadband
Radio Service,” https://www.fcc.gov/wireless/bureau-divisions/mobilitydivision/35-ghz-band/35-ghz-band-citizens-broadband-radio-service,
2015.

[2] FCC ET Docket No. 08-260, “Second Report and Order and Memorandum Opinion and Order – Unlicensed Operation in the TV Broadcast
Bands / Additional Spectrum for Unlicensed Devices Below 900 MHz
and in the 3GHz Band,” US Federal Communications Commission,
Washington DC, FCC 08-260, 2008.
[3] Y. Zhao, L. Morales, J. Gaeddert, K. K. Bae, J. Um, and J. H. Reed,“Applying Radio Environment Maps to Cognitive Wireless Regional
Area Networks,” in IEEE DySPAN, 2007, pp. 115–118.
[4] M. J. Marcus, “Unlicensed Cognitive sharing of TV Spectrum: The
Controversy at the Federal Communications Commission,” IEEE Communications Magazine, vol. 43, no. 5, pp. 24–25, 2005.
[5] T. Yucek and H. Arslan, “A Survey of Spectrum Sensing Algorithms
for Cognitive Radio Applications,” IEEE Communications Surveys Tutorials, vol. 11, no. 1, pp. 116–130, 2009.
[6] X. Xing, T. Jing, W. Cheng, Y. Huo, and X. Cheng, “Spectrum prediction
in cognitive radio networks,” IEEE Wireless Communications, vol. 20,
no. 2, pp. 90–96, 2013.
[7] Ettus Research, “USRP B210,” https://www.ettus.com/product/details/
UB210-KIT, 2018.
[8] NooElec, “USRP B210,” http://www.nooelec.com/store/sdr/sdrreceivers/nesdr-mini-rtl2832-r820t.html, 2018.
[9] K. W. Sung, S. Kim, and J. Zander, “Temporal Spectrum Sharing Basedon Primary User Activity Prediction,” IEEE Transactions on WirelessCommunications, vol. 9, no. 12, pp. 3848–3855, 2010.
[10] Y. Tang, Q. Zhang, and W. Lin, “Artificial Neural Network Based
Spectrum Sensing Method for Cognitive Radio,” in Proceedings IEEE
WiCOM, 2010, pp. 1–4.
[11] V. K. Tumuluru, P. Wang, and D. Niyato, “A Neural Network Based
Spectrum Prediction Scheme for Cognitive Radio,” in IEEE International Conference on Communications, 2010, pp. 1–5.
[12] W. Lee, M. Kim, and D. Cho, “Deep Cooperative Sensing: Cooperative
Spectrum Sensing Based on Convolutional Neural Networks,” IEEE
Transactions on Vehicular Technology, vol. 68, no. 3, pp. 3005–3009,
2019.
[13] I. Goodfellow, Y. Bengio, and A. Courville, Deep learning. MIT press,
2016.
[14] J. S. Ren, Y. Hu, Y.-W. Tai, C. Wang, L. Xu, W. Sun, and Q. Yan, “Look,
Listen and Learn-A Multimodal LSTM for Speaker Identification,” in
AAAI, 2016, pp. 3581–3587.
[15] T. J. O’Shea, J. Corgan, and T. C. Clancy, “Convolutional Radio
Modulation Recognition Networks,” in Engineering Applications of
Neural Networks, 2016, pp. 213–226.
[16] T. Mukherjee et al., “RSSI-Based Supervised Learning for Uncooperative Direction-Finding,” in Proceedings of ECML-PKDD, ECMLPKDD. Springer, 10 2017.
[17] T. OShea and J. Hoydis, “An Introduction to Deep Learning for the
Physical Layer,” IEEE Transactions on Cognitive Communications andNetworking, vol. 3, no. 4, pp. 563–575, 2017.
[18] D. Roy, T. Mukherjee, M. Chatterjee, and E. Pasiliao, “Detection ofRogue RF Transmitters using Generative Adversarial Nets,” in IEEE
Wireless Communications and Networking Conference (WCNC), 2019.
[19] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521,
no. 7553, pp. 436–444, 2015.
[20] X. Shi, Z. Chen, H. Wang, D.-Y. Yeung, W.-k. Wong, and W.-c. Woo,
“Convolutional LSTM Network: A Machine Learning Approach for
Precipitation Nowcasting,” in Proceedings of the 28th International
Conference on Neural Information Processing Systems - Volume 1, 2015,
pp. 802–810.
[21] N. Srivastava et al., “Dropout: A Simple Way to Prevent Neural
Networks from Overfitting,” The Journal of Machine Learning Research,
vol. 15, no. 1, pp. 1929–1958, 2014.
[22] GNURadio, “GNU Radio,” https://www.gnuradio.org, 2018.
[23] Pavel Sorejs, “Spektrum,” https://github.com/pavels/spektrum, 2015.
[24] F. Chollet et al., “Keras: The Python Deep Learning library,”https://keras.io, 2015.
[25] M. Abadi et al., “Tensorflow: Large-scale machine learning on heterogeneous distributed systems,” CoRR, 2016.
[26] R. Al-Rfou et al., “Theano: A python framework for fast computationof mathematical expressions,” CoRR, 2016.
[27] D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,”
CoRR, vol. abs/1412.6980, 2014.
[28] R. Livni, S. Shalev-Shwartz, and O. Shamir, “On the Computational
Efficiency of Training Neural Networks,” in Advances in Neural Information Processing Systems, 2014, pp. 855–863.