scieee AI-readable full text Open interactive document viewer

Time series forecasting with deep learning for cognitive-radio applications

Okorie Enwere, Promise Ihechiluru

Abstract

We live in a world where the number of devices that are constantly communicating with each other are growing exponentially, and to keep up with that trend, new communication technologies are being developed at a higher rate than in previous decades. The consequence of all these is the increase in the shared usage of the same electromagnetic spectrum by all these devices. Cognitive Radios (CR) [1] are being proposed as a solution that allows communication systems to efficiently use the frequency spectrum, by dynamically modifying their transceiver specifications according to the information sensed from the electromagnetic environment, where they should be able to develop sensing, decision, sharing and allocation functions. A Software-defined Radio (SDR) acts as the base upon which CR technology can be implemented. Artificial Intelligence (AI) layers, embedded in CR systems can be used to optimize the management of the electromagnetic spectrum and assist the signal processing and performance of IoT nodes equipped with CR technology [2]. In the past few years, improvements on Artificial Neural Networks (ANNs) have led to their usage in trying to solve the spectrum management problem, where, for example, Long Short-term Memory networks (LSTMs), a type of Recurrent Neural Networks (RNNs) have been used in the past to predict temporal evolution of data [3] [4]. This project contributes to this topic by examining the use of several ANNs to predict spectrum occupancy in CR systems. Their performance is compared in terms of system complexity, execution time and accuracy. Five NN architectures are studied and implemented to predict channel occupancy which was envisioned as a time series forecasting/prediction problem and will be used to predict the future evolution of the radioelectric spectrum for Cognitive-Radio applications.

Full text

i Trabajo de Fin de Máster "Máster Universitario en Microelectónica: Diseño y Aplicaciones de Sistemas Micro/Nanométricos" TIME SERIES FORECASTING WITH DEEP LEARNING FOR COGNITIVE-RADIO APPLICATIONS Author: Promise I. OKORIE Advisors: José Manuel DE LA ROSA UTRERA Luis A. CAMUÑAS MESA 29th November 2021 ii “Always curious...to learn.” pio iii UNIVERSIDAD DE SEVILLA Abstract Facultad de Física Universidad de Sevilla Máster Universitario en Microelectrónica: Diseño y Aplicaciones de Sistemas Micro/Nanométricos Final Masters Project: Time series forecasting with Deep Learning for Cognitive-Radio Applications by Promise I. OKORIE We live in a world where the number of devices that are constantly communicating with each other are growing exponentially, and to keep up with that trend, new communication technologies are being developed at a higher rate than in previous decades. The consequence of all these is the increase in the shared usage of the same electromagnetic spectrum by all these devices. Cognitive Radios (CR) [1] are being proposed as a solution that allows communication systems to efficiently use the frequency spectrum, by dynamically modifying their transceiver specifications according to the information sensed from the electromagnetic environment, where they should be able to develop sensing, decision, sharing and allocation functions. A Software-defined Radio (SDR) acts as the base upon which CR technology can be implemented. Artificial Intelligence (AI) layers, embedded in CR systems can be used to optimize the management of the electromagnetic spectrum and assist the signal processing and performance of IoT nodes equipped with CR technology [2]. In the past few years, improvements on Artificial Neural Networks (ANNs) have led to their usage in trying to solve the spectrum management problem, where, for example, Long Short-term Memory networks (LSTMs), a type of Recurrent Neural Networks (RNNs) have been used in the past to predict temporal evolution of data [3] [4]. This project contributes to this topic by examining the use of several ANNs to predict spectrum occupancy in CR systems. Their performance is compared in terms of system complexity, execution time and accuracy. Five NN architectures are studied and implemented to predict channel occupancy which was envisioned as a time series forecasting/prediction problem and will be used to predict the future evolution of the radioelectric spectrum for Cognitive-Radio applications. v Acknowledgements Getting to this point was not easy and for that I thank God for giving me the strength, wisdom, knowledge and understanding. Thank you, Dad, Mum, Prince (Dedek), Precious (Cious-nwa), and Emma (Ogolo). Thank you to Daniel Rodríguez and Noemi Amengual, ("No es una carrera de 100 metros, es un maratón"), to their wonderful family, to Juanpe, to Vanessa, to my Tía, to Olena and family and to my entire Centre Cristia de Mallorca family. The list is endless. Thank you to Héctor Escobar and Amparo Benitez, to Vladi and Laura and their three cute minions, to David and mi prima Cris and to the rest of my Centro Cristiano El Sembrador family. Thank you very much to my supervisors José Manuel de la Rosa and Luis A. Camuñas Mesa, for their patience and guidance, and mostly for being better human beings that I could ever have wished for. Thank you very much to all who lent me a pen, greeted me, asked about my studies, told me a bad unfunny joke, and so on. Thank you La banda del patio. vii Contents Abstract iii Acknowledgements v Contents vii Acronyms xiii 1 Introduction 1 1.1 Background and motivation ......................... 1 1.2 Current project objective ........................... 2 1.3 Current project tasks ............................. 2 1.4 Report structure ................................ 3 1.5 Structure of current project folder ...................... 3 2 Concepts and previous works 5 2.1 Software defined radio ............................ 5 2.2 Cognitive radio ................................ 6 2.3 Spectrum sensing ............................... 7 2.3.1 Spectrum sensing techniques .................... 8 Energy detection ........................... 8 Wavelet detection ........................... 9 Matched filter detection ....................... 9 2.3.2 Machine learning applied to spectrum sensing .......... 9 Unsupervised learning ........................ 10 Supervised learning ......................... 10 2.4 Deep learning for time series forecasting .................. 11 2.4.1 Artificial neural networks for time series forecasting ...... 11 Convolutional neural networks (CNNs) .............. 12 1D Convolutional Neural Networks (CNNs) ........... 14 Recurrent neural networks (RNNs) ................ 14 Long short-term memory networks (LSTMs) ........... 16 3 Methodology and Content Development 21 3.1 Software requirements ............................ 21 3.2 Dataset ..................................... 21 3.2.1 Dataset preparation for network models: Train and test data . 22 3.2.2 Training data preparation ...................... 23 3.3 Neural networks implementation with Keras ............... 25 3.3.1 Input layer configuration ...................... 27 3.3.2 Sequential model ........................... 28 1D CNN ................................ 28 Vanilla LSTM ............................. 29 viii Encoder-decoder LSTM ....................... 30 CNN-LSTM .............................. 31 ConvLSTM .............................. 33 3.3.3 Network compilation ........................ 35 3.3.4 Network training ........................... 35 3.4 Network model evaluation ......................... 36 3.4.1 Walk-forward validation ....................... 36 1D CNN ................................ 37 LSTM models: Vanilla, Encoder-decoder, CNN-LSTM ...... 38 ConvLSTM .............................. 39 3.4.2 Network forecasting ......................... 40 3.4.3 Forecast evaluation .......................... 41 4 Results and conclusions 43 4.1 Results of network fitting and predictions with network models . . . . 43 4.1.1 Training on CPU for I/O = 10 .................... 43 4.1.2 Training on GPU for I/O = 10 .................... 43 4.2 Conclusions .................................. 45 4.2.1 Results conclusions .......................... 45 4.2.2 Compendium ............................. 45 4.2.3 Personal learning process ...................... 45 4.2.4 Future works and applications ................... 46 Network model to predict multilevel signals of multiple channels ............................. 46 Multilevel signals decision block with multiple thresholds . . . 46 Other applications .......................... 48 A Prediction results of the different network models 51 A.1 Training on CPU for I/O = 10 ........................ 51 A.1.1 1D CNN ................................ 51 A.1.2 Vanilla LSTM ............................. 51 A.1.3 Encoder-decoder LSTM ....................... 52 A.1.4 CNN-LSTM .............................. 52 A.1.5 ConvLSTM .............................. 52 B Software 61 B.1 Python - PyCharm IDE ............................ 61 Bibliography 63 ix List of Figures 1.1 Global device and connection growth. (Source: Cisco Annual Internet Report, 2018–2023)............................... 1 2.1 Visual comparison between a traditional hardware radio and a SDR. . 5 2.2 Ideal SDR transceiver as conceived by Mitola. ............... 6 2.3 Realistic SDR transceiver. .......................... 6 2.4 Cognitive Radio Framework. ........................ 7 2.5 Illustration of a cognition cycle of a CR. .................. 9 2.6 Classification of learning approaches for CRs. ............... 10 2.7 Architecture configuration of LeNet .................... 12 2.8 Architecture configuration of the first deep CNN, AlexNet ....... 13 2.9 Configuration of sample CNN with 2 convolution and one fully-connected layers. ...................................... 13 2.10 Configuration of sample 1D CNN with 3 consecutive CNN layers. . . . 14 2.11 Rolled RNN. .................................. 15 2.12 Unrolled RNN. ................................ 15 2.13 Repeating module with a single layer in a standard RNN. ........ 16 2.14 Repeating module in an LSTM with four interacting layers. ....... 16 2.15 Notation meanings. .............................. 17 2.16 Cell state. .................................... 17 2.17 Cell gate. .................................... 17 2.18 Forget gate. .................................. 18 2.19 New candidate cell and input gate. ..................... 18 2.20 Update cell states. ............................... 18 2.21 Output generation. .............................. 19 2.22 Peephole connections LSTM variant. .................... 19 2.23 Tied forget and input gate LSTM variant. ................. 19 2.24 GRU LSTM variant. .............................. 19 3.1 Plotted data .................................. 23 3.2 Model plot of 1D CNN network. ...................... 29 3.3 Model plot of Vanilla LSTM network. ................... 30 3.4 Model plot of Encoder-decoder LSTM network. ............. 32 3.5 Model plot of CNN-LSTM network. .................... 33 3.6 Model plot of ConvLSTM network. ..................... 34 4.1 Multiple channel 1D CNN architecture ................... 46 4.2 Prediction for channel 1. ........................... 47 4.3 Prediction for channel 2. ........................... 47 4.4 Prediction for channel 3. ........................... 48 4.5 Prediction for channel 4. ........................... 48 4.6 Evolution of channel occupancy and selection.. .............. 49 1 Chapter 1 Introduction 1.1 Background and motivation The rate at which wirelessly connected devices grow is consistently increasing and an indicator is in the number of mostly wireless devices connected to Internet Protocol (IP) networks. Figure 1.1 shows that by 2023, this number is expected to reach 29.3 billion units, up from 18.4 billion in 2018. The functionality of these devices, going from devices that were only capable of voice-only communications, as in the case of mobile phone devices, to devices that require higher data rates as a result of multimedia type applications currently required of them [5]. FIGURE 1.1: Global device and connection growth. (Source: Cisco Annual Internet Report, 2018–2023) Also influential is the exponential growth of information traffic as a result of Internet of Things (IoT). IoT describes physical objects (or groups of such objects) that are embedded with sensors, processing ability, software, and other technologies that connect and exchange data with other devices and systems over the Internet or other communications networks [6]. As such, efficient IoT nodes will require hybrid software/hardware platforms, new computation paradigms, communication protocols, as well as highly adaptive and programmable circuitry, very specially at the analog/digital interface of the system [7], [8]. The most pressing issue in all of these is that, for all the exponential growth, both in the number of devices and in the technological innovations in communication systems, there is an excessive demand and shared use of the electromagnetic spectrum. This spectrum, shared by these devices, is both limited and controlled by regulations and recognized authorities, such as the International Telecommunications Union (ITU) for international regulations, the Federal Communications Commission (FCC) in the United States or the Ministerio de Industria, Turismo y Comercio through the Secretaría de Estado de Telecomunicaciones y para la Sociedad de la Información (SETSI) for Spain, which mostly use a Fixed Spectrum Allocation (FSA) policy. The current static allocation schemes by these regulators consist of assigning channels 2Chapter 1. Introduction to specific users with licenses for specific wireless technologies and services, where these licensed users, also called Primary Users (PUs), have access to their assigned spectrum portions to transmit/receive their data, while others, unlicensed users, are forbidden even when those spectrum portions are unoccupied [9]. When these assigned portions are vacant, frequency or spectrum holes are created. A spectrum hole, also called white space, is a frequency band assigned to a PU, but it is not being used at a particular time and at a particular location [10]. This highlights an inefficient use of the spectrum that leads to spectrum scarcity for unlicensed users, also called Secondary Users (SUs). These allocation schemes cannot accommodate the requirements of an increasing number of higher data rate devices, resulting in the need for innovative techniques that can offer new ways of exploiting the available spectrum [5], and also help provide spectrum spaces for future technologies [11]. A solution to the spectrum scarcity and allocation issue would be to dynamically manage the spectrum by making available the unoccupied (vacant) channels/portions to SUs, without interfering the PUs signals and to achieve this, the Opportunistic Spectrum Access (OSA), also known as the Dynamic Spectrum Access (DSA), has been proposed. Unlike the FSA,DSA allows the sharing of the spectrum between SUs and PUs, whereby the spectrum is divided into numerous bandwidths assigned to one or more dedicated users [12] [13]. CR [14] was proposed as a solution that allows communication systems to make a more efficient use of the electromagnetic spectrum, by dynamically modifying the transceiver specifications according to the information sensed from their electromagnetic environment. CR-based technologies are opportunistic in nature as they provide a way for their users, SUs, to make an opportunistic use of licensed frequency bands when they are not occupied by their owners, i.e. PUs. 1.2 Current project objective The aim of the final project is to explore different architectures of NNs which can be applied for time series forecasting problems and subsequently be used to predict the future evolution of the radioelectric spectrum for Cognitive-Radio applications. 1.3 Current project tasks Given the broad aspect of the main project (i.e, NEURO-RADIO project), it is important to list the specific tasks that were carried out in this Final Masters Project (FMP). 1. Generate dataset that represents the temporal evolution of the occupancy level of a communications channel. 2. Implement five different ANNs models. 3. Fit/train the ANNs models. 4. Use the fitted network models to obtain predictions. 5. Compare the results gotten from the time it takes to build, compile and fit the network models and the accuracy of each model. 1.4. Report structure 3 1.4 Report structure The present report is divided into 4 chapters: • Introduction Brief introduction that explains the motivation behind the project, and the long-term and short-term objectives that are expected to be met. • Theoretical concepts Basic theoretical concepts that are the foundation of the project. • Methodology and implementation Includes the design details and implementation of the project, from dataset obtention to network predictions. • Results and conclusions Results of the network predictions are provided and conclusions are drawn from them. 1.5 Structure of current project folder The scripts for this project are included in the compressed zip file called tfm_Promise. The contents of this file are: •MemoriaTFM: A memory of the masters project in pdf format. • scripts: A folder that contains the scripts used in the project. – main: Main script from where the other scripts are called and all necessary methods are instantiated. This script is run to train the network models and make predictions. The main variables that can be modified to the users discretion are: *cpu_gpu_select: variable to select either the CPU (0) or the GPU (1). *folder_path: folder path where to save generated data. *train_percentage: defines the percentage of the dataset that will be used for training (remaining will be used for prediction/test) *n_input: defines the total samples to used as input. *n_output: defines the number of output samples to be predicted. *num_runs: defines the total number of executions/runs. *net_type: selects the network type, where 1 = CNN, 2 = LSTM. *lstm_model: selects the LSTM model type, where 1 = Vanilla, 2 = Encoder-Decoder, 3 = CNN-LSTM, 4 = Conv-LSTM. – generate_data_input: Script to generate dataset. – cnn_model: Script where functions for the 1D CNN model are implemented. – lstm_model: Script where functions for the vanilla LSTM, encoder-decoder, CNN-LSTM, and ConvLSTM models are implemented. 5 Chapter 2 Concepts and previous works In this chapter, we explain the general concepts that make up the foundation of the project. We look at concepts like cognitive radio, spectrum sensing, neural networks etc 2.1 Software defined radio The radio communication in traditional hardware radios is all carried out by hardware components that include amplifiers, capacitors, inductors, filters, modulators/demodulators etc. SDR) replaces some or all these physical components with software layers that implement the operating functions of the radio. SDRs include programmable analog-to-digital converters, and a microprocessor, FPGA, or generalpurpose computer that acts as the digital processing hardware. An image comparison of the hardware of a traditional radio and an SDR is shown in Figure 2.1a and Figure 2.1b. Earlier mentions of SDRs are attributed to articles by J. Mitola [1][14] (A) JVC Nivico TH-2770Z Transistor Radio.1 (B) (Ettus Research N210 software defined radio. FIGURE 2.1: Visual comparison between a traditional hardware radio and a SDR. 1image retrieved from http://antiqueradio.org/ 6Chapter 2. Concepts and previous works A block diagram of an ideal SDR transceiver [15], as it was originally conceived by Mitola [1] is shown in Figure 2.2, where the RF signal coming in from the antenna is directly digitized by an Analog-to-digital converter (ADC). The digitization is close to the antenna and most of the processing is performed by a high-speed general-purpose digital signal processor (DSP) [15]. Software run on the DSP can be used to implement functions like frequency tuning and translation, filtering, channel selection, demodulation, etc. On the transmitter side, a power amplifier (PA) is combined with a Digital-to-analog converter (DAC). This ideal SDR transceiver is unrealizable because the required specifications for both the ADC and the DAC are prohibitively rigorous and as such the realistic radio transceiver would contain an analog-signal-processing (ASP) section that includes signal conditioning (frequency translation, amplification, and filtering) [15]. This realistic implementation of the transceiver is shown in Figure 2.3. FIGURE 2.2: Ideal SDR transceiver as conceived by Mitola. FIGURE 2.3: Realistic SDR transceiver. 2.2 Cognitive radio First proposed by Mitola [14], it defines a radio that has the ability to sense their environment and make decisions based on the gotten information. The communication system of the radio is defined such that it can adjust its behaviour and adapt to meet its objectives, depending on the information gotten from the environment and its internal state. This ability to sense and make decisions is enabled by the software-defined layers of the radio. A cognitive radio must be self-aware, where 2.3. Spectrum sensing 7 it’s knowledge of a minimum set of basic facts about radio is used to communicate with other entities. An ideal CR, as conceived by Mitola, should be able to perform the following tasks: spectrum sensing, spectrum sharing, spectrum decision, and spectrum mobility [11]. A CR framework model is shown in Figure 2.4 [16]. FIGURE 2.4: Cognitive Radio Framework. The radio hardware (an SDR or Programmable Digital Radio (PDR)) consists of a set of modules: antenna, RF section, modem, information security (INFOSEC) module, baseband/ protocol processor, and user interface. The baseband processor hosts both the protocol and control software. The modem software includes the modem with equalizer, among other things. The framework also showcases how the cognitive radio has an internal model of its own hardware and software structure. The equalizer model would contain the codified knowledge about equalizers, including how the taps represent the channel impulse response and the variable bindings between it and the software equalizer establish the interface between the reasoning capability and the operational software. The model-based reasoning capability that applies these Radio Knowledge Representation Language (RKRL) frames to solve radio control problems gives the radio its "cognitive" ability. Benefits of CR include usage optimization of assigned and unassigned spectrum, interoperability organization between users, network reconfiguration to meet current needs, etc. 2.3 Spectrum sensing Spectrum Sensing (SS) is the task of obtaining awareness about the spectrum usage and existence of PUs in a geographical area. This awareness can be obtained by using geolocation and database, by using beacons, or by local spectrum sensing at CRs [5]. The SS model can be formulated as [10]: y(n) = (w(n)H0: PU absent h∗s(n) + w(n),H1: PU present (2.1) where: •n=1 . . . N. •Nis the number of samples. 8Chapter 2. Concepts and previous works •y(n)is the signal received by the SU. •s(n)is the PU signal. •w(n)is the additive white Gaussian noise (AWGN) with zero mean and variance, δ2 w. •his the complex channel gain of the sensing channel. •H0denotes the absence of the PU signal. •H1denotes the presence of the PU signal. A SS technique is used to detect PU signals and the detector output (test statistic) is then compared to a threshold in order to make the sensing decision about the PU signal presence. The sensing decision is performed as [10]: (if T≥γ,H1 if T<γ,H0 (2.2) where Tdenotes the test statistic of the detector and γdenotes the sensing threshold. If the PU signal is absent, SUs can access the PU channel, and on the contrary, access is denied. 2.3.1 Spectrum sensing techniques Many diverse SS techniques have been reported so far and they can be classified into two main categories: cooperative sensing and non-cooperative sensing [10][17] [18]. In cooperative sensing, SUs collaborate and coordinate with each other taking into account the objectives of each SU to make the final common decision. This cooperation between the different SUs can be divided into two schemes: centralized and distributed schemes. In distributed scheme, for a given frequency band, the sensing result of each SU is exchanged with other SUs, where each SU makes its own final decision, basing on the received results of others. For the centralized scheme, all the SUs send their sensing results to a central unit, called fusion centre, that makes the final decision on which SU accesses the spectrum, using the sensing results. Many proposed SS techniques include those based on matched filter based sensing [19], energy detection [20], cyclostationary detection [21] [22], wavelet detection [5], covariance detection [23], among others. Energy detection The received signal energy is compared with a threshold, that depends only on the noise power. The test statistic of the detector is computed from the squared magnitude of the Fast Fourier Transform (FFT) averaged over Nsamples of the signal the SU received. Different energy detection methods have been proposed, of which includes a method based on adaptive threshold in unknown white Gaussian noise with noise power estimation [24], a double-threshold technique in [25] with the intention of finding and localizing narrowband signals, and a technique in [26] based on wideband spectrum sensing, where the signal strength levels are sensed within several frequency ranges to improve the opportunistic throughput of the SU and decrease the interference to the PU [10]. Some of the challenges with energy detector 2.3. Spectrum sensing 9 based sensing include selection of the threshold for detecting primary users, inability to differentiate interference from primary users and noise, and poor performance under low signal-to-noise ratio (SNR) values [27]. Wavelet detection Also known as edge detection, it is based on the continuous wavelet transform, which allows finding the signal decomposed coefficients with the help of a basis [28] [29]. The continuous wavelet transform of the received signal is computed to perform the power spectral density, where the local maximum of the power spectral density corresponds to the edge, which is then compared to a threshold to decide about the spectrum occupancy. Matched filter detection It is based on a coherent pilot sensor that maximizes the Signal-to-Noise Ratio (SNR) at the output of the detector. It is an optimal filter that requires the prior knowledge of the PU signals and it is the best choice when some information about the PU signal are available at the SU receiver [10] [19] [30]. 2.3.2 Machine learning applied to spectrum sensing A CR system must be able to perceive (perception), learn (learning), and reason (reasoning), where perception can be achieved through the sensing measurements of the spectrum that allows the cognitive radio to identify ongoing RF activities in its surrounding environment. The sensing observations/results acquired is used by the CR system to learn, where it tries to classify and organize the observations into suitable categories using learning algorithms. The knowledge acquired through learning is applied by the reasoning ability of the CR system to achieve its objectives. This process describes the so-called cognition cycle [14]. An illustration of the cycle is shown in Figure 2.5 [31]. FIGURE 2.5: Illustration of a cognition cycle of a CR. 16 Chapter 2. Concepts and previous works Long short-term memory networks (LSTMs) LSTMs are a type of RNNs that was introduced by Hochreiter and Schmidhuber [49], to solve the long-term dependency problem, where they remember information for long periods of time. LSTMs are capable of modelling longer term dependencies by having memory cells and gates that controls the information flow along with the memory cell. All recurrent neural networks have the form of a chain of repeating modules of neural network, and in standard RNNs, this repeating module will have a very simple structure, such as a single tanh layer, represented in Figure 2.13. FIGURE 2.13: Repeating module with a single layer in a standard RNN. In the case of the LSTM, the repeating module is made up of four neural network layers, as shown in Figure 2.14. FIGURE 2.14: Repeating module in an LSTM with four interacting layers. To better understand the figures, Figure 2.15 shows the meaning of the notations used on the figures, where each line carries an entire vector, from the output of one node to the inputs of others. The pink circles represent pointwise operations, like vector addition, while the yellow boxes are learned neural network layers. Lines merging denote concatenation, while a line forking denote its content being copied and the copies going to different locations. The horizontal line that runs through the top of the diagram is known as the cell state. This is shown in Figure 2.16. Gates, shown in Figure 2.17, are used to regulate the information that is added or removed from the cell gate. They are composed of a sigmoid neural net layer and a pointwise multiplication operation, where the sigmoid layer outputs numbers 2.4. Deep learning for time series forecasting 17 FIGURE 2.15: Notation meanings. FIGURE 2.16: Cell state. between zero and one, that describes how much of each component should be let through. A value of zero means nothing is let through while a value of one is the exact opposite. An LSTM has three of these gates that protect and control the cell state. FIGURE 2.17: Cell gate. Step-by-Step LSTM Walk Through • A decision is made by the a sigmoid layer called the "forget gate layer" on which information is kept or rejected, i.e, it determines how much contents from previous cell Ct−1will be erased. It looks at ht−1and xt, and outputs a number between 0 (completely eliminate) and 1 (completely keep) for each number in the cell state Ct−1. This is represented in Figure 2.18. • In the next step, represented in Figure 2.19, a decision is made on what information is to be stored in the cell state. In the first part of this process, a sigmoid layer called the "input gate layer", it, decides which values are to be updated. Next, a tanh layer creates a vector of new candidate values, ˜ Ct, as a function of ht−1and xt, that could be added to the state. • The old cell state Ct−1is updated, into the new cell state Ctby using the input and forget gates with new candidate cell states. The old state is multiplied by ft, to make it to forget information already chosen to be forgotten. The 18 Chapter 2. Concepts and previous works FIGURE 2.18: Forget gate. FIGURE 2.19: New candidate cell and input gate. new candidate values, it∗˜ Ctare added and scaled by how much is decided to update each state value. Figure 2.20 shows a representation of the update process. FIGURE 2.20: Update cell states. • Finally, a decision is made on the output, which will be based on the cell state, but will be a filtered version. The output gate ot(sigmoid layer)decides which part of cell state Ctwill be in the output. Then, we put the cell state through tanh (to push the values to be between −1 and 1) and multiply it by the output of the sigmoid gate, so as to filter the parts that were decided. This process is represented in Figure 2.21. Various variants of LSTMs have been developed, such as the peephole connections variant of Figure 2.22 that allows the gate layers to look at the cell state, another variation that uses coupled forget and input gates (as seen in Figure 2.23), or the Gated Recurrent Unit, or GRU (shown in Figure 2.24), introduced by [50], that combines the forget and input gates into a single "update gate" and also merges the cell state and hidden state. 2.4. Deep learning for time series forecasting 19 FIGURE 2.21: Output generation. FIGURE 2.22: Peephole connections LSTM variant. FIGURE 2.23: Tied forget and input gate LSTM variant. FIGURE 2.24: GRU LSTM variant. 21 Chapter 3 Methodology and Content Development This chapter deals with the obtention of training data for the different network models we will be evaluating, detailed explanation of the architecture/structure of the networks, and the scripts used in their implementation. The methodology implemented in this project is based on the described methodology for time series forecasting by J. Brownlee [51]. The design methodology is summarised as follows: 1. Split the dataset into a training and test subsets. 2. Build a network model. 3. Fit the network model on the training dataset. 4. Make predictions on the test set using walk-forward validation method. 5. Calculate and use the Root Mean-Square Error (RMSE) metric to compare the predictions to the expected values. 3.1 Software requirements The scripts used in this project are all written in Python and the simulations are run with the PyCharm Integrated Development Environment (IDE) (more information can be found in Appendix B). To be able to run the scripts some dependencies or libraries (packages) are required. The list of libraries that are needed for a correct execution of each script are listed at the start of each corresponding script. PyCharm provides a convenient and easy way to install/download each library/- package, and instructions on how to do so can be found at: https://www.jetbrain s.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html #interpreter-settings . 3.2 Dataset The dataset used for both training and evaluation of the network models is a univariate time series data that models the temporal evolution of the occupancy level of a communications channel. We implement a function, called generate_data_input(...) and provided in a script of the same name, that generates a sequence that represents this evolution. This script accepts four parameters that modifies the behaviour of the channel, and they are: 22 Chapter 3. Methodology and Content Development • multilevel_sequence = array with time slots that represents the temporal evolution of the occupancy level of a communications channel. The signal value in each of these time slots can be assigned intermediate occupation values using integers of any value and range to represent the multilevel nature of the sequence. • length_symbol = number of samples in each time slot. • length_transition = samples that correspond to the transition between adjacent slots. • noise_prop = noise level added to the sequence. For the present project, the values selected for these parameters are: • multilevel_sequence [2, 4, 4, 4, 0, 4, 1, 2, 0, 2, 4, 0, 4, 3, 0, 4, 4, 2, 0, 2, 2, 0, 0, 0, 4, 0, 4, 0, 4, 4, 0, 0, 4, 0, 0, 0, 4, 4, 0, 1, 3, 0, 4, 1, 2, 4, 4, 0, 0, 1, 0, 4, 4, 4, 4, 4, 0, 0, 2, 1, 1, 4, 0, 0, 4, 0, 0, 1, 1, 4, 0, 2, 3, 4, 4, 0, 0, 4, 1, 4, 4, 4, 4, 4, 1, 0, 4, 0, 3, 1, 1, 4, 0, 0, 3, 0, 1, 4, 2, 0, 0, 4, 2, 0, 2, 4, 0, 0, 4, 0, 4, 0, 0, 2, 4, 2, 0, 4, 0, 1, 2, 1, 1, 0, 0, 0, 0, 4, 4, 1, 4, 4, 4, 4, 4, 0, 4, 0, 1, 0, 4, 0, 0, 0, 4, 1, 1, 0, 2, 4, 0, 0, 4, 1, 0, 4, 0, 0, 0, 4, 0, 0, 3, 4, 3, 3, 0, 0, 0, 4, 4, 3, 0, 0, 1, 1, 3, 3, 4, 0, 3, 3, 4, 2, 1, 0, 2, 4, 2, 0, 4, 3, 3, 2, 0, 4, 3, 4, 4, 3] As seen above, the values that define the time slot go from the range of zero to four (both inclusive), representing a 5-level multilevel sequence. It should be noted that these values are later normalized within the range of 0 to 1, where 0 means that the communications channel is completely free during the corresponding time slot, and 1 means that it is saturated. • length_symbol = 100 • length_transition = 70 • noise_prop = 0.15 The plotted data is shown in Figure 3.1. 3.2.1 Dataset preparation for network models: Train and test data With the aim of forecasting multiple timesteps, the dataset is configured to meet such aim. Before that is done, we first split the dataset in two: training set, that will be used for training predictive network models, and test set, for evaluating the models. The value given to a modifiable parameter named train_percentage represents the percentage of the total dataset that is selected for training. With the two parameters n_input and n_output, we select the number of timesteps that are used as input data for the model and the number of timesteps that are to be predicted by the model, respectively. The n_output parameter is also used to divide the dataset into multiple samples of n_output-sized subsets. In this present project, train_percentage is set to 75, i.e, 75% of the total dataset is used to train the network models, and the rest, 25%, is used to evaluate the models. n_input and n_output are either set to 5, 6 or 10. This means that the data passed as input to the models and the forecasting/predictions will be done in multi-steps of size 5, 6 or 10. The split_dataset(..) method that implements the division of the 3.2. Dataset 23 Number of samples Normalized Power FIGURE 3.1: Plotted data. dataset into training and test sets, and also configures and organizes the dataset into subsets of size n_output is given below in Listing 1. # split a univariate dataset into train / test sets def split_dataset(data, train_percentage, n_output): # split data according to train and test percentages limit_train =int((train_percentage/100)*len(data)) train, test =data[0:limit_train], data[limit_train:len(data) + 1] # reshape data train =train.reshape(len(train), 1) test =test.reshape(len(test), 1) # restructure into windows of sequence data train =array(split(train, int(len(train)/n_output))) test =array(split(test, int(len(test)/n_output))) return train, test LISTING 1: Splitting dataset into training and test subsets. 3.2.2 Training data preparation We prepare the dataset obtained from the split of the previous section for a supervised learning model. This means that the training data needs to be divided into multiple samples that the network models learn from and generalize across. To 24 Chapter 3. Methodology and Content Development achieve this, the sliding window method is used to prepare the dataset for a supervised learning model, where the training data is divided into two components: input (X) and output component (Y). The input component denotes the number of prior observations, for example, the first 10 timesteps, while the output component represents the observations at the current timestep. For example, if the number of timesteps selected is 10, there would be 10 current observations. To understand the sliding window concept better, let us imagine we have a dataset as shown below in Table 3.1. TABLE 3.1: Time series dataset to explain sliding window concept. Time Measure 1 0.2 2 0.25 3 0.30 4 0.35 As we can see from the dataset, it is a time series dataset and when it is restructured as a supervised learning model by applying the sliding window concept, where the previous timestep observation is used to predict the next timestep observation, we have the following result seen in Table 3.2: TABLE 3.2: Sliding window concept implementation. X Y ? 0.2 0.2 0.25 0.25 0.30 0.30 0.35 0.35 ? In the present project, this is implemented with the to_supervised() method, which is shown below in Listing 2. 3.3. Neural networks implementation with Keras 25 # convert history into inputs and outputs def to_supervised(train, n_input, n_output): # flatten data data =train.reshape((train.shape[0]*train.shape[1], train.shape[2])) ,→ x, y =list(), list() in_start = 0 # step over the entire history one time step at a time for _in range(len(data)): # define the end of the input sequence in_end =in_start +n_input out_end =in_end +n_output # ensure we have enough data for this instance if out_end <len(data): x_input =data[in_start:in_end, 0] x_input =x_input.reshape((len(x_input), 1)) x.append(x_input) y.append(data[in_end:out_end, 0]) # move along one time step in_start += 1 return array(x), array(y) LISTING 2: Restructure training dataset into a supervised learning model using the sliding window concept. Train is the training dataset, and n_input and n_output both represent the number of inputs (current observations) and number of outputs (predicted observations), respectively. 3.3 Neural networks implementation with Keras As earlier mentioned, the main aim of this final project is to explore different architectures of ANNs which can be applied for time series forecasting problems and subsequently be used to predict the future evolution of the radioelectric spectrum for Cognitive-Radio applications. These ANN models include CNNs,LSTMs, or hybrid combinations of both CNNs and LSTMs. To achieve this aim of solving the problem of time-series prediction, five NN models are chosen to be studied, and whose performance will be compared, and they are: • 1D CNN model • Vanilla LSTM model • Encoder-decoder LSTM model • CNN-LSTM model • ConvLSTM model The neural networks under study and implemented in the project are all done in Keras. Keras is a deep learning (DL) Application Programming Interface (API) 32 Chapter 3. Methodology and Content Development FIGURE 3.4: Model plot of Encoder-decoder LSTM network. # define model model =Sequential() # define cnn input model model.add(Conv1D(filters=8, kernel_size=3, activation= ' relu ' , input_shape=(n_timesteps, n_features))) ,→ model.add(Conv1D(filters=8, kernel_size=3, activation= ' relu ' )) model.add(MaxPooling1D(pool_size=2)) model.add(Flatten()) # define decoder model model.add(RepeatVector(n_outputs)) model.add(LSTM(224, activation= ' tanh ' , return_sequences=True)) model.add(TimeDistributed(Dense(10, activation= ' tanh ' ))) model.add(TimeDistributed(Dense(1))) LISTING 8: CNN-LSTM model definition. An example of the plotted model with number of I/O equal to 10, number of filters for the convolution layers equal to 8, and the number of units for the LSTM layer is 32, is shown in Figure 3.5. 3.3. Neural networks implementation with Keras 33 FIGURE 3.5: Model plot of CNN-LSTM network. ConvLSTM The ConvLSTM2D class of the Keras library that supports the ConvLSTM model for 2D data is reconfigured and adapted to receive univariate 1D input data. The generated feature maps are flattened before they are repeated and decoded with a LSTM layer. A TimeDistributed wrapper is then used for both the dense interpretation layer and output layer. This is implemented in Listing 9: 34 Chapter 3. Methodology and Content Development # define model model =Sequential() # define convlstm encoder input model model.add(ConvLSTM2D(filters=8, kernel_size=(1,3), activation= ' relu ' , input_shape=(n_steps, 1, n_length, n_features))) ,→ model.add(Flatten()) model.add(RepeatVector(n_outputs)) model.add(LSTM(224, activation= ' tanh ' , return_sequences=True)) model.add(TimeDistributed(Dense(10, activation= ' tanh ' ))) model.add(TimeDistributed(Dense(1))) LISTING 9: ConvLSTM model definition. An example of the plotted model, with number of I/O equal to 10, is shown in Figure 3.6. In this example, the number of filters for the ConvLSTM2D layer is 8, and the number of units for the LSTM layer is 32. FIGURE 3.6: Model plot of ConvLSTM network. 3.3. Neural networks implementation with Keras 35 3.3.3 Network compilation Each network model is required to be compiled, i.e., configured, after being modelled, and this is done using the efficient Adam version of stochastic gradient descent and optimized using the mean squared error mse loss function. Adam optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments. Advantages of this method include being computationally efficient and requiring little memory, invariant to diagonal rescaling of gradients, and being well suited for large data/parameter problems [53]. The mse loss function is a regression loss function that computes the mean of squares of errors between target variables/labels and predictions. In Keras, this is defined as: loss =square(ytrue −ypred)(3.2) where ytrue is the true target value and ypred, the predicted value. Given that the result of the differences is squared, mse result is always positive regardless of the sign of the true and predicted values, but it also means that larger mistakes increase by a higher margin the error present than smaller mistakes. This ultimately results in network models being punished for making larger mistakes than smaller ones. A perfect prediction would give a result of 0. With Keras, the compilation is run with the following code line shown in Listing 10: model.compile(loss= ' mse ' , optimizer= ' adam ' ) LISTING 10: Compiling built network model. 3.3.4 Network training We will train the different networks for different number of filters and units, using the CPU first, and later, using the GPU. The specifications for the CPU are: • Intel(R) Core(TM) i7-9700F CPU @ 3.00GHz • RAM: 32 GB • Windows 10 Pro, 64-bits The specifications for the GPU are: • NVIDIA GeForce GTX 1650 SUPER • CUDA nucleus: 1280 • Available graphic memory: 20438 MB • Dedicated video memory: 4096 MB GDDR6 The code below, shown in Listing 11, implements the selection of either the CPU or the GPU, determined by the value the variable cpu_gpu_select is set to: 0 for the CPU and 1 for the GPU. 36 Chapter 3. Methodology and Content Development # select CPU (0) or GPU (1) cpu_gpu_select = 1 if cpu_gpu_select == 0: # Hide GPU from visible devices. That means only the CPU is available. ,→ tf.config.set_visible_devices([], ' GPU ' ) else: # select GPU os.environ["CUDA_VISIBLE_DEVICES"]="0" LISTING 11: Selection of the CPU or GPU for network training and prediction. 75% of the input data is used for training the network and the remaining 25% is used for prediction. The modelled NNs are trained by running the following line of code shown in Listing 12. model.fit(train_x, train_y, epochs=epochs, batch_size=batch_size, verbose=0) ,→ LISTING 12: Model fitting/training. The fit() method trains the model by slicing the data into "batches" of size batch_size and repeatedly iterating over the entire dataset for a fixed number of epochs, given by epochs. An epoch is given as one full training cycle or iterations on the entire training dataset. The network weights are updated after every time a slice of the data, of size batch_size, is used to train the model. For 1D CNN network, epochs and batch_size are set to 20, and 16, respectively. For the rest of the LSTM network models, their values are set to 50 (epoch) and 16 (batch_size). 3.4 Network model evaluation After the networks are fitted/trained, we can now use it to make predictions and the validation method used to evaluate the network models is the walk-forward validation. 3.4.1 Walk-forward validation With the walk-forward validation method of evaluating network models that respects the temporal ordering of observations [51], a given network model is provided the actual data (current timesteps) as the basis for making a prediction on future timesteps. For example, if a model is required to make a prediction of 10 future timesteps, then 10 timesteps data, representing the present time, are provided. For the next 10 future timesteps, the previous 10 current timesteps, in addition with the predicted 10 timesteps, are used to make the prediction. This example is represented in Table 3.3. 3.4. Network model evaluation 37 TABLE 3.3: Example of walk-forward validation concept. Input Predict [1-10] [11-20] [1-10] + [11-20] [21-30] [1-10] + [11-20] + [21-30] [31-40] ... ... 1D CNN This approach is implemented for a 1D CNN model, in Python, with the evaluate_model_cnn method described in the following code of Listing 13: def evaluate_model_cnn(train, test, n_input, n_output, folder_path, name_model): ,→ # fit model model =build_model(train, n_input, n_output, folder_path, name_model) ,→ # history is a list of "n_input-sized" samples history =[x for xin train] # walk - forward validation over each "n_input-sized" samples predictions =list() for iin range(len(test)): # predict the samples of size n_output yhat_sequence =forecast(model, history, n_input) # store the predictions predictions.append(yhat_sequence) # get real observation and add to history for predicting the next samples ,→ history.append(test[i, :]) # evaluate predictions of each sample predictions =array(predictions) score, scores =evaluate_forecasts(test[:, :, 0], predictions) # reshape the arrays into an easily readable format predictions =predictions.reshape((predictions.shape[0]* predictions.shape[1], test.shape[2])) ,→ original =test[:, :, 0] original =original.reshape((original.shape[0]*original.shape[1], test.shape[2])) ,→ return score, scores, original, predictions LISTING 13: Walk-forward validation for 1D CNN network model. The train and test datasets, shaped in samples of sizes n_output, are provided to the functions as arguments. An additional argument, n_input, is provided that is used to define the number of prior observations that the model will use as input in order to make a prediction. Within the method, two functions are called: 38 Chapter 3. Methodology and Content Development build_model(), that builds, compiles and trains the network model, and forecast(), that uses the model to make forecasts for each new timestep of size n_output. Previous timestep observations are stored in a list called history. LSTM models: Vanilla, Encoder-decoder, CNN-LSTM In the case of the LSTM models, the method used for the evaluation is described depending on the LSTM network model being evaluated. Vanilla LSTM, Encoderdecoder LSTM, and CNN-LSTM make use of the same method, evaluate_model_lstm, described below in Listing 14. 3.4. Network model evaluation 39 def evaluate_model_lstm(train, test, n_input, n_output, lstm_model, folder_path, name_model): ,→ if lstm_model == 1: # fit model model =build_model_vanilla(train, n_input, n_output, folder_path, name_model) ,→ elif lstm_model == 2: # fit model model =build_model_encoder_decoder(train, n_input, n_output, folder_path, name_model) ,→ elif lstm_model == 3: # fit model model =build_model_cnn_lstm(train, n_input, n_output, folder_path, name_model) ,→ # history is a list of "n_input-sized" samples history =[x for xin train] # walk - forward validation over each "n_input-sized" samples predictions =list() for iin range(len(test)): # predict the samples of size n_output yhat_sequence =forecast_lstm(model, history, n_input) # store the predictions predictions.append(yhat_sequence) # get real observation and add to history for predicting the next samples ,→ history.append(test[i, :]) # evaluate predictions of each sample predictions =array(predictions) score, scores =evaluate_forecasts(test[:, :, 0], predictions) # plot the original signal versus the predicted signal predictions =predictions.reshape((predictions.shape[0]* predictions.shape[1], test.shape[2])) ,→ original =test[:, :, 0] original =original.reshape((original.shape[0]*original.shape[1], test.shape[2])) ,→ return score, scores, original, predictions LISTING 14: Walk-forward validation for vanilla LSTM, encoderdecoder LSTM, and CNN-LSTM network models. ConvLSTM For ConvLSTM model, the method is described below in Listing 15. 40 Chapter 3. Methodology and Content Development def evaluate_model_conv_lstm(train, test, n_input, n_output, n_steps, n_length, folder_path, name_model): ,→ model =build_model_conv_lstm(train, n_input, n_output, n_steps, n_length, folder_path, name_model) ,→ # history is a list of "n_input-sized" samples history =[x for xin train] # walk - forward validation over each "n_input-sized" samples predictions =list() for iin range(len(test)): # predict the samples of size n_output yhat_sequence =forecast_conv_lstm(model, history, n_steps, n_length, n_input) ,→ # store the predictions predictions.append(yhat_sequence) # get real observation and add to history for predicting the next samples ,→ history.append(test[i, :]) # evaluate predictions of each sample predictions =array(predictions) score, scores =evaluate_forecasts(test[:, :, 0], predictions) # plot the original signal versus the predicted signal predictions =predictions.reshape((predictions.shape[0]* predictions.shape[1], test.shape[2])) ,→ original =test[:, :, 0] original =original.reshape((original.shape[0]*original.shape[1], test.shape[2])) ,→ return score, scores, original, predictions LISTING 15: Walk-forward validation for ConvLSTM network model. 3.4.2 Network forecasting Due to the slow nature of NNs when it comes to training, the preferred usage of the models is to build them once on historical data and to use them to forecast each step of the walk-forward validation. Though the training is generally slow, it should be noted that they are fast to evaluate. The network models are static (i.e. not updated) during their evaluation. The forecast() method for 1D CNN, Vanilla, Encoder-decoder, and CNN-LSTM takes as arguments the model fit on the training dataset (model), the history of data observed so far (history), and the number of inputs timesteps expected by the model (n_inputs). To be able to make predictions on the test data, the input data is organized into a 3D shape described as: [number of sample, n_output, number of features]. In our case, both the number of samples at a given time, and the number of features in our dataset is 1. So we will always have: [1, n_output, 1]. A prediction of the 3.4. Network model evaluation 41 future timesteps is made by using the fit model and the input data to call the predict() method. The implemented forecast() method for 1D CNN, Vanilla, Encoder-decoder, and CNN-LSTM models is shown below in Listing 16. def forecast(model, history, n_input): # flatten data data =array(history) data =data.reshape(data.shape[0]*data.shape[1], 1) # retrieve last observations for input data input_x =data[-n_input:, 0] # reshape into [1, n_input, 1] input_x =input_x.reshape((1,len(input_x), 1)) # forecast the next sample yhat =model.predict(input_x, verbose=0) # only the forecast vector is needed yhat =yhat[0] return yhat LISTING 16: Function for making a multi-step forecast with 1D CNN, Vanilla, Encoder-decoder, and CNN-LSTM network models. In the case of ConvLSTM, this method, in addition to the three previous arguments, receives two more arguments: n_steps, that describes the number of subsequences, and n_length, that describes the length of each subsequence. This implementation is shown below in Listing 17. def forecast_conv_lstm(model, history, n_steps, n_length, n_input): # flatten data data =array(history) data =data.reshape((data.shape[0]*data.shape[1], data.shape[2])) # retrieve last observations for input data input_x =data[-n_input:, 0] # reshape into [samples, timesteps, rows, cols, channels] input_x =input_x.reshape((1, n_steps, 1, n_length, 1)) # forecast the next sample yhat =model.predict(input_x, verbose=0) # only the forecast vector is needed yhat =yhat[0] return yhat LISTING 17: Function for making a multi-step forecast with a ConvLSTM network model. 3.4.3 Forecast evaluation The n_output-sized timesteps sample of the forecast are evaluated individually. This evaluation comprises of comparing the real timesteps with the predicted timesteps and getting the error between the two. Different methods exist to achieve this, with the two most common being Mean Absolute Error (MAE) and RMSE. We make use 48 Chapter 4. Results and conclusions Number of samples Normalized Power FIGURE 4.4: Prediction for channel 3. Number of samples Normalized Power FIGURE 4.5: Prediction for channel 4. Other applications • Build the AI module to control the operation of a RF digitizer based on a BPΣ∆M. 4.2. Conclusions 49 Number of samples FIGURE 4.6: Evolution of channel occupancy and selection.. 51 Appendix A Prediction results of the different network models A.1 Training on CPU for I/O = 10 A.1.1 1D CNN The plotted prediction results of the 1D CNN model trained on the CPU in comparison with the original dataset, are shown in Figure A.1,Figure A.2, and Figure A.3. Number of samples Normalized Power FIGURE A.1: Model of the channel occupancy and prediction of 1D CNN model for filter size of 8. A.1.2 Vanilla LSTM The plotted prediction results of the vanilla LSTM model trained on the CPU in comparison with the original dataset, are shown in Figure A.4,Figure A.5, and Figure A.6. 52 Appendix A. Prediction results of the different network models Number of samples Normalized Power FIGURE A.2: Model of the channel occupancy and prediction of 1D CNN model for filter size of 16. A.1.3 Encoder-decoder LSTM The plotted prediction results of the encoder-decoder LSTM model trained on the CPU in comparison with the original dataset, are shown in Figure A.7,Figure A.8, and Figure A.9. A.1.4 CNN-LSTM The plotted prediction results of the CNN-LSTM model trained on the CPU in comparison with the original dataset, are shown in Figure A.10,Figure A.11, and Figure A.12. A.1.5 ConvLSTM The plotted prediction results of the ConvLSTM model trained on the CPU in comparison with the original dataset, are shown in Figure A.13,Figure A.14, and Figure A.15. A.1. Training on CPU for I/O = 10 53 Number of samples Normalized Power FIGURE A.3: Model of the channel occupancy and prediction of 1D CNN model for filter size of 24. Number of samples Normalized Power FIGURE A.4: Model of the channel occupancy and prediction of vanilla LSTM model for filter size of 32. 54 Appendix A. Prediction results of the different network models Number of samples Normalized Power FIGURE A.5: Model of the channel occupancy and prediction of vanilla LSTM model for filter size of 160. Number of samples Normalized Power FIGURE A.6: Model of the channel occupancy and prediction of vanilla LSTM model for filter size of 224. A.1. Training on CPU for I/O = 10 55 Number of samples Normalized Power FIGURE A.7: Model of the channel occupancy and prediction of encoder-decoder LSTM model for filter size of 32. Number of samples Normalized Power FIGURE A.8: Model of the channel occupancy and prediction of encoder-decoder LSTM model for filter size of 160. 56 Appendix A. Prediction results of the different network models Number of samples Normalized Power FIGURE A.9: Model of the channel occupancy and prediction of encoder-decoder LSTM model for filter size of 224. Number of samples Normalized Power FIGURE A.10: Model of the channel occupancy and prediction of CNN-LSTM model for filter size of 32. A.1. Training on CPU for I/O = 10 57 Number of samples Normalized Power FIGURE A.11: Model of the channel occupancy and prediction of CNN-LSTM model for filter size of 160. Number of samples Normalized Power FIGURE A.12: Model of the channel occupancy and prediction of CNN-LSTM model for filter size of 224. 64 Bibliography [15] A. Morgado, R. Del Río, and J. De la Rosa, Nanometer CMOS Sigma-Delta Modulators for Software Defined Radio. Jan. 2012, pp. 1–288, ISBN: 978-1-4614-0036-3. DOI: 10.1007/978-1-4614-0037-0 . [16] J. Mitola, “Cognitive radio an integrated agent architecture for software defined radio,” 2000. [17] X. Zhang, X. Liu, H. Samani, and B. Jalaian, “Cooperative spectrum sensing in cognitive wireless sensor networks,” International Journal of Distributed Sensor Networks, vol. 11, no. 8, p. 170695, 2015. DOI: 10.1155/2015/170695 . eprint: https://doi.org/10.1155/2015/170695 . [Online]. Available: https://doi.o rg/10.1155/2015/170695 . [18] G. Ganesan and G. Y. Li, “Cooperative spectrum sensing in cognitive radio, part i: Two user networks,” IEEE Transactions on Wireless Communications, vol. 6, pp. 2204–2213, 2007. [19] M. Riahi Manesh, S. Subramaniam, H. Reyes, and N. Kaabouch, “Real-time spectrum occupancy monitoring using a probabilistic model,” Computer Networks, vol. 124, pp. 87–96, 2017, ISSN: 1389-1286. DOI: https://doi.org/10.10 16/j.comnet.2017.06.003 . [Online]. Available: https://www.sciencedirect .com/science/article/pii/S1389128617302463 . [20] M. R. Manesh, M. Apu, N. Kaabouch, and W.-C. Hu, “Performance evaluation of spectrum sensing techniques for cognitive radio systems,” Oct. 2016, pp. 1– 7. DOI: 10.1109/UEMCON.2016.7777829 . [21] B. deepa, A. Iyer, and C. Murthy, “Cyclostationary-based architectures for spectrum sensing in ieee 802.22 wran,” Jan. 2011, pp. 1 –5. DOI: 10.1109/G LOCOM.2010.5683492 . [22] A. Dandawate and G. Giannakis, “Statistical tests for presence of cyclostationarity,” IEEE Transactions on Signal Processing, vol. 42, no. 9, pp. 2355–2369, 1994. DOI: 10.1109/78.317857 . [23] M. Jin, Y. Li, and H.-G. Ryu, “On the performance of covariance based spectrum sensing for cognitive radio,” IEEE Transactions on Signal Processing - TSP, vol. 60, pp. 3670–3682, Jul. 2012. DOI: 10.1109/TSP.2012.2194708 . [24] S. Gong, P. Wang, and W. Liu, Spectrum sensing under distribution uncertainty in cognitive radio networks, Undetermined. DOI: 10.1109/ICC.2012.6363671 . [25] Z. Bao, B. Wu, P.-H. Ho, and X. Ling, “Adaptive threshold control for energy detection based spectrum sensing in cognitive radio networks,” in 2011 IEEE Global Telecommunications Conference - GLOBECOM 2011, 2011, pp. 1–5. DOI: 10.1109/GLOCOM.2011.6133659 . [26] C. H. Lim, “Adaptive energy detection for spectrum sensing in unknown white gaussian noise,” IET Commun., vol. 6, pp. 1884–1889, 2012. [27] H. Tang, “Some physical layer issues of wide-band cognitive radio,” Dec. 2005, pp. 151 –159, ISBN: 1-4244-0013-9. DOI: 10.1109/DYSPAN.2005.1542630 . [28] Z. Quan, S. Cui, A. Sayed, and H. V. Poor, “Wideband spectrum sensing in cognitive radio networks,” May 2008, pp. 901–906. DOI: 10.1109/ICC.2008.1 77 . [29] E. Abdessamad, R. Saadane, M. El Aroussi, M. Wahbi, and A. Hamdoun, “Spectrum sensing with an improved energy detection,” in 2014 International Conference on Multimedia Computing and Systems (ICMCS), 2014, pp. 895–900. DOI: 10.1109/ICMCS.2014.6911386 . Bibliography 65 [30] P. Avinash, R. Gandhiraj, and K. P. Soman, “Spectrum sensing using compressed sensing techniques for sparse multiband signals,” International journal of scientific and engineering research, vol. 3, 2012. [31] M. Bkassiny, Y. Li, and S. K. Jayaweera, “A survey on machine-learning techniques in cognitive radios,” IEEE Communications Surveys & Tutorials, vol. 15, pp. 1136–1159, 2013. [32] Z. Han, R. Zheng, and H. Poor, “Repeated auctions with bayesian nonparametric learning for spectrum access in cognitive radio networks,” English, IEEE Transactions on Wireless Communications, vol. 10, no. 3, pp. 890–900, Mar. 2011, Funding Information: The authors would like to thank Mr. Quanyan Zhu of the Department of Electrical and Computer Engineering and the Coordinated Science Laboratory at the University of Illinois at Urbana-Champaign, and Mr. Amir Danak of the Department of Electrical and Computer Engineering, McGill University, Canada, for their constructive comments. This research was supported in part by the Air Force Office of Scientific Research under Grant FA 9550-08-1-0480, by the the National Science Foundation under Grants CNS-0832084, CNS-0953377, CNS-0905556, CNS-0910461, CNS-0546391, CNS-0832089, CNS-0832084, CNS-0905398, and ECCS-1028782, and by the Qatar National Research Fund under Grant NPRP 08-522-2-211., ISSN: 1536-1276. DOI: 10.1109/TWC.2011.010411.100838 . [33] N. Shetty, S. Pollin, and P. Pawelczak, “Identifying spectrum usage by unknown systems using experiments in machine learning,” May 2009, pp. 1 –6. DOI: 10.1109/WCNC.2009.4917741 . [34] D. Fudenberg and J. Tirole, Game Theory, ser. Mit Press. MIT Press, 1991, ISBN: 9780262061414. [Online]. Available: https://books.google.es/books?id=p FPHKwXro3QC . [35] N. Baldo and M. Zorzi, “Learning and adaptation in cognitive radios using neural networks,” 2008 5th IEEE Consumer Communications and Networking Conference, pp. 998–1003, 2008. [36] N. Baldo, T. B. Reddy, B. S. Manoj, R. R. Rao, and M. Zorzi, “A neural network based cognitive controller for dynamic channel selection,” 2009 IEEE International Conference on Communications, pp. 1–5, 2009. [37] Y. Tang, Q. Zhang, and W. Lin, “Artificial neural network based spectrum sensing method for cognitive radio,” 2010 6th International Conference on Wireless Communications Networking and Mobile Computing (WiCOM), pp. 1–4, 2010. [38] V. Vapnik, The Nature of Statistical Learning Theory, ser. Information Science and Statistics. Springer New York, 1999, ISBN: 9780387987804. [Online]. Available: https://books.google.es/books?id=sna9BaxVbj8C . [39] Z. Yang, Y. dong Yao, S. Chen, H. He, and D. Zheng, “Mac protocol classification in a cognitive radio network,” The 19th Annual Wireless and Optical Communications Conference (WOCC 2010), pp. 1–5, 2010. [40] G. Tunnicliffe Wilson, “Time series analysis: Forecasting and control,5th edition, by george e. p. box, gwilym m. jenkins, gregory c. reinsel and greta m. ljung, 2015. published by john wiley and sons inc., hoboken, new jersey, pp. 712. isbn: 978-1-118-67502-1,” Journal of Time Series Analysis, vol. 37, n/a–n/a, Mar. 2016. DOI: 10.1111/jtsa.12194 . 66 Bibliography [41] K. Fukushima and S. Miyake, “Neocognitron: A new algorithm for pattern recognition tolerant of deformations and shifts in position,” Pattern Recognition, vol. 15, no. 6, pp. 455–469, 1982, ISSN: 0031-3203. DOI: https://doi.org /10.1016/0031-3203(82)90024-3 . [Online]. Available: https://www.science direct.com/science/article/pii/0031320382900243 . [42] S. Kiranyaz, O. Avci, O. Abdeljaber, T. Ince, M. Gabbouj, and D. J. Inman, “1d convolutional neural networks and applications: A survey,” Mechanical Systems and Signal Processing, vol. 151, p. 107398, 2021, ISSN: 0888-3270. DOI: http s://doi.org/10.1016/j.ymssp.2020.107398 . [Online]. Available: https://w ww.sciencedirect.com/science/article/pii/S0888327020307846 . [43] Y. Lecun, B. Boser, J. Denker, et al., “Handwritten digit recognition with a back-propagation network,” English (US), in Advances in Neural Information Processing Systems (NIPS 1989), Denver, CO, D. Touretzky, Ed., vol. 2, Morgan Kaufmann, 1990. [44] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” Communications of the ACM, vol. 60, pp. 84 –90, 2012. [45] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: A simple way to prevent neural networks from overfitting,” J. Mach. Learn. Res., vol. 15, no. 1, 1929–1958, Jan. 2014, ISSN: 1532-4435. [46] C. Szegedy, W. Liu, Y. Jia, et al., “Going deeper with convolutions,” in 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 1– 9. DOI: 10.1109/CVPR.2015.7298594 . [47] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278– 2324, 1998. DOI: 10.1109/5.726791 . [48] C. Olah. “Understanding lstm networks.” (Aug. 2015), [Online]. Available: ht tps://colah.github.io/posts/2015-08-Understanding-LSTMs/ . [49] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, pp. 1735–80, Dec. 1997. DOI: 10.1162/neco.1997.9.8.1735 . [50] K. Cho, B. van Merrienboer, Ç. Gülçehre, F. Bougares, H. Schwenk, and Y. Bengio, “Learning phrase representations using RNN encoder-decoder for statistical machine translation,” CoRR, vol. abs/1406.1078, 2014. arXiv: 1406.1078 . [Online]. Available: http://arxiv.org/abs/1406.1078 . [51] J. Brownlee, Deep Learning for Time Series Forecasting: Predict the Future with MLPs, CNNs and LSTMs in Python. Machine Learning Mastery, 2018. [Online]. Available: https://books.google.es/books?id=o5qnDwAAQBAJ . [52] Keras, Keras API Reference. (2021), [Online]. Available: https://keras.io/api / . [53] D. P. Kingma and J. Ba, Adam: A method for stochastic optimization, 2017. arXiv: 1412.6980 [cs.LG] .