Prior work [2, 3] has shown that dynamic spectrum access is one of the keys to improving the spectrum utilization in wireless networks and meeting the increasing need for more capacity, particularly in the presence of other networks operating in the same spectrum. In the context of cognitive radio research, a standard assumption has been that secondary users may search and use idle channels that are not being used by their primary users (PU). Although there are many existing works that focus on the algorithm design and implementation in this field, nearly all of them assume a simple independent-channel (or PU activity) model, that may not hold in practice. For instance, the operation of a low power wireless sensor network (WSN) is based on IEEE 802.15.4-radios, which uses the globally available 2.4 GHz and 868/900 MHz bands. These bands are shared by various wireless technologies (e.g. Wi-Fi, Bluetooth, RFID), as well as industrial/scientific equipment and appliances (e.g. micro-wave ovens) whose activities can affect multiple IEEE 802.15.4 channels. Thus, external interference can cause the channels in WSNs to be highly correlated, and the design of new algorithms and schemes in dynamic multichannel access is required to tackle this challenge.
Motivated by such practical considerations, we consider in this work a multichannel access problem with correlated channels. Each channel has two possible states: good or bad
, and their joint distribution follow a-states Markovian model. There is a single user (wireless node) that selects one channel at each time slot to transmit a packet. If the selected channel is in the good state, the transmission is successful; otherwise, there is a transmission failure. The goal is to obtain as many successful transmissions as possible over time. As the user is only able to sense his selected channel at each time slot, there is no full observation of the system available. In general, the problem can be formulated as a partially observable Markov decision process (POMDP), which is PSPACE-hard and finding the exact solution requires an exponential computation complexity . Even worse, the parameters of the joint Markovian model might not be known a-priori, which makes it more difficult to find a good solution.
We investigate the use of Deep Reinforcement Learning, in particular, Deep Q learning, from the field of machine learning as a way to enable learning in an unknown environment as well as overcome the prohibitive computational requirements. By integrating deep learning with Q learning, Deep Q learning or Deep Q Network (DQN)
can use a deep neural network with states as input and estimated Q values as output to efficiently learn policies for high-dimensional, large state-space problems. We implement a DQN that can find a channel access policy through online learning. This DQN approach is able to deal with large systems, and find a good or even optimal policy directly from historical observations without any requirement to know the system dynamicsa-priori. We provide a study of the optimal policy for known fixed-pattern channel switching situation and conduct various experiments showing that DQN can achieve the same optimal performance. We then study the performance of DQN in more complex scenarios and show through both simulations and real data trace that DQN is able to find superior, near-optimal policies. In addition, we also design an adaptive DQN framework that is able to adapt to time-varying, dynamic environments, and validate through simulations that the proposed approach can be aware of the environment change and re-learn the optimal policy for the new environment.
The rest of the paper is organized as follows. In section II, we discuss related work in the Dynamic Multichannel Access field. In section III, we formulate the dynamic multichannel access problem when channels are potentially correlated. In section IV, a Myopic and a Whittle Index-based heuristic policies are presented for independent channels. In section V, we present the DQN framework to solve the problem through online learning. We present the optimal policy study on the known fixed-pattern channel switching situation in section VI, and show through simulations that DQN can achieve the same optimal performance in section VII. We present the experiment and evaluation results of DQN in more complex situations through both simulations and real-data trace in section VIII. We propose an adaptive DQN approach in section IX and conclude our work in section X.
Ii Related Work
The dynamic multichannel access problem has been widely studied. But unlike many decision making problems, such as vertical handoff in heterogeneous networks  and power allocation in energy harvesting communication systems 
, that can be modeled as MDP, dynamic multichannel problem is modeled as a POMDP, as channels are generally modeled as (two-state) Markov chains and a user has only partial observations of the system. And finding an optimal channel access policy has exponential time and space complexities. To overcome the prohibitive computation complexity, a Myopic policy and its performance are first studied in
when channels are independent and identically distributed (i.i.d.). The Myopic policy is shown to have a simple and robust round robin structure without the necessity to know the system transition probabilities except whether it is positively or negatively correlated. It is first proved in that the Myopic policy is optimal when there are only two positively correlated channels in the system. Later in the subsequent work , its optimality result is extended to any number of positively correlated channels and two or three negatively correlated channels. However, the Myopic policy does not have any performance guarantee when channels are correlated or follow different distributions, which is the situation considered in our work.
When channels are independent but may follow different Markov chains, the dynamic multichannel access problem can also be modeled as Restless Multi-armed bandit problem (RMAB). Each channel can be considered as an arm, and its state evolves following a Markov chain. At each time slot, a user chooses an arm with a state-dependent reward. The goal is to maximize the total expected reward over time. A Whittle Index policy is introduced in  and shares the same simple semi-universal structure and optimality result as the Myopic policy when channels are stochastically identical. Numerical results are also provided showing that the Whittle Index policy can achieve near-optimal performance when channels are nonidentical. But the Whittle Index approach cannot be applied when channels are correlated. In this work, we plan to study the multichannel access problem in the complicated correlated case.
Both the Myopic policy and the Whittle Index policy are derived under the assumption that the system transition matrix is known. When the underlying system statistics are unknown, the user must apply an online learning policy with time spent on exploration to learn the system dynamics (either explicitly or implicitly). When channels are independent, the RMAB approach can be applied and the corresponding asymptotic performance is compared with the performance achieved by a genie that has the full knowledge of the system statistics.The commonly used performance metric is called regret, which is defined as the expected reward difference between a genie and a given policy. A sublinear regret is desirable as it indicates the policy achieves the same optimal performance as the genie asymptotically. A logarithmic regret bound that grows as a logarithmic function of time is achieved in [11, 12, 13] when a weak regret111As stated in , “The genie being compared with is weaker in the sense that it is aware only of the steady-state distribution for each channel, and not the full transition matrices” is considered, and a regret bound and a regret bound with respect to strict regret222As stated in , “Comparing the performance of a policy to the genie that knows the probability transition matrices for each channel and can thus perform optimally” is achieved in  and  respectively. However, all these prior RMAB works are based on the independent channel assumption, which cannot be generalized for correlated channels.
In recent years, some works began to focus on the more practical and complex problem where both the system statistics is unknown and the channels are correlated. Q-learning, one of the most popular reinforcement learning approaches, is widely used as it is a model-free method that can learn the policy directly. The authors in  apply Q-learning to design channel sensing sequences, while in  it is shown that Q-learning can also take care of imperfect sensing. Additionally, the work  uses universal software radio peripheral (USRP) and GNU radio units to implement and evaluate Q-learning in a multi-hop cognitive radio network testbed. However, all these works assume that the system state is fully observable and formulate the problem as an MDP, which significantly reduces the state space so that Q-learning can be easily implemented by using a look-up table to store/update Q-values. Since a user is only able to observe the state of the chosen channel at each time slot in our work, the current state of the system is not fully observable and our problem falls into the framework of POMDP. When updating Q-values, the original state space cannot be directly used because of its partial observability. Instead, one could consider using either the belief or a number of historical partial observations. This can lead to a very large state space, which makes it impossible to maintain a look-up Q table. New methods able to find approximations of Q-values are required to solve the large space challenge.
In recent years, Reinforcement learning, including Q learning, has been integrated with advanced machine learning techniques, particularly deep learning, to tackle difficult high-dimensional problems [19, 20, 21]. In 2013, Google Deepmind used a deep neural network, called DQN, to approximate the Q values in Q learning that overcomes the limitation of the state space of the traditional look-up table approach. In addition, this deep neural network method also provides an end-to-end approach that an agent can learn a policy directly from his observations. In this work, we formulate the dynamic multi-channel access problem as a POMDP and employ DQN to solve this problem. To the best of our knowledge, this is the first study and implementation of DQN in the field of dynamic multi-channel access.
Iii Problem Formulation
Consider a dynamic multichannel access problem where there is a single user dynamically choosing one out of channels to transmit packets. Each channel can be in one of two states: good () or bad (). Since channels may be correlated, the whole system can be described as a -state Markov chain. At the beginning of each time slot, a user selects one channel to sense and transmit a packet. If the channel quality is good, the transmission succeeds and the user receives a positive reward (). Otherwise, the transmission fails and the user receives a negative reward (). The objective is to design a policy that maximizes the expected long-term reward.
Let the state space of the Markov chain be . Each state () is a length-vector , where is the binary representation of the state of channel : good () or bad (). The transition matrix of the Markov chain is denoted as . Since the user can only sense one channel and observe its state at the beginning of each time slot, the full state of the system, i.e., the states of all channels, is not observable. However, the user can infer the system state according to his sensing decisions and observations. Thus, the dynamic multichannel access problem falls into the general framework of POMDP. Let represent the belief vector maintained by the user, where is the conditional probability that the system is in state given all previous decisions and observations. Given the sensing action representing which channel to sense at the beginning of time slot , the user can observe the state of channel , denoted as . Then, based on this observation, he can update the belief vector at time slot , denoted as . The belief of each possible state is updated as follows:
where is the indicator function.
Combining the newly updated belief vector for time slot with the system transition matrix , the belief vector for time slot can be updated as:
A sensing policy is a function that maps the belief vector to a sensing action at each time slot . Given a policy , the long-term reward considered in this paper is the expected accumulated discounted reward over infinite time horizon, defined as:
where is a discounted factor, is the action (i.e., which channel to sense) at time when the current belief vector is , and is the corresponding reward.
If no information about the initial distribution of the system state is available, one can assume the initial belief vector to be the stationary distribution of the system. Our objective is to find a sensing policy that maximizes the expected accumulated discounted reward over infinite time
As the dynamic multichannel access problem is a POMDP, the optimal sensing policy can be found by considering its belief space and solving an augmented MDP instead. Let represent the belief space, and let be the maximum expected accumulated discounted reward from the optimal policy with initial belief as . Then for all belief , we have the following Bellman optimality equation
where the is the updated belief at given the action and observation as in Eq. (2).
In theory, the value function together with the optimal policy can be found via value iteration approach. However, since there are multiple channels and they might be correlated, the belief space becomes a high-dimensional space. For instance, in a typical multichannel WSN based on the widely used IEEE 802.15.4-2015 standard , nodes have to choose one out of available channels to sense at each time slot. If we consider the potential correlations among channels and simplify each channel’s condition to be in only two states: good or bad, the state space size becomes
. As the belief represents a probability distribution function over all possible states, it also becomes high dimensional, which increases computation cost.
Even worse, the infinite size of the continuous belief space and the impact of the current action on the future reward makes POMDP PSPACE-hard, which is even less likely to be solved in polynomial time than NP-hard problems . To exemplify the time complexity of solving such POMDP problem, we simulate the multichannel access problem with known system dynamics and use a POMDP solver called SolvePOMDP  to find its optimal solution. In Figure 1, we show the run-time as we increase the number of channels in the system. When the number of channels is higher than , the POMDP solver can not converge after a long interval, and it gets terminated when the run-time exceeds the time limit.
Iv Myopic Policy and Whittle Index
In the domain of dynamic multichannel access, there are many existing works on finding the optimal/near-optimal policy with low computation cost when the channels are independent and system statistics () is known. The Myopic policy and the Whittle Index policy are two effective and easy-to-implement approaches for this settings.
Iv-a Myopic Policy
A Myopic policy only focuses on the immediate reward obtained from an action and ignores its effects in the future. Thus the user always tries to select a channel which gives the maximized expected immediate reward
The Myopic policy is not optimal in general. Researchers in ,  have studied its optimality when channels are independent and statistically identical Gilbert-Elliot channels that follow the same -state Markov chain with the transition matrix as , as illustrated in Fig. 2. It is shown that the Myopic policy is optimal for any number of channels when the channel state transitions are positively correlated, i.e., . The same optimal result still holds for two or three channels when channel state transitions are negatively correlated, i.e., . In addition, the Myopic policy has a simple robust structure that follows a round-robin channel selection procedure.
Iv-B Whittle Index Based Heuristic Policy
When channels are independent, the dynamic multichannel access problem can also be considered as a restless multi-armed bandit problem (RMAB) if each channel is treated as an arm. An index policy assigns a value to each arm based on its current state and chooses the arm with the highest index at each time slot. Similarly, the index policy does not have optimality guarantee in general.
In , the Whittle Index is introduced in the case when is known and all channels are independent but may follow different -state Markov chain models. In this case, the Whittle Index policy can be represented as a closed-form solution, and it has the same optimal result as the Myopic policy: the Whittle Index policy is optimal for any number of channels when channels are identical and positively correlated, or for two or three channels when channels are negatively correlated. In addition, when channels follow identical distributions, the Whittle Index policy has the same round-robin structure as the Myopic policy.
When channels are correlated, the Whittle Index cannot be defined and thus the Whittle Index policy cannot be directly applied to our problem. To leverage its simplicity, we propose an heuristic that ignores the correlations among channels and uses the joint transition matrix and Bayes’ Rule to compute the -state Markov chain for each individual channel. Assume that for channel , the transition matrix is represented as , where (bad or good). Then, based on Bayes’ Rule we have,
where is the stationary distribution and is the transition probability from state to state defined in . After each channel model is found, we can apply the Whittle Index policy.
The Myopic policy and the Whittle Index policy are easy to implement in practice, as both of them have polynomial run-time. And in the case of independent channels, the Myopic and the Whittle Index policies can achieve optimality under certain conditions. However, so far to the best of our knowledge there are no easy-to-implement policies applicable to the general case where channels are correlated. Moreover, both policies require the prior knowledge of the system’s transition matrix, which is hard to obtain beforehand in practice. Thus, we need to come up with a new approach that copes with these challenges.
V Deep Reinforcement Learning Framework
When channels are correlated and system dynamics are unknown, there are two main approaches to tackle the dynamic multichannel access problem: (i) Model-based approach: first estimating the system model from observations and then either solve it by following the dynamic programming method in Section III or apply some computationally efficient heuristic algorithm such as the Myopic policy and the Whittle Index policy (which have polynomial run-time); (ii) Model-free approach: learn the policy directly through interactions with the system without estimate the system model. The model-based approach is less favored since the user can only observe one channel at a time slot and the limited observation capability may result in a bad system model estimation. Even worse, even if the system dynamics is well estimated, solving a POMDP in a large state space is always a bottleneck as the dynamic programming method has exponential time complexity (as explained in Section III) and the heuristic approaches do not have any performance guarantee in general. All these challenges motivate us to follow the model-free approach, which, by incorporating the idea of Reinforcement Learning, can learn directly from observations without the necessity of finding an estimated system model and can be easily extended to very large and complicated systems.
We focus on Reinforcement Learning paradigm, Q-learning  specifically, to incorporate learning in the solution for the dynamic multichannel access problem. The goal of Q-learning is to find an optimal policy, i.e., a sequence of actions that maximizes the long-term expected accumulated discounted reward. Q-learning is a value iteration approach and the essence is to find the Q-value of each state and action pairs, where the state is a function of observations (and rewards) and the action is some action that a user can take given the state . The Q-value of a state-action pair from policy , denoted as , is defined as the sum of the discounted reward received when taking action in the initial state and then following the policy thereafter. is the Q-value with initial state and initial action , and then following the optimal policy . Thus, the optimal policy can be derived as
One can use online learning method to find without any knowledge of the system dynamics. Assume at the beginning of each time slot, the agent takes an action that maximizes its Q-value of state-action pair given the state is , and gains a reward . Then the online update rule of Q-values with learning rate is given as follows:
It has been shown that in the MDP case, if each action is executed in each state an infinite number of times on an infinite run and the learning rate decays appropriately, the Q-value of each state and action pair will converge with probability 1 to the optimal , and thus the optimal policy can be found .
In the context of the dynamic multichannel access, the problem can be converted to an MDP when considering the belief space, and Q-learning can be applied consequently. However, this approach is impractical since the belief update is maintained by knowing the system transition matrix a-priori, which is hardly available in practice. Instead, we apply Q-learning by directly considering the history of observations and actions. We define the state for the Q-learning at time slot as a combination of historical selected channels as well as their observed channel conditions over previous time slots, i.e., . Then we can execute the online learning following Eq. (9) to find the sensing policy. Intuitively, the more historical information we consider (i.e., the larger is), the better Q-learning can learn.
V-B Deep Q-Network
Q-learning works well when the problem’s state-action spaces are small, as a look-up table can be used to execute the update rule in Eq. (9). But this is impossible when the state-action space becomes very large. Even worse, since many states are rarely visited, their corresponding Q-values are seldom updated. This causes Q learning takes a very long time to converge.
In this work, the state space size of Q-learning is , which grows exponentially with . This is because the state of Q-learning is defined as a combination of observations and actions over past time slots. In a single time slot, the number of possible observations is , as the user can only sense one out of channels and each channel has possible states. We do not consider the size of action space as action information is implicitly included in the observation. Thus, the state size of Q-learning is the number of all possible combinations of observations over previous time slots, which is . As we mentioned before, the number of previous time slots is also required to be large so that Q-learning can capture enough system information and learn better. This can cause the state space of Q-learning become very large, which prohibits using a traditional look-up table approach.
Researchers have proposed both linear and non-linear Q-value approximations to overcome the state space size limit. In 2013, DeepMind developed a Deep Q-Network (DQN), which makes use of a deep neural network to approximate the Q-values, and it achieves human-level control in the challenging domain of classic Atari 2600 games .
A neural network is a biologically-inspired programming paradigm organized in layers. Each layer is made up of a number of nodes known as neurons, each of which executes an ‘activation function’. Each neuron takes the weighted linear combination of the outputs from neurons in the previous layer as input and outputs the result from its nonlinear activation function to the next layer. The networked-neuron architecture enables the neural network to be capable of approximating nonlinear functions of the observational data. A deep neural network is a neural network that can be considered as a deep graph with many processing layers. A deep neural network is able to learn from low-level observed multi-dimensional data and find its success in areas such as computer vision and natural language processing[26, 27].
DQN combines Q-learning with deep learning, and the Q-function is approximated by a deep neural network called Q-network that takes the state-action pair as input and outputs the corresponding Q-value. Q-network updates its weights at each iteration
to minimize the loss function, where is derived from the same Q-network with old weights and new state after taking action from state .
Since we directly use the previous historical observations and actions as the state for the Q-learning, the state space becomes exponentially large as we increase the considered historical information, and a traditional look-up table approach to maintain Q values does not work well. Therefore, a DQN implementation is needed to help to find a tractable policy implementation in the dynamic multichannel access problem.
Vi Optimal Policy for Known Fixed-Pattern Channel Switching
To study the performance of DQN, we first consider a situation when all the channels in the system can be divided into several independent subsets and these subsets take turns to be activated following a fixed pattern. We assume at each time slot, only a single subset is activated such that all channels in the activated subset are good and all channels in inactivated subsets are bad. At each time slot, with probability () the next following subset is activated, and with probability the current subset remains activated. We assume the activation order of the subsets is fixed and will not change over time.
In this section, we assume that the subset activation order, the activation switching probability as well as the initially activated subset are known a-priori. The optimal policy can be found analytically and is summarized in Theorem 1. This serves as a baseline to evaluate the performance of DQN implementation in the next section.
Assume the currently activated subset at each time slot is known a-priori. Then the problem can be modeled as a fully-observable MDP, and the corresponding optimal policy can be found by finding and comparing Q values of all possible state-action pairs.
Assume all channels in the system form independent subsets, thus there are states in total. The subsets are indexed according to their fixed activation order as , where is the initial activation subset at the start of the system. Note the channel subset activation order is circular so that is followed by in the order. The corresponding system state at a time slot is represented as () when channel subset is activated. Let be the transition probability from state to state () of the Markov chain, and we have:
Then the corresponding Q-value of the optimal policy starting with state and action is:
where is the immediate reward, i.e. either if the chosen channel is good or if the chosen channel is bad. , defined as , represents the expected accumulated discounted reward given by an optimal policy over infinite time horizon with initial state as .
Since the optimal action for each state is , the optimal action to maximize the Q value of a given state in Eq. (12) is
All the above analysis holds based on the assumption that the current state of each time slot is observable. As the initially activated channel subset is known, the user can initially choose a channel in this activated subset and then follow Eq. (13) afterward. Based on the observation of the chosen channel the user is guaranteed to know what the current state is: if the chosen channel is good, the currently activated subset is the subset containing the chosen channel; otherwise, the currently activated subset is the subset prior to the chosen channel’s subset in the activation order. Thus, the current state of the MDP is fully observable, and the optimality of the policies in Alg. 1 and Alg. 2 derived from Eq. (13) is achieved.
It turns out that the optimal policy for the fixed-pattern channel switching shares a similarly simple and robust structure with the Myopic policy in : the optimal policy has a round-robin structure (in terms of the channel subset activation order) and does not require to know the exact value of except whether it is above/below . This semi-universal property makes the optimal policy easy to implement in practice and robust to mismatches of system dynamics.
Vii Experiment and Evaluation of Learning for Unknown Fixed-Pattern Channel Switching
Having derived the optimal policy for fixed-pattern channel switching when one has a full knowledge of the system statistics in the previous section, we implement a DQN in this section and study how it performs in the fixed-pattern channel switching even without any prior knowledge of the system statistics. We first present details of our DQN implementation and then evaluate its performance through three experiments.
Vii-a DQN Architecture
We design a DQN by following the Deep Q-learning with Experience Replay Algorithm 
and implement it in TensorFlow. The structure of our DQN is finalized as a fully connected neural network with each of the two hidden layers containing neurons333Generally speaking, deciding the number of hidden layers and the number of neurons in a layer needs many trials and errors. But we follow some general guidance provided in . We choose a two-hidden-layers neural network as it “can represent an arbitrary decision boundary to arbitrary accuracy with rational activation functions and can approximate any smooth mapping to any accuracy." And to decide the number of neurons in each layer, one of the rules of thumb methods is that “The number of hidden neurons should be between the size of the input layer and the size of the output layer." We have tried a different number of neurons between (output layer size) and (input layer size), and the network structure with neurons provided a good performance with small training time.
. The activation function of each neuron is Rectified Linear Unit (ReLU), which computes the function . The state of the DQN is defined as the combination of previous actions and observations over previous time slots, which serves as the input to the DQN. And the considered number of historical time slots is the same as the number of channels in the system, i.e., . A vector of length is used to represent the observation at a time slot, where each item in the vector indicates the quality of the corresponding channel. If channel is selected, the value of the th item in the vector is if the channel quality is good or if the channel quality is bad; otherwise, we use to indicate that channel is not selected. And this vector implicitly contains action information, as a non-zero item in the vector indicates the corresponding channel is selected. The output of the DQN is a vector of length , where the th item represents the Q value of a given state if channel is selected. We apply the -greedy policy with fixed as to balance the exploration and exploitation, i.e., with probability the agent selects uniformly a random action, and with probability the agent chooses the action that maximizes the Q value of a given state. A technique called Experience Replay is introduced in  to break correlations among data samples and make the training stable and convergent. At each time slot during training, when an action is taken given the state is , the user gains a corresponding reward and the state is updated to , a piece of record is stored into a place called replay memory. When updating the weights of the DQN, a minibatch of samples are randomly selected from the replay memory to compute the loss function, and then a recently proposed Adam algorithm I). In the following experiment settings, we consider a system of channels, i.e., , which is a typical multichannel WSN.
|Experience replay size|
Vii-B Single Good Channel, Round Robin Switching Situation
We first consider a situation where there is only one good channel in the system at any time slot. The channels take turns to become good with some probability in a sequential round-robin fashion. In other words, if at time slot , channel is good and all other channels are bad, then in the following time slot , with probability the following channel becomes good and all others bad, and with probability channel remains good and all others bad. In this situation, the inherited dependence and correlation between channels are high. Actually, this is the fixed-pattern channel switching with each independent subset contains one single channel and is activated in a sequential order. In Fig. 3, we provide a pixel illustration to visualize how the states of channels change in the -channel system that follows a single good channel, round-robin situation over time slots. The x-axis is the index of each channel, and the y-axis is the time slot number. A white cell indicates that the corresponding channel is good, and a black cell indicates that the corresponding channel is bad.
We compare the DQN with two other policies: the Whittle Index heuristic policy and the optimal policy with known system dynamics from section VI. The optimal policy has full knowledge of the system dynamics and serves as a performance upper bound. In the Whittle Index heuristic, the user assumes all channels are independent. For each channel, the user observes it for time slots and uses Maximum Likelihood Estimation (MLE) to estimate the corresponding -state Markov chain transition matrix. Once the system model is estimated, Whittle Index can be applied. As can be seen in Fig. 4, as the switching probability varies, DQN remains robust and achieves the same optimal performance in all five cases as the optimal policy and performs significantly better than the Whittle Index heuristic. This lies in the fact that DQN can implicitly learn the system dynamics including the correlation among channels, and finds the optimal policy accordingly. On the contrary, the Whittle Index heuristic simply assumes the channels are independent and is not able to find or make use of the correlation among channels. Moreover, as the switching probability increases, the accumulated reward from DQN also increases because there is more certainty in the system that leads to an increase in the optimal reward.
Vii-C Single Good Channel, Arbitrary Switching Situation
Next, we study a situation in which there is still only one channel being good in any time slot. However, unlike the previous situation, the channels become good in an arbitrary order. Fig. 5 shows a pixel illustration of the -channel system in this situation.
In the experiment, the channel-switching probability is fixed as , and we randomly choose different arbitrary channel switching orders. As can be seen from Fig. 6, DQN achieves the optimal performance and significantly outperforms Whittle Index heuristic in all cases.
Vii-D Multiple Good Channels Situation
In this section, we investigate the situation when there may be more than one good channels in a time slot. The channels are evenly divided into several subsets, where each subset contains the same number of channels. At any time slot, there is only one subset activated where all channels in this subset are good, and channels in other inactivated subsets are bad. The subsets take turns to become available with a switching probability fixed at . And this is the fixed-pattern channel switching with each independent subset contains one or more channels. Fig. 7 shows a pixel illustration of the -channel system in a multiple good channels situation.
We vary the number of channels in a subset as , , and in the experiment, and present the experimental result in Fig. 8. The channels in the system are in order and the subsets are activated in a sequential round-robin order in the upper graph in Fig. 8, while the channels are arranged arbitrarily and the activation order of subsets is also arbitrary in the bottom graph in Fig. 8. As can be seen, DQN always achieve the optimal performance, and the training time decreases as the number of good channels increases. This is because there is more chance to find a good channel when more good channels are available at a time slot, and the learning process becomes easier so that the DQN agent can take less time exploring and is able to find the optimal policy more quickly. This also explains why Whittle Index heuristic performs better when there are more good channels available. However, DQN significantly outperforms Whittle Index heuristic in all cases.
Viii Experiment and Evaluation of DQN for More Complex Situations
From the results in Section VII, we can see that DQN outperforms Whittle Index heuristic and achieves optimal performance in the unknown fixed-pattern channel switching. Another question to ask is: can DQN achieve a good or even optimal performance in more complex and realistic situations? To answer this question and at the same time provide a better and deeper understanding of DQN, we have re-tuned our neural network structure to become a fully connected neural network with each hidden layer containing neurons (and the learning rate is set as )444We have tried the same DQN structure as that in Section VII, but it does not perform well. One intuition is that the parameters in the two-hidden layer DQN with each layer containing neurons DQN is very large, which may require careful and longer training. Additionally, the two-hidden layer neural network may also not be able to provide a good approximation of Q values in more complex problems. Therefore, we decide to add one more hidden layer and reduce the number of neurons to . This deeper DQN with fewer neurons has the ability to approximate more complicated Q-value function, and in the meanwhile requires less time to train before finding a good policy., and considered more complex simulated situations as well as real data traces.
In this section, in addition to the Whittle Index heuristic, we also compare DQN with a Random Policy in which the user randomly selects one channel with equal probability at each time slot. Since the optimal policy even with a full knowledge of the system statistics is computationally prohibitive to obtain (by solving the Bellman-Ford equation in the belief state space) in general, we implement the Myopic policy as it is simple, robust and can achieve an optimal performance in some situations. However, one cannot consider the Myopic policy in general when system statistics is unknown since a single user is not able to observe the states of all channels at the same time so that one could not provide an estimation of the transition matrix of the entire system. Moreover, even if we allow the user to observe the states of all channels, the state space of the full system is too large to estimate and one would easily run out of memory when storing such a large transition matrix. Therefore, in the following simulation, we only consider cases when is sparse and easy to access, and implement the Myopic policy as a genie (knowing the system statistics a-priori) and evaluate its performance.
Viii-a Perfectly correlated scenario
We consider a highly correlated scenario. In a -channel system, we assume only two or three channels are independent, and other channels are exactly identical or opposite to one of these independent channels. This is the case when some channels are perfectly correlated, i.e., the correlation coefficient is either or .
During the simulation, we arbitrarily set the independent channels to follow the same -state Markov chain with . When the correlation coefficient , the user can ignore those channels that are perfectly correlated with independent channels and only select a channel from the independent channels. In this case, the multichannel access problem becomes selecting one channel from several i.i.d. channels that are positively correlated, i.e., . Then as it is shown in the previous work [8, 9], the Myopic policy with known is optimal and has a simple round-robin structure alternating among independent channels. In the case when , the Myopic policy with known also has a simple structure that alternates between two negatively perfectly correlated channels. Though more analysis needs to be done in future to show whether the Myopic policy is optimal/near-optimal when , it can still serve as a performance benchmark as the Myopic policy is obtained with full knowledge of the system dynamics.
In Fig. 9 we present the performance of all four policies: (i) DQN, (ii) Random, (iii) Whittle Index heuristic, and (iv) Myopic policy with known . In the first three cases (x-axis 0, 1 and 2), the correlation coefficient is fixed as and in the last three cases (x-axis 3, 4 and 5), is fixed as . We also vary the set of correlated channels to make cases different. The Myopic policy in the first three cases is optimal, and in the last three cases is conjectured to be near-optimal. As it is shown in Fig. 9, the Myopic policy, which is implemented based on the full knowledge of the system, is the best among all six cases and serves as an upper bound. DQN provides a performance very close to the Myopic policy without any knowledge of the system dynamics. The Whittle Index policy performs worse than DQN in all cases.
In addition, we collect the Q-values predicted from the DQN to show that DQN, indeed, tries to learn and improve its performance. Given a state , the maximum Q-value over all actions, i.e., , represents the estimate of the maximum expected accumulated discounted reward starting from over an infinite time horizon. For each simulation case, we fix a set of states that are randomly selected, and then plot the average maximum Q value of all these states as the training is executed. As it is shown in Fig. 10, in all cases, the average maximum Q-value first increases and then becomes stable, which indicates DQN learns from experience to improve its performance and converges to a good policy. As the environment cases are different, DQN may take a different amount of time to find a good policy, which is indicated as the different number of training iterations in each case in the figure for Q values becoming stable.
Viii-B Real data trace
We use real data trace collected from our indoor testbed Tutornet555More information about the testbed on http://anrg.usc.edu/www/tutornet/ to train and evaluate the performance of DQN on real systems. The testbed is composed of TelosB nodes with IEEE 802.15.4 radio. We programmed a pair of motes distanced approximately 20 meters to be transmitter/receiver. The transmitter continually transmits one packet to each one of the available channels periodically and the receiver records the successful and failed attempts. The transmitter switches transmitting on different channels so fast that the time difference can be ignored and the channel states of channels measured at each period can be considered to be in the same time slot. Both nodes are synchronized to avoid packet loss due to frequency mismatch and the other motes on the testbed are not in use. The only interference suffered is from surrounding Wi-Fi networks and multi-path fading. There are 8 Wi-Fi access points on the same floor and dozens of people working in the environment, which creates a very dynamic scenario for multichannel access.
The data are collected for around hours. Due to the configuration of Wi-Fi central channels, there are channels whose conditions are significantly better than others. Randomly selecting one channel from these good channels and keeping using it can lead to a good performance. Thus, in order to create a more adverse scenario and test the learning capability of the DQN, we ignore all these good channels and only use the data trace from the rest channels.
We use the same data trace to train the DQN and to compute the MLE of the transition matrices of each channel for the Whittle index based heuristic policy. We compare the performance of the DQN policy, the Whittle index based heuristic policy and the Random policy. The Myopic Policy is not considered as finding the transmission matrix of the entire system is computationally expensive. The average accumulated discounted reward from each policy is listed in Table II. It can be seen that DQN performs best in this complicated real scenario. We also present the channel utilization of each policy in Fig. 11 to illustrate the difference among them. It shows DQN benefits from using other channels when the two best channels (used by the Whittle Index heuristic all the time) may not be in good states.
|Method||Accumulated Discounted Reward|
Viii-C Practical Issues
From the previous analysis and experiment results, DQN shows a promising performance in the multichannel access problem. However, there are issues that need to be considered when implementing it in real deployments. In this paper when discussing the channel access problem, we only focus on one user and simply assume the user can always observe the actual state of his selected channel at each time slot. In practice, there are two entities involved, the sender and the receiver. They must be synchronized and use the same channel to communicate all the time. In a time slot when the sender selects a channel to transmit a packet, the receiver knows the selected channel condition based on whether it receives the packet or not, and the sender knows the selected channel condition from the acknowledgement (ACK) or negative-acknowledgement (NAK) message sent back by the receiver. If the receiver successfully receives the packet, it knows the channel is good and sends back an ACK to the sender, so that based on the received ACK the sender also knows the channel is good; if the receiver does not receive any packet, it knows the channel is bad and sends back an NAK to the sender, and thus the sender also knows the channel is bad. Therefore, when applying DQN in practice, we need to make sure the sender and the receiver always select the same channel at each time slot to guarantee their communication as well as having the same information about channel conditions through ACKs and NAKs.
One approach is to run the same structured DQNs at the sender and the receiver separately. The two DQNs start with the same default channel and are trained concurrently. We need to make sure the two DQNs have the same trained parameters and select the same channels at all times during training. Even though the ACK/NAK method can guarantee the sender and receiver have the same channel observations and thus training samples, there are still two facts that may cause the channel selection at the sender and the receiver to be different. First, in the exploration step, since each DNQ randomly selects a channel, it may happen that the two DQNs select different channels. Second, in the back propagation step, each DQN randomly selects a set of data samples from its experience replay to update its parameters. This may cause the parameters of two DQNs to become different, which further results in different channel selection policies. To resolve the possible mismatch, we can use the same random seed on both sides to initialize the pseudorandom number generator in the implementation. In this way, the two DQNs always select the same random channel during exploration and use the same set of data samples to update parameters. Therefore, we can ensure the two DQNs will always select the same channel and the final learned policy is guaranteed to be the same.
The channel mismatch problem can still happen when an ACK or NAK is lost (due to noise and/or interference) so that the sender and receiver might have different observations on the selected channel condition, and thus they may select different channels later. This inconsistent channel observation not only causes loss of communication, but also results in different learned DQN models at the sender and receiver that give different channel selection policies. One possible approach is to find a way to let the sender and the receiver be aware of the time when a channel mismatch happens, and try to recover in time. Since the sender is expecting to receive an ACK or NAK after each message is sent, the sender can detect the mismatch events if no ACK or NAK are received. Once the sender detects the possible channel mismatch event, it stops updating its DQN model as well as training dataset and transmits data in the future using one single channel - or a small set of channels known so far to have better channel conditions . In addition, along with the original data messages, the sender also sends the timestamp when the channel mismatch was perceived. The sender keeps sending this channel mismatch time information until an ACK being received, which indicates the receiver is on the same channel again and receives the channel mismatch information. Therefore, the receiver can set its DQN model as well as its observation training dataset back to the state right before the channel mismatch happened (assume the receiver uses additional memory to store different states of trained parameters and data samples), which guarantees that the sender and the receiver have the same DQN models as well as training datasets. They can resume operating and training thereafter. Suppose the sender only uses one current best channel to send the channel mismatch timestamp, and let be the probability of this channel being good in a time slot, be the probability an ACK or NAK being lost, and be the number of channels in the system. As the receiver keeps training its DQN model before being aware of the channel mismatch problem, it applies the -greedy exploration policy (explained in Section VII-A) during training phase. Therefore, with probability , the receiver randomly picks a channel. Thus, after a channel mismatch happens, the probability that the sender and the receiver meet again on the same good channel and at the same time the ACK is successfully received is . Once they meet on the same good channel, they can re-synchronize. Based on the above approach, the expected number of time slots required for re-syncing after a channel mismatch is . Since the ACK packet is very small, the probability of loss is small . As long as the sender and the receiver can re-synchronize again after a channel mismatch, the effectiveness of the proposed policy is guaranteed and the performance will not be affected too much on average.
Ix Adaptive DQN for Unknown, Time-Varying Environments
The studies in previous sections all focus on stationary situations, and DQN performs well in learning and finding good or even optimal dynamic multichannel access policies. However, in practice, real systems are often dynamic across time, and our DQN framework in previous sections cannot perform well in such situations. This is because we keep evaluating the newly-learned policy after each training iteration and once a good policy is learned666In this paper, we manually check the evaluation performance and stop the learning when a policy is good enough. More advanced techniques such as Secretary Problem  (by considering each learned policy as a secretary) can be used to decide when to accept a policy and stop learning., our DQN framework stops learning and keeps following this good policy. Thus, it lacks the ability to discover the change and re-learn if needed. To make DQN more applicable in realistic situations, we have designed an adaptive algorithm in Algorithm 3 to make DQN able to be aware of the system change and re-learn if needed. The main idea is to let DQN periodically evaluate the performance (i.e., the accumulated reward) of its current policy, and if the performance degrades by a certain amount, the DQN can infer that the environment has changed and start re-learning.
On the other hand, the Whittle Index heuristic cannot detect the environment change by simply observing the reward change. This is because the policy given from Whittle Index heuristic is far from the optimal policy, and it may have the low performance in both old and new environments so that there is no significant change in the reward leading to the claim that the environment has changed. In addition, even if the Whittle Index heuristic could detect the change, the new policy may still give a bad performance as the Whittle Index heuristic ignores the correlations among channels and is not able to have a correct estimation of the system dynamics due to its limited partial observation ability.
In the experiment, we make the system initially follow one of the fixed-pattern channel switching cases from Section VII, and after some time it changes to another case. We consider both single good channel and multiple good channel situations. We let DQN automatically operate according to Alg. 3, while we manually re-train Whittle Index heuristic when there is a change in the environment. Fig. 12 compares the reward of both the old and new policies learned for DQN and the Whittle Index heuristic in the new environment, as we vary the pattern changes. As can be seen, DQN is able to find an optimal policy for the new environment as the genie optimal policy does, while Whittle Index heuristic does not.
We also provide the real-time accumulated reward during the learning process of DQN and the Whittle Index heuristic in one of the above pattern changing situations in Fig. 13. The system initially starts with an environment that has channels being good at each time slot for the first iterations. As can be seen, both DQN and the Whittle Index heuristic are able to quickly find a good channel access policy, but DQN achieves the optimal performance. At iteration , the environment changes to having only channel being good at each time slot. As there is a significant drop in the reward, DQN can detect the change and starts re-learning. And at iteration , DQN finds the optimal policy and our system keeps following the optimal policy thereafter. On the other hand, even though we manually enable the Whittle Index heuristic to detect the change and re-estimate the system model and re-find a new policy, its performance is still unsatisfying as it cannot make use of the correlation among channels.
X Conclusion and Future Work
In this paper, we have considered the dynamic multichannel access problem in a more general and practical scenario when channels are correlated and system statistics is unknown. As the problem, in general, is an unknown POMDP without any tractable solution, we have applied an end-to-end DQN approach that directly utilizes historical observations and actions to find the access policy via online learning. In the fixed-pattern channel switching, we have been able to analytically find the optimal access policy that is achieved by a genie with known system statistics and full observation ability. Through simulations, we have shown DQN is able to achieve the same optimal performance even without knowing any system statistics. We have re-tuned the DQN implementation, and shown from both simulations and real data trace that DQN can achieve near-optimal performance in more complex scenarios. In addition, we have also designed an adaptive DQN and shown from numerical simulations that it is able to detect system changes and re-learn in non-stationary dynamic environments to provide a good performance.
There are a number of open directions suggested by the present work. First, we plan to apply the DQN framework to consider more realistic and complicated scenarios such as multi-user, multi-hop and simultaneous transmissions in WSNs. The framework of DQN can be directly extended to consider these practical factors in a simple way. For example, in the situation of multiple users, to avoid interference and collisions among users, we can adopt a centralized approach: assuming there is a centralized controller that can select a subset of non-interfering channels at any time slot, and assign one to each user to avoid a collision. By redefining the action as selecting a subset of non-interfering channels, the DQN framework can be directly used for this multi-user scenario. As the action space becomes large when selecting multiple channels, the current DQN structure requires careful re-design and may require very long training interval before finding a reasonable solution. Instead, we use the same DQN structure as that in Section VII and consider the multiple-users situation in a smaller system that contains channels where at any time slot channels become good and channel conditions change in a round-robin pattern. The number of users varies from to . As is shown in Fig. 14, DQN can still achieve a good performance in the multiple-user case. Other deep reinforcement learning approaches, such as Deep Deterministic Policy Gradient (DDPG) , will be studied in future to tackle the large action space challenge.
Second, when the number of users in the network becomes large, the above proposed centralized approach becomes too computationally expensive to implement in practice. In future, we plan to study a more practical distributed approach where each user can learn a channel selection policy independently. One intuitive idea is to implement a DQN at each user independently. Then users can learn their channel selection policies parallelly, and avoid interference and conflicts by making proper channel-selection decisions based on the information gained from observations and rewards. However, whether a good or optimal policy can be learned, and whether an equilibrium exists are unknown and need further investigation.
Moreover, as DQN is not easy to tune and may get stuck in local optima easily, we plan to spend more time improving our DQN implementation as well as considering other Deep Reinforcement Learning approaches to see if they have the ability to reach the optimal performance in general situations and study the tradeoff between implementation complexity and performance guarantee. Also as a way to test the full potential of DQN (or Adaptive DQN) as well as other deep reinforcement learning technologies in the problem of multichannel access, we encourage the networking community to work together to create an open source dataset (like what has been done in computer vision and NLP community) that contains different practical channel access scenarios so that researchers can benchmark the performance of different approaches. We have published all the channel access environments and real data trace considered in this work online888https://github.com/ANRGUSC/MultichannelDQN-channelModel. This might serve as an initial dataset for researchers to use.
-  S. Wang, H. Liu, P. Gomes, and B. Krishnamachari, “Deep reinforcement learning for dynamic multichannel access in wireless networks,” in ICNC, 2017.
-  R. Knopp and P. Humblet, “Information capacity and power control in single-cell multiuser communications,” in IEEE ICC, 1995.
-  I. F. Akyildiz, W.-Y. Lee, M. C. Vuran, and S. Mohanty, “Next generation/dynamic spectrum access/cognitive radio wireless networks: A survey,” Computer networks, vol. 50, no. 13, pp. 2127–2159, 2006.
-  C. Papadimitriou and J. N. Tsitsiklis, “The complexity of markov decision processes,” Math. Oper. Res., vol. 12, no. 3, pp. 441–450, 1987.
-  V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller, “Playing atari with deep reinforcement learning,” arXiv preprint arXiv:1312.5602, 2013.
-  E. Stevens-Navarro, Y. Lin, and V. W. S. Wong, “An mdp-based vertical handoff decision algorithm for heterogeneous wireless networks,” IEEE Trans on Vehicular Technology, vol. 57, no. 2, pp. 1243–1254, March 2008.
-  P. Sakulkar and B. Krishnamachari, “Online learning of power allocation policies in energy harvesting communications,” in SPCOM, 2016.
-  Q. Zhao, B. Krishnamachari, and K. Liu, “On myopic sensing for multi-channel opportunistic access: structure, optimality, and performance,” IEEE Trans. Wireless Commun., vol. 7, no. 12, pp. 5431–5440, dec 2008.
-  S. H. A. Ahmad, M. Liu, T. Javidi, Q. Zhao, and B. Krishnamachari, “Optimality of myopic sensing in multichannel opportunistic access,” IEEE Trans. Inf. Theory, vol. 55, no. 9, pp. 4040–4050, 2009.
-  K. Liu and Q. Zhao, “Indexability of restless bandit problems and optimality of whittle index for dynamic multichannel access,” IEEE Trans. Inf. Theory, vol. 56, no. 11, pp. 5547–5567, nov 2010.
-  H. Liu, K. Liu, and Q. Zhao, “Logarithmic weak regret of non-bayesian restless multi-armed bandit,” in IEEE ICASSP, 2011.
-  C. Tekin and M. Liu, “Online learning in opportunistic spectrum access: A restless bandit approach,” in IEEE INFOCOM, 2011.
-  W. Dai, Y. Gai, and B. Krishnamachari, “Efficient online learning for opportunistic spectrum access,” in IEEE INFOCOM, 2012.
-  ——, “Online learning for multi-channel opportunistic access over unknown markovian channels,” in IEEE SECON, 2014.
-  R. Ortner, P. A. D. Ryabko, and R. Munos, “Regret bounds for restless markov bandits,” in ALT, 2012.
-  P. Venkatraman, B. Hamdaoui, and M. Guizani, “Opportunistic bandwidth sharing through reinforcement learning,” IEEE Trans. on Vehicular Technology, vol. 59, no. 6, pp. 3148–3153, July 2010.
-  Y. Zhang, Q. Zhang, B. Cao, and P. Chen, “Model free dynamic sensing order selection for imperfect sensing multichannel cognitive radio networks: A q-learning approach,” in IEEE ICC, 2014.
-  A. R. Syed, K. L. A. Yau, H. Mohamad, N. Ramli, and W. Hashim, “Channel selection in multi-hop cognitive radio network using reinforcement learning: An experimental study,” in ICFCNA, 2014.
-  S. Levine, C. Finn, T. Darrell, and P. Abbeel, “End-to-end training of deep visuomotor policies,” arXiv preprint arXiv:1504.00702, 2015.
-  J.-A. M. Assael, N. Wahlström, T. B. Schön, and M. P. Deisenroth, “Data-efficient learning of feedback policies from image pixels using deep dynamical models,” arXiv preprint arXiv:1510.02173, 2015.
-  J. Ba, V. Mnih, and K. Kavukcuoglu, “Multiple object recognition with visual attention,” arXiv preprint arXiv:1412.7755, 2014.
-  “802.15.4-2015 - IEEE Standard for Low-Rate Wireless Personal Area Networks (WPANs),” 2015.
-  “Solvepomdp,” http://erwinwalraven.nl/solvepomdp/.
-  C. J. C. H. Watkins and P. Dayan, “Q-learning,” in Machine Learning, 1992, pp. 279–292.
-  C. Watkins and P. Dayan, “Technical note: Q-learning,” Machine Learning, vol. 8, no. 3–4, 1992.
-  K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014.
-  I. Sutskever, O. Vinyals, and Q. V. Le, “Sequence to sequence learning with neural networks,” in Advances in Neural Information Processing Systems 27. Curran Associates, Inc., 2014, pp. 3104–3112.
-  M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and X. Zheng, “Tensorflow: A system for large-scale machine learning,” in OSFI, 2016, pp. 265–283.
-  J. Heaton, Introduction to Neural Networks for Java, 2Nd Edition, 2nd ed. Heaton Research, Inc., 2008.
-  D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014.
-  J.-Y. Kim, S.-H. Chung, and Y.-V. Ha, “A fast joining scheme based on channel quality for IEEE802.15.4e TSCH in severe interference environment,” in ICUFN. IEEE, jul 2017.
-  D. S. J. De Couto, D. Aguayo, J. Bicket, and R. Morris, “A high-throughput path metric for multi-hop wireless routing,” Wirel. Netw., vol. 11, no. 4, pp. 419–434, Jul. 2005.
-  T. Ferguson, “Who solved the secretary problem?” Stat. Sci., vol. 4, pp. 282–296, 1989.
-  T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, “Continuous control with deep reinforcement learning.” CoRR, 2015.