Ensemble Consensus-based Representation Deep Reinforcement Learning for Hybrid FSO/RF Communication Systems

—Hybrid FSO/RF system requires an efﬁcient FSO and RF link switching mechanism to improve the system capacity by realizing the complementary beneﬁts of both the links. The dynamics of network conditions, such as fog, dust, and sand storms compound the link switching problem and control complexity. To address this problem, we initiate the study of deep reinforcement learning (DRL) for link switching of hybrid FSO/RF systems. Speciﬁcally, in this work, we focus on actor-critic called Actor/Critic-FSO/RF and Deep-Q network (DQN) called DQN-FSO/RF for FSO/RF link switching under atmospheric turbulences. To formulate the problem, we deﬁne the state, action, and reward function of a hybrid FSO/RF system. DQN-FSO/RF frequently updates the deployed policy that inter- acts with the environment in a hybrid FSO/RF system, resulting in high switching costs. To overcome this, we lift this problem to ensemble consensus-based representation learning for deep reinforcement called DQNEnsemble-FSO/RF. The proposed novel DQNEnsemble-FSO/RF DRL approach uses consensus learned features representations based on an ensemble of asynchronous threads to update the deployed policy. Experimental results cor-roborate that the proposed DQNEnsemble-FSO/RF’s consensus- learned features switching achieves better performance than Actor/Critic-FSO/RF, DQN-FSO/RF, and MyOpic for FSO/RF link switching while keeping the switching cost signiﬁcantly low.


I. INTRODUCTION
F Ree space optical communication (FSO) supports high data rate applications with minimum electromagnetic interference [1]. FSO requires a point-to-point link between transmitter and receiver and is sensitive to atmospheric turbulences, such as fog, dust, and sand storms that result in serious degradation of FSO link capacity [2], [3]. To increase the reliability of terrestrial broadband links, a radio frequency (RF) link is integrated with FSO links to form a hybrid FSO/RF system. The hybrid FSO/RF system exploits the complementary nature of individual FSO and RF links with respect to their environmental sensitivity. This rationale is well explained as two links exhibit complementary attributes to atmospheric and weather conditions; the FSO link is not very sensitive to rain, while RF links do not deteriorate the signal quality from fog, sand, and dust storms and are heavily attenuated due to rain [4]- [6]. A  reliable communication due to an efficient switching between FSO and RF links under varying weather conditions, thereby improving the performance of the system as a whole [7], [8].
Designing an efficient hybrid FSO/RF system with high link availability in a dynamic environment characterized by fog, dust, or sand is challenging; essentially decisions regarding the switching of the link between FSO and RF must be made immediately. Towards efficient FSO and RF link switching, few works have been reported, such as switching mechanism based on weak and strong turbulence for a 1-hop FSO/RF system [9], [10], fuzzy logic-based FSO/RF soft switching mechanism [29], predictive link switching mechanism using long short term memory (LSTM) [11], AdaBoostClassifier, DecisionTreeClassifier, RandomForestClassifier, and Gradient-BoostingClassifier [12]. Other methods include thresholdbased link adaptation technique [13] to avoid frequent link switching, FSO link Outage-initiated link switching [14], switching for multi-hop FSO/RF systems under various statistical models [15]- [17], and coding schemes for link switching [18], [19]. These techniques, although, switch FSO and RF links using threshold, coding, or predictive methods. However, these techniques are not efficient for link switching under a time-varying dynamic environment. The dynamics of network conditions certainly compound the problem and switching control complexity that is not addressed by the existing FSO/RF link switching techniques for hybrid FSO/RF systems.
Fortunately, deep reinforcement learning (DRL) [20] is an emerging trend to solve such complex problems and control issues. Recent years have witnessed the application of DRL to various applications, such as resource allocation and optimization [21]- [25], fog/edge computing and caching [26], [27], and dynamic channel assignment [28]. To our best knowledge, there is no work to consider DRL for FSO and RF link switching or control problems in hybrid FSO/RF systems. This work proposes DRL-based frameworks for link switching in a hybrid FSO/RF system such as actor-critic and Deep-Q network (DQN). Due to frequently changing weather conditions, such as fog, dust, and sand, integrating FSO/RF system with efficient link switching is indeed challenging [9], [29]. The key motivation for this DRL-based framework is to support dynamic and multi-factor decision making [30], [31].
DQN has gained significant attention due to tremendous improvement in performance with the help of deep neural networks (DNN) to extract features. Recently, significant optimizations to DQN have been proposed, such as double DQN [32] to reduce overestimation of action values, experience replay buffer to prioritize learning [43], distributed DQN to models the distribution of action value, and dueling DQN architecture [33] that maps action values from state and advantage values.
To enable DQN efficiently for link switching and control decisions, it is desirable to limit the DQN agent to reduce the number of times the deployed/target policy changes during training. For large-scale hybrid FSO/RF systems, updating a policy requires reconsidering the complete environment. This requirement motivates the design of DQN agents with low switching costs. The proposed agent in this work aims to reduce the number of times the deployed/target policy interacting with the environment changes. Our work proposes consensus-based feature selection criteria to DQN to reduce switching costs in contrast to DQN. The key contributions of this work are summarized as follows: • Conduct the first systematic study of modern deep reinforcement learning algorithms for hybrid FSO/RF systems. We implement two well-known DRL algorithms: 1) actor-critic based on actor and critic neural networks and 2) deep Q-network that consists of two deep neural networks to approximate a Q-function. We investigate that both the DRL methods find the best policy for FSO and RF switching in contrast to MyOpic. This is illustrated below: -An actor-critic DRL-based method called Actor/Critic-FSO/RF solves the link switching optimization problem by considering its non-convex and combinatorial characteristics. The objective is to investigate the optimal long-term reward/utility of FSO and RF link switching for a hybrid FSO DQNEnsemble-FSO/RF method demonstrates faster convergence and learning performance in contrast to Actor/Critic-FSO/RF and DQN-FSO/RF at a significantly reduced switching cost. The remainder of this article unfolds as follows. Section II discusses recent works relevant to link switching techniques in hybrid FSO/RF systems. We describe the system model and problem formulation in Section III and Section IV, respectively. Deep reinforcement learning methods, i.e., Actor/Critic-FSO/RF and DQN-FSO/RF for the FSO/RF link switching are presented in Section V. Section VI formulates the policy switching problem considering the hybrid FSO/RF system. The novel proposed DRL method to solve the policy switching problem called DQNEnsemble-FSO/RF is presented in Section VII. Performance evaluation including MyOpic policy switching, evaluation setup, results, and analysis of all the DRL methods are given in Section VIII. Finally, Section IX concludes the paper with possible future directions.

II. RELATED WORK
Hybrid FSO/RF systems have been widely discussed in the literature to improve the reliability of communication. Authors in [34] proposed a hybrid FSO/RF system to act as a capacity backhaul to support high traffic for 5G and beyond. In this work, the FSO acts as a primary backhaul and RF as a secondary. RF system is activated through a one-bit feedback signal by the receiver, but the system does not consider the real-time channel conditions closer to the transmitter.
A link switching technique called adaptive combining used signal-to-noise ratio (SNR) threshold to keep the FSO link active [35]. It activates the RF link, if the perceived SNR of the FSO link drops below the switching threshold, enabling diversity reception for simultaneous data transmission over both the links combined through maximal ratio combining (MRC). The system switches back to the FSO link upon acceptable link quality. The combining technique based on MRC, however, is subject to performance and complexity tradeoff. In [36], [37], a hybrid FSO/RF system is proposed using adaptive combining techniques based on various power adaptation mechanisms. This system demonstrated better outage performance in contrast to FSO/RF system with constant power. One serious limitation of this system is the requirement of power adaptable RF and FSO transceivers that are expensive compared to constant power FSO/RF systems.
Works in [9], [10], [38] proposed a link switching mechanism between FSO and RF-based on atmospheric turbulences. The switching mechanism keeps one link active depending upon atmospheric conditions. A method in [9], [10] evaluated an FSO/RF switching mechanism according to weak and strong turbulence for a 1-hop FSO/RF hybrid system. Abid et al. in [29] proposed a fuzzy logic-based hybrid FSO/RF soft switching mechanism to improve the reliability and capacity of FSO under atmospheric conditions, such as dust, fog, and cloud, with a particular focus on sand/dust. The system consists of fuzzy-inference-based FSO and RF subsystem controlled using a fuzzy inference switching mechanism that prioritizes the FSO subsystem. The proposed fuzzy inference switching mechanism improves the performance of the hybrid system for bit error rate (BER), SNR, and system capacity. However, the fuzzy logic inference is dependent on human expertise and requires extensive validation and verification.
In [39], Renat et al. proposed a hard switching method based on received signal strength identifier (RSSI) predictions. The method aimed to increase the high availability of the optical link using an RF link under atmospheric turbulences. Authors have considered the use of machine learning models, such as random forest, gradient-boosting regression, and decision trees for RSSI prediction to increase the availability of FSO/RF systems. The proposed work used regression models to analyze the prediction of received optical power. These models can accurately determine the predicted RSSI value. The results of the proposed machine learning models, however, are incorrect under practical verification due to overfitting. Further, the decision trees are susceptible to small changes in data resulting in different outputs.
A work in [11] proposed a predictive link switching mechanism for hybrid FSO/RF systems to conserve energy. The proposed method kept the FSO link continuously active and sampled the FSO signal periodically to collect a dataset. The method trained an LSTM model using the dataset. The work correlated the number of FSO signal power samples in the RF transmission with the prediction error using a predefined error threshold to improve energy efficiency. This work, however, is preliminary and does not consider the dynamics in a hybrid FSO/RF communication system, a challenging task to the model environment to optimize network performance.
Another work in [12] proposed a hard FSO/RF switching mechanism by predicting RSSI value. The authors analyzed the effects of the atmospheric channel on the quality of the optical signal. Although this analysis studied both the soft and hard switching between FSO and RF, the primary consideration was given to the hard switching. The work evaluated various machine learning classifiers, such as Ad-aBoostClassifier, DecisionTreeClassifier, RandomForestClassifier, and GradientBoostingClassifier for RSSI prediction to enable efficient hard FSO/RF switching. Similarly to [11], the work is a simple evaluation of single and ensemble machine learning classifiers for the hard switching between FSO and RF links. The contribution is limited and pays no attention to modeling dynamics of the atmospheric channel and its effect on soft switching between FSO and RF links III. SYSTEM MODEL In this paper, we consider the FSO and RF link switching problem for a hybrid FSO/RF system using FSO/RF state learning and is called as Agent F SO/RF . A detailed description of the system model is given below.
The system is equipped with hybrid links,i.e., RF and FSO with two possible states: T x ready and T x switch . If a link is in T x ready state, it means it can successfully transmit data, however, a T x switch state indicates that switching is required else it may result in failed transmission. The hybrid FSO/RF system assumes that the system can dynamically switch between FSO and RF links. FSO and RF are correlated under dynamic weather conditions. We can model the system using the Markov chain to model switching patterns between FSO and RF links. At any instant of time t, the link state is represented as The hybrid FSO/RF system assumes that the link switching is unknown and should be learned from the link feedback, i.e., atmospheric observations/attenuation level γ. The attenuation level is observed using the signal-to-interference-plus-noise ratio (SINR) through a pilot signal by tuning to an FSO or RF link. The model assumes that the system can learn the weather conditions of the link without using any explicit mechanism. The system can learn the corresponding link state. For the link F SO t , T x ready means γ < 100dB/Km and T x switch otherwise, as given in Equation 1. On the other hand, for link RF t , T x ready denotes γ ≥ 120dB/Km and T x switch otherwise, as illustrated in Equation 2. Let us define the state of link F SO t and link RF t link selected by the system for N time slots, t = 1, 2, . . . M as: if RF link in t (3) It is evident from Equation 3 that only if RF or FSO link is active in a time slot t then its state is known and not otherwise. As can be observed from the above, the system considers a discrete action space A = {a F SO , a RF } with valid possible actions. Hence, in each time slot, the system selects one action from the action space A and accesses the selected link, accordingly. Once the action is selected, the link condition is monitored. Hence, in each time slot, the agent selects an action from the action space A, i.e., access the corresponding RF or FSO link, and the condition of the selected links is revealed.

IV. FSO/RF LINK SWITCHING PROBLEM FORMULATION
This section formulates the link switching problem in a hybrid FSO/RF system. The performance of the system is affected by varying weather conditions including rain, fog, snow, and dust. The work, however, considers the deployment of the system in an environment subject to dust and dust storms, common to regions with desert. Once the system is switched to a link, both the FSO and RF are associated with particular rewards. The work proposes various deep reinforcement learning approaches to implement an agent that learns FSO and RF switching patterns.
Let us define the reward as R f so if the selected link in time slot t is FSO and R RF for the RF as given in Equation 4 below.
The objective of the FSO/RF system is to select appropriate RF or FSO links based on the link quality to ensure successful transmission under dusty conditions. To achieve this, the agent aims to find an optimal policy π that maps system observation Equation 3 to an appropriate action in action space A to maximize the expected reward r F SO/RF,t given in Equation 4 called as R in Equation 5.
The reward R for a finite number of time slots T is expressed in Equation 6 as: In Equation 7, φ F SO/RF,t indicates the link selected for a time slot t. Now, we can formulate the RF/FSO link switching problem as: Subject to In each time slot, the agent can select either FSO or RF link based on the dust conditions. As discussed earlier, the reward is R ∈ [−1, +1].

V. DEEP REINFORCEMENT LEARNING-BASED AGENT FOR HYBRID FSO/RF SYSTEM
This section presents the framework for a hybrid FSO/RF system based on a deep reinforcement learning agent. In this work, we formulate the link switching problem as a Markov Decision Process (MDP) and employ DQN and actorcritic to address it. We consider various DRL approaches including DQN and actor-critic for the implementation of the agent to switch between RF and FSO links. Further, we also consider the performance comparison of the actor-critic agent with the MyOpic policy under complex and dynamic weather conditions. Finally, we propose a consensus-based ensemble representation learning DQN approach for low switching costs under time-varying and dynamic weather conditions. To the best of our knowledge, this is the first study and implementation of DQN and actor-critic and proposal of ensemble consensus-based representation learning DQN in the field of hybrid FSO/RF for link switching.

A. Deep Reinforcement Learning Agent
FSO/RF link state: As discussed earlier, the FSO/RF link state is time-varying as modeled by the MDP. The agent uses its observation space as an input to the DRL framework. The agent accesses the selected FSO or RF link in each iteration. The agent updates the reward based on the state of the selected FSO/RF link. The FSO/RF system learns the best policy based on previous experiences in form of observation where MAX denotes the maximum number of iterations to observe the FSO/RF link state.
Action space: The agent evaluates different actions from the action space A using the observation space O (F SO/RF,t) with the highest reward. In the context of FSO/RF switching, an action means to access RF or FSO link for data transmission in time slot t.
Reward: Once the agent deliberate action from the A, it observes an instantaneous reward based on the condition of the selected link. The basic objective of the reward is to solve the optimization problem as defined in Equation 7.

B. Actor/Critic-FSO/RF DRL Algorithm
The actor-critic DRL Algorithm 1 considers the average reward observed by the DRL agent in time slot t and is given as Equation 8: . It can be observed from Figure 2 that the actor-critic framework is based on actor and critic neural networks. It can be observed from Algorithm 1 that the actor neural network is initialized with θ and critic with parameter µ. The actor neural network maps an observation O (F SO/RF,t) at time slot t to an actions a from A using an optimal policy π * as given in Equation 9. In the Equation, A is discrete and the normalized probability of each action is calculated using the Softmax function at the output layer of the actor-network.
The actor neural network, therefore, can be represented as Equation 10.
The critic neural network is based on a value function, i.e., V (O (F SO/RF,t) ). The critic neural network receives the feedback from the actor network that records the V (O (F SO/RF,t) ) by executing the action in the environment with varying  . The critic uses this information to calculate the temporal difference error as given in Equation 11, where γ ∈ (0, 1).
The critic network uses an optimal value function V alue * to minimize the least squares temporal difference (LSTD) as given in Equation 12.
The actor uses the TD error given in Equation 11 to compute the policy gradient as given below in Equation 13.
In Equation 13, piθ t (O (F SO/RF,t) , a t represents the score of action, i.e., selected FSO/RF link under the current optimal policy π * . Given this the parameters of the actor neural network can be updated using the ∆θ t ← α∇θ t logπθ t (O (F SO/RF,t) , a t ) with learning rate of α ∈ 0, 1. The gradient for the actor network is computed using the Equation 14.
The critic network collects the M ax recent observations of FSO and RF links called as O (F SO,t) and O (RF,t) at The following section illustrates link switching using DQN for the hybrid FSO/RF system. 1) Q-learning: Q-learning in a hybrid FSO/RF system has the potential to learn switching patterns between FSO and RF links directly from environment observations without the need for any estimated system model. This is an ideal solution for unknown weather dynamics, such as dust storms. Q-learning for hybrid FSO/RF system aims to find an optimal policy, i.e., an FSO/RF switching pattern to maximize the accumulated reward R defined in Equation 6. Q-learning learns from actions outside the current policy called off-policy learning. The Qvalue denoted as Q(s, a) represents the cumulative reward of an agent being in state s and performing the committed action a and is given in Equation 15.
In Equation 15, Q(s,a) denotes a Q-function, r(s, a) represents the instantaneous reward of a transmission on a selected FSO or RF link and the max a Q(s , a) is a maximum Q-value for the next observation/state with a discount factor γ. An agent uses Q- Table to   Equation 16 computes the expected future Q-value as a difference between the old Q-value and the discounted future value with one-step look ahead.
2) DQN-FSO/RF: Q-learning can find an optimal policy if it can estimate Q-function for each action and state pair using Equation 15. This turns to computationally expensive if state and action space is large. DQN [30] uses a deep neural network called as Q-Network to approximate the Q-function, i.e., Q(s, a) = r(s, a) + γmax a Q(s , a). The agent selects an action a t using Q(s t , a) and makes transition to next state s t+1 with reward r t+1 . It is represented as a transition/experience tuple Exp t = (s t , a t , r t+1 , s t+1 ). The Exp t is saved to a replay memory buffer D.
The Deep-Q Network is based on states, actions, rewards, and the Q-Network Q(s, a; θ). At each time slot t, the Q-Network uses O (F SO/RF,t) using Equation 3 to select either a F SO or a RF from the action space A as illustrated in Figure  3. The objective of the Q-Network is to maximize the reward as given in Equation 6. Also, an unchanged reward does not contribute to the objective, therefore, it receives a penalty.
A DQN agent consists of two deep neural networks to approximate Q-function which is illustrated in Figure 3. One acts as an action-value function approximator Q(s, a, θ i ) and the second as the target action-value approximatorQ(s, a, θ − i ), where θ i and θ − i represents weights of the neural networks for iteration i. The weights of the first neural network, θ i are updated using the mini-batch of random samples from the replay memory buffer D at each learning iteration i.
The weights θ − i of the second network are updated using the stochastic gradient descent (SGD) and backward propagation algorithm that minimizes the mean-square error(MSE) as loss function. Referring to Equation 16, the loss is calculated as Equation 17, where θ represents the weights of the Q-Network. Equation 17, θ − represents the parameters/weights of the target neural network that is replaced by the parameters θ of training Q-Network every K time steps as can be seen in Figure 3. Deep Q-Network uses mini-batch data from the replay buffer D to train the Q-Network. Instead of using an -greedy approach, the experience replay component exploits stochastic prioritization to generate the probability of actions that helps the network to converge. The steps of DQN-FSO/RF are summarized in Algorithm 2.

VI. DQN-FSO/RF POLICY SWITCHING COST PROBLEM FORMULATION
This section focuses on the policy switching cost called as link

RF/F SO switch
. This cost is used to optimize the DQN-FSO/RF agent. link RF/F SO switch denotes the frequency of changes in deployed policy π in action-value network, i.e., Q(s, a) in Algorithm 2 in T episodes as given below in Equation 18: The objective of the DQN-FSO/RF agent is to learn an optimal policy π * with small link RF/F SO switch cost.

VII. ENSEMBLE CONSENSUS-BASED REPRESENTATION DEEP REINFORCEMENT LEARNING DQNENSEMBLE-FSO/RF FOR FSO/RF LINK SWITCHING
Inspired by the representation learning [40], We adopt the view the DQN learns to extract informative features of the states of environments using the consensus of an ensemble of threads. Our proposed criterion tries to switch the deployed policy according to the consensus of features. In the proposed approach to ensemble consensus to DQN-FSO/RF, M asynchronous threads sample batch of data from the replay buffer and then extract the feature of all states by both the actionvalue network and target Q-network.
For a state s, the extracted features by M threads are denoted as f m (target, s), f m (action−value, s), respectively. The similarity score between f m (target, s), f m (action − The average similarity score for a batch of states B for each thread m is given in Equation 20 as: The Equation 21 computes the consensus score of features using Equation 20. The representation learned ensemble consensus score updates the target/deployed policy whenever the consensusSim(B s ) ≤ α, where α ∈ [0, 1] is learning rate. The DQNEnsemble-FSO/RF algorithm is illustrated in Algorithm 3.

VIII. PERFORMANCE EVALUATION
This section presents and discusses (i) the effectiveness of Agent F SO/RF using deep reinforcement learning algorithms including DQN and actor-critic and (ii) the comparison of DQNEnsemble-FSO/RF agent with the Actor/Critic-FSO/RF, DQN-FSO/RF, and MyOpic as discussed below.

A. MyOpic Policy for FSO/RF Link Switching
The MyOpic policy only accumulates immediate reward obtained from transceiver switching without considering the future. MyOpic agent always selects a transceiver to maximize the immediate expected reward.
Given the state space of Markov chain be where T x F SO ready /T x RF ready and T x RF switch /T x F SO switch denotes binary vector representing the state of FSO or RF links: γ < 100dB/Km and γ ≥ 120dB/Km (1), and otherwise (0) illustrated in Equation 22.
In Equation 22, 1 is an indicator function and ωs i is the conditional probability of the hybrid FSO/RF system in state s i given past decisions/observations. The MyOpic policy follows a simple round-robin FSO and RF switching procedure and is not considered optimal [42].

B. Evaluation Set-up
We have implemented the proposed DQNEnsemble-FSO/RF, DQN-FSO/RF, and Actor/Critic-FSO/RF using Tensorflow with the DRL environment in OpenAI Gym framework 1 . The code for these DRL agents is available on the GitHub repository 2 . For each iteration, DRL agents are trained using 600 to 2000 episodes. The DQN-FSO/RF and DQNEnsemble-FSO/RF agents are created using Keras functions. The neural network has 5 layers; 3 hidden, one input, and one output layer. All three hidden layers consist of 300, 200, and 100 neurons, respectively. These layers are implemented using ReLu activation functions with the linear output layer. For both the DQNEnsemble-FSO/RF and DQN-FSO/RF agents, actions are selected using the Boltzman policy [41]. Our evaluations consider the use of Adam optimizer to minimize the loss function given in Equation 17. Other parameters including mini-batch size, learning rate, discount factor σ, and experience replay buffer size are given in Table I. D j ← (s j t , a j t , r j t , s j t+1 ) Store tuple (s j t , a j t , r j t , s j t+1 ) into replay memory 18 Batch mini ← sampling(D j ) Uniformly sample Batch mini from replay memory D j 19 Loss = (r j t + γmax aQ (s j t+1 , a ; θ − j ) − Q(s j t , a j t ; θ j )) 2 Calculate loss using SGD with respect to θ  in overestimation error of Q-value for FSO and RF switching. Figure 6 shows the mean reward for the DQNEnsemble-FSO/RF after interacting with the environment for episodes varying from 250 to 2000. The DQNEnsemble-FSO/RF achieves convergence of approximately 1500 episodes. It can be observed that in the early episodes, the reward value is low due to the limited learning. As the number of training episodes increase, the DQNEnsemble-FSO/RF gradually evolve and reward increases. The average reward per episode is significantly improved after 1000 episodes. After about 1500 training episodes, the reward flattens out smoothly, indicating DQNEnsemble-FSO/RF 's ability for successful FSO and RF link switching.  Figure 7 shows the loss value variation of the critic and actor neural networks for the Actor/Critic-FSO/RF agent. It can be seen from the figure that the average loss value of both the actor and critic decreases during the training process, which indicates that both the actor and critic reduces the error due to overestimations and helps the Q-learning. The loss curves show that the actor loss shows a dramatic decrease at the beginning of the training process, then the reduction gradually turns unstable. On the contrary, the critic loss is lower from the beginning and stays stable as the training continues. As a consequence, the action-value of the critic neural network achieves a higher reward. This, however, does not guarantee an optimal learned policy as the Actor/Critic-FSO/RF may overfit.

C. Results and Analysis
For DQNEnsemble-FSO/RF,DQN-FSO/RF, and MyOpic , we evaluate the switching cost for 6500, 8500, and 10, 000 episodes. During the training process, the target network policy  is synchronized with the action-value policy using the consensus of features of 10 threads. As shown in Figure 8, MyOpic with known P , i.e, 0.5 follows a round-robin fashion to switch policy and has the highest switching cost for all the episodes. MyOpic cannot use correlation among FSO, RF, and environment for policy switching. DQN-FSO/RF shows a significantly lower switching cost than MyOpic. DQN-FSO/RF agent can learn the FSO/RF system dynamics including correlation between FSO, RF, and environment, i.e., atmospheric conditions. The learned policy switching improves accumulated DQN-FSO/RF, thereby improving the FSO/RF system performance. In contrast to MyOpic and DQN-FSO/RF, DQNEnsemble-FSO/RF drastically reduces the policy switches that represent low switching cost suitable for FSO/RF hybrid systems operating under stable environments, such as atmospheric conditions. DQNEnsemble-FSO/RF's consensus criterion for policy switching achieves better performance with the minimal switching cost for 6500, 8500, and 10, 000 episodes. The consensus criterion switches the action-value policy decreases with an increase in the number of episodes. It results in a significant switching cost reduction compared to MyOpic and DQN-FSO/RF and remains robust than MyOpic and DQN-FSO/RF. Figure 9 investigates the first transition of the DQNEnsemble-FSO/RF execution with a varying number of samples. It can be observed from the Figure that DQNEnsemble-FSO/RF's mean error converges faster between 0 and 40 steps. The plot considers the error calculation over the initial 100 steps to calculate the mean error. Figure 10 plots the error of the DQNEnsemble-FSO/RF for the last transition for a sample captured during the agent execution. This error value for this transition is used to calculate the means to analyze DQNEnsemble-FSO/RF's learning performance. Similar to DQNEnsemble-FSO/RF, Figure 11 and Figure 12 show the first and the last transition of the DQN-FSO/RF agent, respectively. These samples represent the smoothest transitions during the agent execution, demonstrating faster convergence. Figure 13 and Figure 14 plots the behaviour Actor/Critic-FSO/RF for the first and last transitions, respectively. It is evident from the figure that the Actor/Critic-FSO/RF does not converge in contrast to DQNEnsemble-FSO/RF and DQN-FSO/RF. Further, for the first transition, its mean error remains significantly higher compared to DQNEnsemble-FSO/RF and DQN-FSO/RF, resulting in slow learning. The last transition, however, demonstrates a significantly lower mean error and is comparable to DQNEnsemble-FSO/RF and DQN-FSO/RF. Figure 15 demonstrates the stability of DQNEnsemble-FSO/RF, DQN-FSO/RF, and Actor/Critic-FSO/RF. The sta-bility, here, represents, the frequency an agent deviates from the median error for both the first and last transitions. As discussed, earlier, the last transition of each agent is used to calculate the median value as it indicates an agents' best performance. It can be observed from the Figure that DQNEnsemble-FSO/RF significantly deviates less from the median for the last transition in contrast to DQN-FSO/RF and Actor/Critic-FSO/RF. This proves DQNEnsemble-FSO/RF's stable learning for the first transition. Its count for the deviation from the median value for the last transition is comparable to the other agents. This shows that DQNEnsemble-FSO/RF exhibits overall better stability for both the first and the last transition attributed to its consensus-based representation learning to update the deployed policy. The Actor/Critic-FSO/RF agent demonstrates the least stability among all the agents, therefore, has slow learning performance.    the concept of ensemble consensus-based representation deep reinforcement learning for FSO/RF link switching for hybrid FSO/RF systems. The link switching optimization problem has been formulated to achieve the maximum long-term FSO and RF links utility as a whole while maximizing the link availability between the transmitter and receiver. Considering the non-convex and combinatorial characteristics of this optimization problem, we have applied actor-critic and DQN under a hybrid FSO/RF system with dynamic weather conditions. Compared with the actor-critic, the DQN algorithm achieves faster convergence. Further, to reduce the frequent switching of the deployed policy of DQN, we have proposed a consensus-based representation DQN called DQNEnsemble-FSO/RF for FSO and RF link switching. Experiment results show that the DQNEnsemble-FSO/RF outperformed DQN-FSO/RF, Actor/Critic-FSO/RF, and MyOpic with faster convergence while maintaining switching cost significantly low under time-varying weather scenarios. We believe this work is the first step towards the application of DRL for the link switching problem with consideration to low switching cost  for hybrid FSO/RF systems. One interesting direction is to design a deep Q-network algorithm with provable guarantees and generalization that can consider the switching cost for a larger state space compared to the states considered in this work.
ACKNOWLEDGEMENT This work is supported by the Letterkenny Institute of Technology, Co. Donegal, Ireland.