Sensor-Augmented Neural Adaptive Bitrate Video Streaming on UAVs

Recent advances in unmanned aerial vehicle (UAV) technology have revolutionized a broad class of civil and military applications. However, the designs of wireless technologies that enable real-time streaming of high-definition video between UAVs and ground clients present a conundrum. Most existing adaptive bitrate (ABR) algorithms are not optimized for the air-to-ground links, which usually fluctuate dramatically due to the dynamic flight states of the UAV. In this paper, we present SA-ABR, a new sensor-augmented system that generates ABR video streaming algorithms with the assistance of various kinds of inherent sensor data that are used to pilot UAVs. By incorporating the inherent sensor data with network observations, SA-ABR trains a deep reinforcement learning (DRL) model to extract salient features from the flight state information and automatically learn an ABR algorithm to adapt to the varying UAV channel capacity through the training process. SA-ABR does not rely on any assumptions or models about UAV's flight states or the environment, but instead, it makes decisions by exploiting temporal properties of past throughput through the long short-term memory (LSTM) to adapt itself to a wide range of highly dynamic environments. We have implemented SA-ABR in a commercial UAV and evaluated it in the wild. We compare SA-ABR with a variety of existing state-of-the-art ABR algorithms, and the results show that our system outperforms the best known existing ABR algorithm by 21.4% in terms of the average quality of experience (QoE) reward.


I. INTRODUCTION
Inexpensive commercially available unmanned aerial vehicles (UAVs) are rising rapidly, making drones a popular host of a wide class of applications, including environment monitoring [1], precision agriculture [2], photography [3], policing [4], firefighting [5], and package delivery [6]. An essential functionality enabling these applications is to record high-definition videos of superior quality and seamlessly share them with ground base stations or clients for manual inspection and further analysis.
Despite the excitement, today's UAVs are struggling to deliver high-quality video in real time to ground receivers. Today's commercial UAVs adopt fixed-bitrate video streaming strategies which may result in severe rebuffering under poor X. Xiao, W. Wang channel conditions [7]. In addition, many studies have adopted various kinds of adaptive bitrate (ABR) algorithms [8]- [30], including learning methods [20]- [30], under various network conditions on the ground. These algorithms make ABR decisions based on network observations and video playback states. However, it is challenging for them to fit well in UAV communications, as the channel capacity of air-to-ground links fluctuate dramatically and the primary causes come from factors including varying environments and dynamic motion states, such as flight velocities, intense vibrations and distances from the ground clients. These factors result in unique patterns in the channel capacity variances, which can hardly be learned from models built for ground-to-ground links. Consequently, the majority of ABR algorithms either fail to transmit higherquality video streaming [9] or exceed the channel capacity [11] due to unexpected situations. To break this stalemate, dedicated models tailored for air-to-ground links are required to cope with such unique variance patterns.
Instead of solely relying on the network observations and video playback states which are not sufficient enough to adapt to the highly dynamic air-to-ground links, we argue to incorporate more inherent sensor data that can reflect UAV flight states in the ABR algorithm. Through field tests and measurements, we observe that the UAV's flight-state-related sensor data can provide hints about channel variance patterns, which can guide the design of ABR algorithms. In addition, the temporal patterns in the past throughput variances can be further extracted and exploited to obtain valuable information about current channel conditions. Thus, we believe it is essential to incorporate the flight-state-related sensor data as side information to design video streaming strategies for UAVs.
In this work, we present SA-ABR, a new sensor-augmented system that generates ABR video streaming algorithms based on deep reinforcement learning (DRL) [31], [32], which aims at obtaining optimal bitrate selection strategies under varying UAV channel conditions. The goal of SA-ABR is to maximize the video quality of experience (QoE) [33], [34] for viewers through the training process. As illustrated in Fig. 1, apart from the state information of past throughput experience and video playback, SA-ABR also feeds the inherent sensor data, including GPS coordinates, acceleration and velocity, which indicates the flight state of the UAV, into the neural network. The sensor data is updated in real time at the beginning of each video chunk. Additionally, the average throughput of past video chunks is calculated by recording the number of packets. The focus of our model is on how to capture the salient features from the time-series throughput sequences and make full use of the sensor data to better estimate the future throughput trend. After the training process, our model can automatically adapt to the throughput dynamics and make optimal bitrate decisions for the next video chunks.
A key challenge in our design is how to make full use of the sensor data to extract features that are indicative of throughput dynamics. Although there are some relations between the sensor value and the throughput, it is prohibitively complex to describe these relations in analytical expressions or clear rules. For example, the acceleration pattern is generally very misleading due to the existence of the UAVs' own vibrations, making it intractable for the DRL model to distinguish whether the acceleration data comes from the change of flight states or vibrations. To overcome this hurdle, SA-ABR applies quantization-based preprocessing to sensor data before directly feeding it to the neural network. This not only ensures the full use of the sensor data that provide hints about channel conditions, but also eliminates irrelevant noise and disturbance. Another obstacle stems from how to effectively analyze the temporal characteristics of throughput when making predictions about future throughput. We incorporate the long short-term memory network (LSTM) [35] into the DRL model, which exploits the unique memory function of the LSTM to better capture the temporal properties and improve the accuracy of throughput forecasts.
We implement SA-ABR on a DJI Matrice 100 and compare the performance of our system with state-of-the-art ABR algorithms in the wild. The results show that SA-ABR achieves up to a 21.4% gain in the average QoE reward over the best known existing ABR algorithm [24].
The main contributions of this paper are summarized as follows.
• We conduct a comprehensive measurement study to explore the impact of UAV's motions on throughput, which provides hints to optimize the video streaming strategies from the flight-state perspective. • We propose a new DRL-based ABR architecture with the assistance of the sensor data. The model exploits the inherent sensor data that is used to pilot UAVs to better adapt to the highly dynamic air-to-ground links. • We implement our design on a commercial UAV and conduct a series of experiments in the wild to validate our system. The results demonstrate the feasibility of adapting to the air-to-ground channel dynamics, resulting in a 21.4% increase in the average QoE reward compared to the best known existing ABR algorithm. The remainder of this paper is structured as follows. We begin in Section II to explore the impact of the UAV's flight states. Section III describes the system design of our sensoraugmented DRL algorithm. Section IV describes the system implementation and Section V evaluates the performance of SA-ABR. Sections VI and VII present the related work and conclusion.

II. EXPLOITING FIGHT STATE AWARENESS
In this section, we start by giving a brief introduction of the flight-state-related sensor data available on UAVs. Then, we conduct experiments in controlled flight states to reveal the specific relationship between throughput and the sensor data. Finally, we proceed to take a deeper inspection of the complex relationship and summarize counter-intuitive observations and irregular phenomena, which motivates our DRL-based design.

A. Flight States of the UAV
UAVs such as multi-rotor drones need to identify their flight states at all times, including 3D position, 3D orientation, and their derivatives. Therein, the positions and velocities are important data for the UAV to determine whether it is hovering or moving. As UAVs normally adjust the postures to generate thrusts in certain directions, they also need to measure their own current 3D orientations in real time. Together with corresponding accelerations and angular velocities, there are a total of fifteen state quantities that are required to identify the flight states.
With various sensor technologies, including GPS, inertial measurement unit (IMU), barometer and geomagnetic compass, equipped on UAVs, we can obtain all fifteen state quantities that comprehensively reflect the flight conditions. To explore how the flight states affect the air-to-ground channel conditions, we collect the sensor data, including GPS coordinates, velocities, accelerations and further analyze the relationship between sensor data and throughput.

B. Impact of Flight States
As the capability of throughput forecast plays an essential role in the ABR video streaming algorithm to make bitrate selection meeting viewers' QoE requirements, we start with a series of tests to analyze the underlying relationship between the sensor data and the throughput in controlled flight states. In these tests, the transmitter is a DJI Matrice 100 UAV and sends the data file through the IEEE 802.11n protocol. The ground receiver uses the commercial WiFi network card with a USB interface embedded on the laptop.
The sites of measurements are selected to validate the generalization of our observations, including a playground, a plaza and a pool on campus, each with its own channel characteristics that cover a majority of different scenarios. The air-toground propagation on the playground can be described as an ordinary two-ray model [36]. Different from the unobstructed playground, the plaza is surrounded by buildings and trees. Under such circumstances, the propagation is affected by the    shadowing losses and the multipath diversities. Moreover, the surface reflectivity and roughness of the pool are different from the ground, resulting in varying parameters in propagation models. For each flight state, we collect data lasting more than 150 s in each place. Impact of distance. We perform a set of tests to analyze the impact of the distance between the ground client and the UAV on throughput. This set of experiments includes two groups of measurements according to the UAV's flight states, i.e., the hovering and moving states. In the hovering experiment, we collect throughput and sensor data when the UAV hovers at a height of 10 m and the link distances vary from 10 m to 60 m. In the moving experiment, we consider a higher altitude of 20 m for safety reasons, with various distances ranging from 20 m to 60 m. In addition, the UAV is controlled to fly at different distances at a constant velocity of 8 m/s.
The experimental results are presented in Fig. 2. From the mediums, the quartiles and the ends of each boxplot, we can conclude that the throughput decreases with distances no matter whether the UAV is moving or hovering. This rule provides a basis for SA-ABR to incorporate the distance value that affects the throughput, into the algorithm.
Impact of velocity. The experiments with different velocities are also conducted by dividing the testing process into two sets: one is at a distance of around 20 m and the other is around 50 m. We control the UAV to fly around the ground client at stable distances while the velocity sweeps from 0 to 16 m/s.
The throughputs achieved at different velocity ranges (in-cluding 0-4 m/s, 4-8 m/s, 8-12 m/s, >12 m/s) are shown in Fig. 3. The throughput diminishes quickly when the velocity range increases, no matter whether the link distance is around 20 m or 50 m. Based on the impact of velocity on throughput, we can exploit the velocity data in our algorithm design to better forecast throughput. Impact of acceleration. To obtain a better bitrate adaptation model, we further perform tests and investigate the impact of acceleration. The acceleration data includes three dimensions: a x , a y , a z . During the flight, the UAV continuously accelerates and decelerates while the distance from the ground client remains stable.
The results are demonstrated in Fig. 4. For the acceleration data, the low value is dominated by the UAV vibrations, while the high value can indicate the changes in flight states. Thus, we can pick out the high values of acceleration data to analyze their impact on throughput. Note that the variances in acceleration and velocity are synchronous to some extent, which may compromise the impact of acceleration data on throughput prediction. Nevertheless, when the acceleration increases rapidly at 8s, the velocity value has not reached large enough to determine if the channel quality becomes worse. Therefore, the utilization of acceleration data can make up for this weakness in our algorithm and serve as a supplement to velocity data to perform better throughput forecast.
Summary. The general relationships between the sensor data and the throughput in the controlled flight states can be summarized as follows: (1) the throughput monotonically decreases as the distance and the speed increase, and (2) the acceleration fluctuations are able to reflect the throughput changes, i.e., the larger the variance in acceleration data, the more likely the throughput will be affected. These rules exist due to complex latent factors including the path loss, the multipath effects, the modulation coding scheme (MCS) conversions and the fast changes in environments caused by the high-speed movements of the UAV. Thus, the flight-staterelated sensor data is indicative of channel state information, which provides hints for SA-ABR to enhance the forecast capability and achieve the best QoE from the flight-state perspective.

C. Deeper Inspection
The above experiments are conducted with preset or controlled flight states. In this part, we proceed to conduct experiments where the UAV is allowed to fly on random paths at arbitrary speeds in various environments (see Fig. 8), to take a deeper investigation of the relationship between throughput and sensor data. The analyses include three aspects: throughput vs. distance, velocity, and acceleration, respectively.
The detailed results of throughput vs. distance and throughput vs. velocity are visualized in Fig. 5. We first observe the general rule in Fig. 5(a), i.e., the throughput decreases with velocities. However, the throughput value at lower distances covers almost the entire range (0-16 Mbps), as indicated in the bottom and top edges of the boxplots. The reason for this phenomenon may be the uncertainties caused by the rapidly changing velocities of the UAV in the wild. In addition, the cumulative distribution function (CDF) in Fig. 5(b) further demonstrates that for lower distances, the throughput is more likely to be distributed in the higher numerical area and less in the lower area, while the throughput at high distances follows an opposite pattern. This phenomenon transforms the regular impact characteristics of distances into a probabilistic problem with uncertainty due to the changing velocities, which is more complex than what we observed in previous experiments. Similar phenomena are also observed in the experiments regarding velocity (see Fig. 5(c) and Fig. 5(d)).
After deeper inspection, some counter-intuitive observations can also be noted in the acceleration data. For example, during the deceleration phase (see Fig. 4 at around 38 s), the velocity curve drops and the throughput shows an upward trend. The acceleration data, however, shows a sharp fluctuation due to the sudden change in velocity. These irregular phenomena occasionally happen when the impact of acceleration data on throughput contends with other influencing factors, such as distance and velocity, which might result in a misjudgment for the throughput predictor.
Summary. Based on these irregular phenomena and counter-intuitive observations, we observe that the monotonicity in relationships between sensor data and throughput is not as clear as the experiments in controlled flight states. For example, the UAVs at low velocities do not necessarily lead to high-quality wireless channel due to the dominant influence of path loss at long link distance. In other words, various sensor data comprehensively affects the throughput, which makes the conventional ABR algorithms prohibitively complex to describe these relations in analytical expressions. This problem motivates us to exploit neural networks without  relying on preconfigured analytical expressions. Through the training process, the neural networks can gradually learn the experience to cope with the irregular phenomena and extract effective features from these complex relations to improve forecast capability.

III. LEARNING SENSOR-AUGMENTED ALGORITHMS
SA-ABR generates ABR algorithms based on the DRL model and LSTM network. The objective of SA-ABR is to maximize the expected rewards of user feedback over the whole video. Thus, instead of simply using neural networks to emphasize each temporal step of video playback, DRL enables SA-ABR to focus on the overall performance and generates the optimal bitrate selection policy over the whole video sequence. Furthermore, SA-ABR can take advantages of DRL to essentially improve the bitrate selection mechanism by forcing the agent to automatically learn better strategies without manual configuration about the throughput traces and video states.
We first design a training methodology to faithfully model the dynamics of video streaming in client applications, which accelerates the training process. Then, we introduce the quantization-based preprocessing performed on sensor data before directly feeding it to the networks. Finally, we characterize the DRL training process in various aspects. As shown in Fig. 6, the training algorithm and the networks are established based on the DRL policy. The networks receive a variety of inputs (e.g., the video states, the sensor data) through data sampling process and output bitrate selections for future chunks. The reward is an assessment of video quality, which motivates the network parameters constantly updated to achieve better video quality. The DRL training process is implemented as a prior task and our ABR model is running on the ground client.

A. Training Methodology
The first step is to design a training methodology that faithfully models the dynamics of video streaming. In fact, using actual video clients for training need to employ a video player to continuously download videos and observe video state changes. This process is very time-consuming since the download time is long and the model cannot be updated until all video chunks are downloaded. For example, the video in our experiment is set to have 41 chunks, with each chunk lasting two seconds. That is to say, the model needs to wait tens of seconds before being updated.
In order to save the video download time and accelerate the training process, our training methodology directly calculates the new video states (including the buffer occupancy and the rebuffering time) based on current information. The buffer occupancy, shown as the progress bar of video players, indicates how long the video can continue to play. Moreover, video transmissions from UAVs are mainly live streaming, which may have a time-to-live requirement of 15-45 s. This bounds the buffer level that video players can build [17]. Thus, we set the maximum buffer boundary and the maximum rebuffering time to 20 s. Once the buffer level or rebuffering time exceeds this boundary, our model will be punished and obtain a very low QoE reward. Additionally, there exists a half of the roundtrip-time (RTT) delay derived from the video requests sent by the client to the UAV. However, the delay is below the millisecond level which has been proved to have minimal impact on the chunk-level ABR systems [24].
At the end of each video chunk t's download, the update of video states can be divided into two cases. First, if the download time f t of the video chunk t is less than the beginning buffer value b t (b t < 20 s), no rebuffering will happen. We update the new buffer size b t+1 by subtracting the download time f t , and then adding a two-second duration of one chunk t chunk . The updated buffer size b t and the rebuffering time T t can be expressed as Therein, the download time f t solely relies on the video chunk's bitrate selection l t and network throughput traces x trace,t . The throughput traces x trace,t employed are collected in advance by keeping track of the wireless channel quality of UAVs in the wild. The available video bitrates in our experiment are {300, 750, 1850, 2850} Kbps that correspond to video types of {240, 360, 720, 1080} p.
For the second case where the download time f t of the current video chunk exceeds the beginning buffer value b t , the rebuffering occurs. In these scenarios, our model is configured to wait for 500 ms before retrying to request the playback of next video chunk. In addition, the video chunks cannot be played until they are downloaded. Thus, the buffer size and rebuffering time are updated by b t+1 = t chunk , After each chunk is downloaded, SA-ABR passes new observations of video states, including the buffer size b t+1 and rebuffering time T t , to the RL agent. The agent then assesses the video QoE and obtains the reward to periodically update the policy. Guided by the policy, the agent makes the next bitrate decisions based on the received states. Then, new video states are regenerated by Eq. (1)-(2) for the next round of update.

B. Preprocessing sensor data
Recall that the general relationships between the inherent sensor data and the throughput are summarized in Section II. We incorporate the sensor data into SA-ABR to provide hints about channel variance patterns. However, the raw sensor data (such as the acceleration patterns, shown in Fig. 4) keeps fluctuating. These noises, incurred by UAV vibrations, have little impact on throughput, while the resulting uncertainty in sensor data can interfere with the model's prediction of future throughput. Moreover, when the link distance is relatively short, the path loss is dominated by the constructive and destructive interference caused by the multipath effect [37]. That means, the distance increment within a closer area has little impact on throughput (shown in Fig. 2(a)). However, such a distance change may interfere with the model's throughput forecast. Therefore, in order to ensure the full use of the sensor data that is indicative of throughput dynamics while eliminating these noises and disturbances, we quantize the sensor data according to the degrees of its impact on throughput, instead of directly feeding it to the neural network.
The quantization scheme is designed as follows. Recall that the available video bitrates are {300, 750, 1850, 2850} Kbps. Thus, the throughput for video transmission can be roughly divided into <0.75 Mbps, 0.75-1.85 Mbps, 1.85-2.85 Mbps and >2.85 Mbps, each of which can satisfy the corresponding video bitrate, with an average interval of 0.95 Mbps. That is to say, when the throughput drops by 0.95 Mbps, the optimal bitrate selection may change. Then, we sort the throughput in ascending order of the corresponding sensor data and move a sliding window to obtain the average throughput. The experimental data is from Section II.C and the UAV is allowed to fly on random paths at arbitrary speeds. When the average throughput drops by 0.95 Mbps, the corresponding sensor value is set as a quantization threshold. This quantization process is for the overall value of the sensor data, and it is not necessary to consider the partitions of the 3D state space. After traversing the entire experimental data corpus, we can obtain the quantization results as follows.
• Preprocessing distance data. We encode distances over 50 m into "1", and distances within 50 m into "0". • Preprocessing velocity data. The first level "0" represents velocity below 8 m/s, and the second level "1" indicates velocity within 8-12 m/s, while the third "2" is velocity over 12 m/s. • Preprocessing acceleration data. The acceleration data which exceeds 18 m/s 2 is marked as "1", while the other is marked as "0".

C. DRL training process
We use the Advantage Actor-Critic [38], [39] method to generate ABR algorithms with the assistance of sensor data and LSTM networks. The training algorithm is based on onpolicy policy. Although both generated by DRL algorithm, SA-ABR is very different from Pensieve [24]. SA-ABR first incorporates the sensor data as input to accommodate the changes in the UAV channel. Then, it quantizes the sensor data to eliminate the noise and disturbance in the UAV channel. Moreover, it also explores the role of the LSTM network in analyzing past throughput sequences and predicting future changes. To summarize, SA-ABR takes into account the flight states of UAVs and is optimized to improve QoE in UAV video streaming, which are brand new compared to existing DRL-based solutions, including Pensieve [24].
Input and network. We take the current state s t as input to the two neural networks. As shown in Fig. 7, s t is defined as s t ( u t , v t , x t ) = (d t , p t , a t , b t , l t−1 , x t ). The subscript t indicates that the model has finished downloading chunk t − 1 and intends to choose chunk t. The UAV's state u t refers to its motion characteristics, obtained at the beginning of each video selection, which consists of distance d t , velocity v t and acceleration data a t . The video playback state v t consists of the buffer size b t and last bitrate selection l t−1 .
The vector x t represents the average throughput of past eight chunks. In short, our input consists of five parameters and a 1 × 8 vector. The typical input dimensions of RL-based ABR algorithms [20]- [25] range from two parameters [23] to 25 × 64 × 36 matrices [25].
As shown in Fig. 7, the past throughput data {x t−8 , ..., x t−1 } is fed into an LSTM network in time order for feature extraction. We choose the LSTM network because it can make full use of the temporal characteristics in the throughput sequence. That means, the earlier the throughput, the smaller its impact on the throughput forecast. This advantage improves the forecast capability and prompts us to choose the LSTM network instead of convolutional neural network (CNN). Then, the feature vectors obtained from the LSTM network are concatenated with other state information and finally fed into the hidden layers. Although using the same structure, the actor network and the critic network are separate and have different output.
Deep reinforcement learning policy. Almost all RL problems can be formulated as Markov decision processes (MDPs) [16], [40] to achieve the optimal solutions. Generally, the whole MDP consists of a state set S, an action set A and a reward set R, each of which can be expressed as a sequence tuple M = {s(t), a(t), r(t), s(t + 1)}. In our system, s(t) denotes the current state at video chunk t and a(t) indicates the selected video bitrate based on the current state. The reward r(t) entirely depends on the states and model's reactions and is expressed as r(s(t), a(t)). In the context of video streaming, each time a video chunk is downloaded, SA-ABR obtains a reward to evaluate the current state and action. The discounted cumulative reward can be expressed as where γ ∈ [0, 1] denotes the discounted factor, and R t represents the discounted cumulative reward from time chunk t to the end. As shown in Fig. 7, two neural networks are included in our proposed model. The goal of actor network is to find a strategy π : π θ (s, a) → [0, 1] to maximize the total reward. In our system, π θ (s, a) is the probability distribution over different video bitrate choices. With this distribution, each video bitrate is selected based on its probability via a stochastic policy, i.e., the one with the highest probability is the most likely to be picked up. The duty of critic network is to make an objective assessment V (s t ; w) for the current state s t .
Nevertheless, SA-ABR does not directly increase the discounted cumulative reward R t as the update direction [39]. Instead, R t is subtracted by a baseline b t , and R t − b t can be replaced by the advantage function A π θ (s t , a t ) = Q π θ (s t , a t ) − V (s t ; w) in the network. This represents the difference in the cumulative reward between the expected value and the actual value after selecting the action a t based on policy π θ at s t .
Training algorithm. The key step in the actor network is to calculate the advantage function A π θ (s t , a t ). In our system, we use the n-step Temporal-Difference (TD) method [41] to calculate the advantage function in the actor network, which is given as where γ ∈ [0, 1] denotes the discounted factor. Q π θ (s t , a t ) is not simply the discounted cumulative reward from chunk t. Instead, it sets the final reward as V (s t+n ; w), which is the assessment from the critic network of chunk t + n. In our experiment, the subscript t + n refers to the end chunk in a video. By performing the subtracting operation, we can finally obtain the advantage function A π θ (s t , a t ).
At the training phase, the goal of the actor network is to maximize the advantage function, i.e., making better decisions than the current policy. Thus, the parameter of the actor network θ is updated via a stochastic gradient ascent algorithm where α is the learning rate. ∇ θ log π θ (s t , a t ) shows how to change the parameter θ in order to achieve the goal. Additionally, in order to improve the generalization capability of the network, SA-ABR applies the dropout technique to reduce overfitting and add a regularization term to the update of the actor network. This term is the entropy of the probabilities over bitrate selections H(π θ (·|s t )), which encourages exploration and prevents overfitting. For the critic network, it aims at making an accurate assessment for all the states of experiments during training. We use the standard TD method to calculate the loss function of the critic network and minimize the value. Therefore, we can update the parameter of the critic network w through a stochastic gradient descent algorithm (6) where α is the learning rate, V (s t ; w) and V (s t+1 ; w) are respective assessments from the critic network of chunk t and chunk t + 1.
Data sampling. Based on the on-policy learning algorithm, the RL agent is updated periodically as data arrives, and then follows the updated strategy to sample the new data. To reduce the correlation between the data sampled from one agent and accelerate the training process, we run ten agents in parallel to experience different states, transitions and environments. These elements form a minibatch of {s t , a t , r t , s t+1 } tuples and are sent back to the central agent. The central agent then uses the actor-critic algorithm to compute the policy gradient (Eq. (5) and Eq. (6)) and updates the networks. Note that this algorithm does not require replay memory (e.g., Deep Q-Network (DQN)) and the extreme version can be directly trained on video clients to adapt to the varying UAV conditions, which shows the advantages of using actor-critic algorithm to adapt to the UAV video transmission.
Reward. Reward r is given after each chunk is downloaded. It reflects the performance of each bitrate selection according to whether the video quality meets the requirements of viewers. In our system, we consider a general QoE metric [14], [24] as a reward judging criterion, which is defined as where q(l t ) represents the user perception for video bitrate l t , T t the rebuffering time and |q(l t )−q(l t−1 )| the jitters between video chunks. Thus, the QoE is determined by three factors including the bitrate utility q(l t ), the rebuffering penalty µT t and the smoothness penalty |q(l t ) − q(l t−1 )|.
The QoE log is chosen because this kind of metric does not pursue excessive clarity, for the increase in reward gradually shrinks when switching to high bitrate selection. Therefore, it is more practical to decline the rebuffering time and improve the smoothness to maximize the reward. This preference is also very suitable in the video transmission scenario, since UAVs are often used for real-time video capturing and transmission.

IV. IMPLEMENTATION
This section encompasses three aspects. To begin with, we characterize the neural network architecture and all the hyperparameter settings during the training process. Next, we give a brief introduction of our UAV platform. Finally, we elaborate on the collected network traces used in our experiment.
Neural network architecture. In this part, we elaborate on the specific design of our neural network architecture and all the hyperparameters in the experiment. First, we feed a sequence of past eight chunks' throughput in time order to an LSTM network, which is constructed with two-layer LSTM cells, with 64 hidden unites each. Each input contains one throughput in the past and the step size is one. Then, the resulting vector from this LSTM network is flattened and combined with other inputs including video playback states and UAV's flight states before being imported to two fully connected layers, with 30 and 10 hidden units, respectively. The actor network and the critic network have the same input and structure, while they are different in network parameters and output. We add a softmax layer and obtain a probability distribution of the bitrate selections for the actor network, while setting the state evaluation as output for the critic network. Furthermore, the input sizes of both networks are 13. Within the training period, we set the discount factor γ to 0.99, and configure the learning rates α and α to 3 × 10 −5 and 1 × 10 −2 , respectively. Additionally, the reward factor µ is set to 2.26 according to the QoE metric we choose.
Hardware setup. As shown on the right part of Fig. 8, we build a wireless link between a UAV and a laptop on the ground through the IEEE 802.11n protocol. SA-ABR is a client-based model and the key ABR algorithm runs on the laptop. An Android smartphone is attached on our UAV platform, DJI Matrice 100, and transmits the video and sensor data to the laptop on the ground. Additionally, the data file is programmed to be transmitted through a WiFi channel, which is different from the control channel of the UAV to avoid interference. We use the 2.4 GHz band for transmission with a channel bandwidth of 20 MHz. During the transmission process, the laptop on the ground calculates the number of TCP packets in the application layer per second to obtain the average throughput, which tracks the wireless-link dynamics. Another function of the laptop is to emulating the video playback states, which we specifically describe in Section III. Based on these available messages, SA-ABR can gradually adapt to the throughput dynamics through the training process.
Network traces. In order to model the real-world wireless channel condition on UAV, we collect the throughput data by flying the UAV in the wild. Since the available video bitrates in our experiment are {300, 750, 1850, 2850} Kbps, the throughput is multiplied by weight to match the video quality, which is common in the scenes where the UAV transmits videos to multiple clients. The experimental sites includes a playground, a plaza and a pool. The flight trajectories are randomly distributed in these areas and the flying velocities range from 0 to 19.5 m/s. The height of the UAV is set at around 25 m for safety. We record a total of 1000 throughput traces, with each trace spanning 100 s. In our experiment, we use a random sample of 80% in the data corpus as the training set, while the remainder 20% is used as the test set. The throughput ranges from 0 to 20 Mbps.

V. EVALUATION
In this section, we conduct a series of experiments to evaluate SA-ABR from three aspects as described below.
• How does SA-ABR compare with state-of-the-art ABR algorithms in terms of video QoE? We test several ABR schemes including kinds of fixed control rules and RL algorithms, and then perform comparative experiments with SA-ABR. The result shows that SA-ABR always performs better compared with other algorithms and is able to outperform the best ABR schemes by 21.4% in terms of average QoE value (Figs. 9, 10, and 11). • Does SA-ABR benefit from LSTM network? In the framework design of SA-ABR, we exploit the LSTM network to extract the time-series features from the past throughput experience. To specifically evaluate the advantage, we propose a baseline model that is similar to our network architecture, but replacing the LSTM network with CNN. By comparing these two models, we find SA-ABR still presents its improvements in average QoE (Fig. 12). • What is the advantage of feeding various sensor data into the neural network and can the network effectively filter out the confusing information and extract useful features from it? We conduct an experiment to compare SA-ABR with the same network architecture without sensor assistance. Results in Fig. 14 show the performance improvement for SA-ABR with the assistance of sensor data.

A. SA-ABR vs. Existing ABR Algorithms
We compare SA-ABR with a variety of existing stateof-the-art algorithms which generate the ABR algorithm in completely different ways including fixed control rules and RL. These algorithms perform bitrate adaptations mainly based on the past throughput experience and video playback states without the assistance of sensor data. The detailed principles of these algorithms are illustrated below.
• Buffer-based policy [11] is an algorithm that chooses the video bitrate only based on the playback buffer occupancy. The goal is to reach balanced states that ensure the avoidance of unnecessary rebuffering while maximizing the average video bitrate. The model is manually configured to keep the buffer occupancy above five seconds and when the buffer occupancy exceeds 15 s, the highest available bitrate is automatically selected. • Rate-based policy [9] exploits the harmonic bandwidth estimator to compute the harmonic mean of the last five throughput samples, which provide robust bandwidth estimates for future chunks. Thus, this model can automatically select the highest bitrate that does not exceed the expected channel capacity. • MPC [14] proposes a concrete ABR workflow that can optimally combine the advantages of future throughput prediction and buffer-based functions. The algorithm uses the same approach as Rate-based models to provide throughput forecasts, based on the past throughput trajectory. Then, MPC can map the collected information including the throughput prediction value, previous bitrate and buffer occupancy to future bitrate selections of video chunks. • Pensieve [24], which is based on the RL algorithm, has been experimented to use in the video bitrate adaptation subject with no pre-programmed control rules or explicit assumptions of the environments. The model uses CNN to extract effective features from the input data, including the past throughput trajectories and video states, and learns automatically through the RL algorithm to make better ABR decisions. In our experiment, SA-ABR is trained to obtain the optimal policy for higher QoE metric rewards, using the training set described in Section IV. Although SA-ABR is generated from the limited training set, its performance can be extended to the test period in which SA-ABR can still make right decisions when encountering states that are never present in the training set. The reason is that what SA-ABR learns through DRL in the training process is not just the limited state-action pairs, but a continuous neural network function that maps the successive state space to actions. Moreover, the parameters of the aforementioned existing ABR algorithms are also adjusted accordingly to adapt to the varying UAV channel capacity. We evaluate the performance of all the ABR algorithms based on the same test set (Section IV). In addition, we use the same QoE function (Eq. (7)) to assess all the ABR algorithms. Besides, three components (Eq. (7)) of the QoE definition, including the bitrate utility, the rebuffering penalty and the smoothness penalty, are also analyzed to better evaluate the video performance. Fig. 9 shows the average and variance values of QoE for one video chunk. Note that the average QoE reward of SA-ABR is 21.4% higher than that of Pensieve, which presents as the best known ABR algorithm. The detailed causes of the QoE improvement are represented in the following histograms. The main reasons for the gain in the average QoE compared with Pensieve are improvements in bitrate utilization and smoothness. The average bitrate utility exceeds Pensieve by 10.8% while the smoothness penalty is reduced by 35.3%. As mentioned above, the characteristics of the QoE log metric lead to its slower growth in value as the bitrate increases, i.e., the reward of selecting higher bitrates (1850 Kbps and 2850 Kbps) may not counteract the rebuffering and smoothness punishment to some extent. However, keeping playing videos at lower bitrates (300 Kbps and 750 Kbps) all the time will undoubtedly affect the users' viewing experience. With the assistance of the LSTM network and sensor data, our RLbased system can better weigh the gains and losses of choosing higher video bitrates, i.e., increasing the average bitrate utility in smoother trend on the basis of no rebuffering increases. It is a step forward in ABR video streaming algorithm under the UAV channel environments.
In addition, as illustrated in Fig. 9, we observe that the bitrate utility of SA-ABR and Pensieve all present lower than MPC and buffer-based algorithms. The reason accounting for this phenomenon is that the DRL algorithm prompts SA-ABR to achieve performance gain in a more balanced way. Thus, although not achieving the maximum bitrate utility, SA-ABR has the minimum rebuffering time and the highest smoothness, which achieves a balanced state in three components of the QoE metric. In contrast, MPC and bufferbased algorithms perform poorly in decreasing rebuffering and improving smoothness. The distributions of three QoE components are also explicitly exhibited in Fig. 10 in the form of CDF, which show gaps between different ABR algorithms. Nevertheless, to further increase the average video bitrates is a constant challenge we need to overcome in the future. Fig. 11 (top subfigure) first depicts the network throughput traces and respective bitrate selections made by MPC, Pensieve and SA-ABR over a period of video in our data corpus. We can observe that MPC selects the highest bitrate (2850 Kbps) at 56 s. However, it immediately switches to a lower bitrate (750 Kbps) when the throughput begins to fall. Throughout the entire playback process, the bitrate selections of MPC fluctuate constantly with the throughput dynamics, which gives viewers bad experiences. As for Pensieve, the model does not make full use of the channel capacities and switches to a lower bitrate at 56 s due to the uncertainties in the future even though the current throughput is still very high. In contrast, SA-ABR is courageous to select the high bitrate (1850 Kbps) at 48 s and keep the bitrate for a while for video smoothness, which verifies the forecast accuracy and the ability to balance the bitrate utility and buffer occupancy. Moreover, Fig. 11 (bottom subfigure) further shows the changes in buffer occupancy corresponding to each chunk' s bitrate selection for these three ABR algorithms. Compared with other algorithms, SA-ABR can make full use of the buffer occupancy, while the other models waste a lot of buffer resources.

B. LSTM Network vs. CNN
SA-ABR applies the LSTM network to extract effective time-series features from the past throughput experience, which is described in detail in Section III. However, despite the fact that it outperforms all the listed state-of-the-art ABR algorithms, it still cannot certify whether SA-ABR benefits from the LSTM networks, as Pensieve lacks the assistance of sensor data to become the comparative experiment. Therefore, we set a baseline model which has the same architecture as SA-ABR but replaces the LSTM network with CNN.
The results of comparisons are shown in Fig. 12. SA-ABR's average QoE is 17.5% higher than the baseline and the gain comes from its ability to limit rebuffering and smoothness penalty. Therein, SA-ABR reduces rebuffering penalty by 88.6% through maintaining sufficient buffer occupancy to handle the risk of unpredicted fluctuations in channel capacity. This phenomenon indicates that the LSTM network masters the dramatically varying features of communication dynamics through analyzing past throughput experience. Additionally, with the assistance of the LSTM network, SA-ABR decreases the smoothness penalty by 49.4%, based on the robust predictive function, which provides a more comfortable viewing experience. Moreover, to analyze how many past throughput samples are necessary to be fed to the LSTM network for better throughput forecast, we conduct an experiment to compare several versions of SA-ABR, each with a different number of throughput samples. As shown in Fig. 13, compared to two throughput samples, eight throughput samples enable the LSTM network to extract more temporal information from the throughput sequence, which leads to a significant gain in the average QoE reward. However, when increasing the past throughput samples to 16, the QoE gain is marginal. That means, eight throughput samples are sufficient for the throughput prediction and we select the past eight throughput samples as input to the LSTM network.

C. Sensor Assistance vs. No Sensor Assistance
For the purpose of better understanding the QoE gains obtained from the assistance of sensor data, we analyze SA-ABR's performance on individual terms of the QoE metric. To avoid interference from other related factors, such as the network type, we present another baseline model for comparison which also has the same network architecture as SA-ABR but lacks the assistance of sensor data. This baseline model is also trained to obtain the optimal policy for higher QoE reward in the experiment.
Specifically, Fig. 14 shows the results of comparisons between SA-ABR and the baseline without sensor assistance. We observe that SA-ABR outperforms the baseline and the gain in the QoE reward ranges from 7.0% to 30.7%. The reason for such a variance in the performance gain is that the improvement from the sensor data is closely connected to the flight conditions of the UAV. When the UAV flies slowly and the channel is relatively stable, the benefit of the sensor data is marginal, resulting in a lower performance gain. Whereas, when the UAV flies at a high speed, it causes unpredicted fluctuations in the UAV channel capacity. In this case, the sensor data can indicate the throughput changes and provide hints for SA-ABR to enhance the forecast capability and achieve better QoE rewards.
Other evaluation metrics such as the bitrate utility and the rebuffering penalty also verify the important role of the sensor data. As shown in Fig. 14, SA-ABR increases the bitrate utility by 6.9%. Although the gain is not large, it still embodies the raising abilities to challenge high-definition video chunks, resulting from the enhanced predictive accuracy. Moreover, SA-ABR is able to minimize the rebuffering time while ensuring the bitrate utility of video chunks, even if the channel condition is poor. As depicted in Fig. 14, the reduction ratio of the rebuffering penalty reaches 57.1%. Furthermore, the change in the smoothness penalty is negligible, which indicates that the use of sensor data does not play a major role in maintaining sufficient smoothness.
To further verify the advantages of quantizing the sensor data, we conduct a comparative experiment in which we feed the raw sensor data into the networks. The results are shown in Fig. 13. Note that without the quantization process, the variance level of QoE increases while the average value declines, which indicates that the disturbance and noise from the raw sensor data prevent models from getting the optimal strategy. In other words, the quantization process eliminates the noise while ensuring full utilization of the sensor data.
VI. RELATED WORK ABR algorithm. The ABR algorithm essentially follows a dynamic selection mechanism that has been widely used in various fields [42], [43]. Existing ABR algorithms fall into two categories: fixed control rules [9]- [19] and learning method [20]- [30]. The majority of existing fixed control rules generate ABR algorithms based on the available bandwidth estimates (rate-based algorithms [9], [10]), playback buffer occupancy (buffer-based algorithms [11], [12], [18]) or the hybrid methods of combining these two approaches ( [13]- [16]). The rate-based algorithms first estimate the future available bandwidth according to past throughput experience, and then select the highest bitrate below the bandwidth. The bufferbased algorithms, however, only consider the current buffer conditions when making bitrate decisions. The hybrid methods integrate these two technologies, i.e., using future throughput estimates and buffer occupancy information to select the proper bitrates for future chunks. Based on these fixed control rules, Akhtar et al. [17] dynamically adjust the configurable parameters of rules to make ABR algorithms work better over a wide range of network conditions. Xie et al. [18] and Xu et al. [19] respectively propose a buffer-based ABR algorithm with dynamic threshold and a QoE-driven adaptive k-push algorithm for low-latency live streaming. However, all these ABR algorithms with fixed control rules need substantial preprogramming overhead, which is not suitable for adapting to the dramatically varying channel capacity of UAVs.
Recently, there has been a growing interest in developing the optimal learning-based ABR algorithms. Before Pensieve [24], A separate line of studies [20]- [23] propose to generate ABR algorithms based on reinforcement learning. However, all of these algorithms store the value function for all states instead of using value function approximation, which cannot generalize to large state and action space. Pensieve [24] is the first model to apply the actor-critic network to the ABR algorithm which learns the optimal policy automatically. In addition, QARC [25] employs a DRL model to select the bitrate by jointly considering the predicted video content and network states. NAS [26] directly applies neural networks (NN)-based quality enhancement on the received video content to maximize the user QoE. Moreover, Jiang et al. [27] leverage the correlations of video content to dynamically pick the best configurations for analytics pipelines. Furthermore, based on the DRL algorithms, HotDASH [28] considers the prefetching of user-preferred temporal video segments, while Guo et al. [29] perform dynamic resource optimization for wireless buffer-aware video streaming. Kan et al. [30] design a DRL-based rate adaptation algorithm for 360-degree video streaming. These algorithms have their own advantages in different video transmission applications. However, they are not specifically designed for the UAV video transmission, and thus are not optimized to adapt to the dramatically changing UAV environments.
Application of sensor data. The sensor data brings great convenience for IoT device communication [44], especially in mobile scenarios. The sensor data is widely used in mobile devices. Several studies [45]- [48] use sensor information to infer the motion states and surrounding environments of objects, which optimize wireless communications by adjusting protocols including client roaming, bit rate adaptation, frame aggregation and beamforming. Santhapuri et al. [46] employ light sensor readings on the phone to distinguish indoor or outdoor locations and exploit the on-phone accelerometers to identify the mobility states of users, such as walking patterns and vehicular motion, which is beneficial to improve the user experience. Zhang et al. [47] take as input users' location information through planned routes, and then predict the bandwidth along the route to make online transmission decisions. Furthermore, several studies use WiFi signal strength [49] or PHY layer information [50] to detect the users' motion states, which are contrary to the above studies. Asadpour et al. [51] analyze in detail the impact of the relative motion between two UAVs on throughput and Wang et al. [45] experiment to add the GPS information of the UAV to the ABR video streaming algorithm, which enables the model to indicate more UAV channel information.
VII. CONCLUSION SA-ABR exploits the flight-state-related sensor data that is readily-available on today's commercial UAVs to generate ABR algorithms that provide stable and better QoE under various flight scenarios. The sensor data we analyze and exploit in experiments include GPS coordinates, accelerations, and velocities. With the help of sensor data, our model can better infer the future channel condition and effectively mitigate the negative impact caused by sudden changes in flight states. The experimental results have verified that SA-ABR outperforms the best known ABR algorithm by 21.4% in terms of average QoE reward. SA-ABR can be seamlessly integrated into existing wireless protocols and commercial hardware. We believe that with these features, SA-ABR can provide some insights for future UAV transmission policy designs.