Abstract
Introduction
The utility of an autonomous unmanned aerial vehicle (UAV) depends on its ability to navigate with an acceptable positioning error. The term “autonomous UAV” may have different meanings in different contexts; here, it implies a UAV capable of flying without any external guidance. The sensing and processing are performed using onboard sensors and processors. The biggest challenge is to make UAVs robust enough to autonomously navigate under global positioning system (GPS) outages or loss of signal connections and to fully realize the practical applications, such as robust and automated package delivery. 1 In the present scenario, UAVs use GPS or inertial navigation system (INS) for navigation and can fly safely during very short GPS outages (Figure 1). For example, an integrated system with an attitude outage of roughly 2 min is still considered safe, while all GPS outages of only 30 s can lead to roughly a 10 m error in location and approximately 1 m/s error in velocity. 2

Outline of an autonomous UAV operation.
Many approaches have been proposed in the literature to address the problem of navigation during GPS outages. Some researchers have proposed the use of cameras to observe the surroundings and navigate, while others have used ultrasonic or laser-ranging sensors to map the surroundings, thereby localizing a UAV. 3 Although these techniques are effective for indoor navigation, they encounter limitations when it comes to outdoor navigation. In an outdoor environment, UAV range sensors might not find anything close enough to take a reference, making their mapping difficult with respect to the surroundings. Other drawbacks include power requirements, size, weight, and, most importantly, cost of the equipment involved. Optical flow and other visual motion detection algorithms have been used in the past and have shown to improve the performance of a UAV. However, published results suggest that researchers achieve an enhanced navigation precision with the fusion of data from inertial sensors, visual motion detection data, and ranging sensors.4,5 In this article, we propose a modified extended Kalman filter (M-EKF) that allows fusing the most accurate data from sensors such as optical flow sensor (camera), accelerometer, gyroscope, and a barometric altitude sensor to estimate UAV position in GPS-denied areas. Over the past few years, the UAVs have been equipped with optical mouse sensors such as ADSN2620 for optical flow measurements. 6 Optical flow sensors can measure the velocity of the UAV by looking down at the ground and estimating position. However, these types of sensors do not work well in low-light conditions because of their poor light sensitivity, 7 thereby making measurements inaccurate. A complementary metal oxide semiconductor (CMOS) sensor-based camera can remove this drawback; PX4FLOW is the optical flow sensor developed in 2013 and is specifically designed for use in UAVs. 8
Using the abovementioned optical sensor, this article presents the implementation of an artificial bee colony (ABC)-based block-matching algorithm that processes images and updates the flow measurement fast enough for real-time applications. We propose to use a popular optimization algorithm to efficiently accomplish block matching (BM) in optical flow sensor output images to accurately calculate the speed and direction of the motion. We use these values to predict correct GPS coordinates using the last known location before the outage. Our intelligent optical flow measurement algorithm also reduces the computational load and allows low overhead during onboard processing. The mathematical derivations for extended Kalman filter (EKF) are well defined in the study by Reif et al., 9 and they are used as guidelines in this article to create a modified EKF. Proposed modified EKF is used to merge the data from various sensors to navigate the UAV. We implemented the intelligent optical flow algorithm, modified EKF on a UAV, and used autonomous test flights to record experimental results. These results were logged and plotted for better visualization of the achieved performance. In addition, the results were obtained in an outdoor scenario in the presence of other environmental parameters such as wind, fluctuating lighting conditions, and changing ground patterns, making the tests more realistic. The primary contributions of this article are as follows:
Proposed and developed an ABC-based BM algorithm for UAV applications.
Designed and implemented a novel modified EKF algorithm for multi-sensor data fusion for UAV navigation.
The article is organized as follows. The next section discusses the previous work in this field of research and presents a brief comparison of related techniques. The next section, “Technical Methodology,” details the proposed data fusion algorithm, optical flow algorithm, and sensors used. Moving on, experimental results and performance comparison with GPS-based navigation have been presented in section “Results and discussion.” Finally, we conclude the article in section “Conclusion and future work.”
Related work
Optical flow is a natural method of navigation and obstacle avoidance for many insects and birds. This is accomplished by analyzing the relative motion between the navigator and the surroundings or the ground. It can be considered as the two-dimensional (2D) representation of the three-dimensional (3D) motion of the object and has proven its application in motion estimation, video compression, and other image-processing applications. 10 The optical flow measurement techniques can be classified into four categories with respect to the image features being used to measure the flow, thereby determining the motion. These categories include the following: 11
A differential technique that uses derivatives to calculate the first constraint and then solve for the orthogonal component using global methods;
A correlation-based technique that uses assumptions such as displaced values generally does not change between frames; between the neighborhood of the pixel in the first image and the second image;
A feature-based technique, for example, an algorithm for real-time detection and tracking of moving targets in terrestrial scenes using a mobile camera;
Hierarchal techniques, presenting a framework of combining two prevailing analysis approaches optical flow and global motion analysis.
The choice of a technique from these categories depends on the application, computational complexity, and accuracy requirements. Optical flow methodologies have achieved significant pixel level accuracy on benchmark data sets used by the image-processing community. For example, Microsoft robotics researchers have started to employ these techniques for navigation and obstacle avoidance on the ground and in aerial robots. 12 In the study by Kim et al., 13 researchers use vision navigation through image processing and target tracking. Optical flow measurement coupled with inertial measurement unit or other similar sensors have also proved capable of completing many navigational subtasks. In the study by Floris et al., 14 the authors employed optical flow for distance estimation. In the studies by Lange et al. 15 and Herisse et al., 16 it was used for position hold, obstacle avoidance, and vertical landing. CentEye Inc. developed optical flow chips and has achieved position estimation as well as obstacle avoidance. 17 However, optical flow algorithms require very high computational resources because of their algorithmic complexity, making it difficult for onboard computers and real-time implementation. 18
One of the most important steps to make the optical flow data useful for a UAV is to integrate these measurements with translational and rotational motion (roll, pitch, and yaw). In addition, a rigorous analysis of flow is required before it can be used reliably for navigation. Once the calibration is complete, optical flow measurements can be used to aid in velocity, position, and orientation estimation. Another popular technique among researchers currently is vision-based simultaneous localization and mapping (SLAM).19–21 In the study by Robert et al., 22 researchers proposed a new architecture that constructs SLAM maps based on visual data and EKF to navigate in an indoor environment. However, the light detection and ranging (LIDAR) used in the regular SLAM algorithm is costly as well as computationally expensive. In the study by Green and Oh, 23 the authors propose a collision avoidance technique using optical flow data. In another work, optical flow was used as a backup for velocity estimation, and the velocity errors were in meter range, during the outages. 24 In the study by Mercado et al., 25 authors fused data from GPS, INS, and optical flow for position and velocity estimation. However, after 10 s of GPS dropout, the velocity in the north direction diverged. In the study by Rhudy et al., 26 the wide field optical flow measurement was employed to reduce the drift error in INS, for navigation during GPS outages. Gageik et al. 27 applied the optical flow sensor for position hold and landing application. In this article, we implemented ABC-based BM to implement optical flow and then integrated the sensor data using the EKF dynamic prediction model.
Much research has been undertaken in the area of multi-sensor data fusion for UAV-related applications. Multi-sensor data fusion deals with the efficient algorithms to transform the uncertain, noisy, and sometimes conflicting data from different sensors into a single representation that can help in the decision-making process. 28 The reason for the widespread use of multi-sensor data fusion in an autonomous system is that it provides the improved reliability and scalability of data.29,30 For example, data fusion of multiple sensors can help keep error under control by exploiting the redundant information from various noisy and imperfect sensors. This also makes the fusion of data reliable, especially in real-time situations. 28 In our case, this issue can be extremely important and sensitive during the autonomous flight of a UAV. Among the available methods for data fusion, the Kalman filter–based approaches have been widely accepted because of their simple implementation and adaptability to the system requirement.31,32 EKF linearizes the nonlinear system around the conditional mean using Taylor series expansion and neglects the higher-order terms.33,34 It may be unsuitable for highly nonlinear systems but works well for mildly nonlinear systems. 35 Some of GPS/INS algorithms also use EKF and unscented Kalman filter (UKF) for attitude and position estimation.36,37
In addition to the abovementioned works, we present a comparison of methods for ABC-based BM, EKF, and navigation using optical flow in contemporary research works in Table 1. Numerous research studies published from 2013 to 2018 underscore the superiority of ABC compared with other popular algorithms. These works conclude that ABC algorithm can converge faster than particle swarm optimization (PSO), genetic algorithm (GA), cuckoo-search, and differential evolution.38–40 Moreover, another work comparison to other full search (FS) methods, modified ABC algorithm (MABCA), outperformed.40,41 The authors compared MABCA to six FS methods including FS, three-step search, new three-step search, simple and efficient search, four-step search, and diamond search. To compare these algorithms, mean square error (MSE) was used to check the BM, and peak signal-to-noise ratio (PSNR) was used to check the rebuilt image quality. The experiments were conducted with classic test video sequences that show MABCA performed 35.4 times better than any other search methods. 41
Summary of comparisons of methods used in this research paper.
EKF: extended Kalman filter; UAV: unmanned aerial vehicle.
As discussed in the previous sections, EKF is used as a state estimation method. Other state estimation methods presented in the literature include artificial neural networks (ANN), alpha-beta filter, set-membership filter, and sigma point filter. However, results from various works consistently proved that different versions of EKF performed well in state estimation or position estimation.43,45,46 In addition, Balamurugan et al. 44 presented a survey on various methods used for UAV navigation in the GPS-denied environment, which presented a captivating comparative analysis showing the prominence of EKF-based visual navigation. This reaffirms our use of EKF and its modification that, as proved by Balamurugan et al., 44 enhances the performance of traditional EKF. These studies are consistent with industrial applications such as Microsoft and Tesla future vision on navigation.12,32 This analysis by various researchers compelled us to test optical flow, EKF, and ABC-BM methods for navigation and position estimation of UAVs. According to application needs, we proposed a modified EKF that can empower the ABC-based BM and can achieve navigation goals for extended GPS outages.
Technical methodology
Multi-sensor data fusion
Our goal is to efficiently combine and process the data from multiple sensors for successfully navigating a UAV, even under multiple sensors fault or missing/noisy data while GPS outages occur. In general, the EKF has two possible architectures for implementation: (1) centralized and (2) decentralized. As the name suggests, in a centralized architecture, data from different sensors fuse together at one single point, as shown in Figure 2, while in decentralized architecture, every sensor has its own EKF filter working for its estimated output, as shown in Figure 3. The main EKF in decentralized architecture considers the outputs of each parallel EKF filter as the local state estimation and then uses them to estimate the global state or solution. In this article, we selected the decentralized architecture over the centralized architecture to achieve better results based on previously discussed published literature on the effectiveness of modified EKFs. 30 Here, we first present a quick overview of the EKF followed by proposed modifications.

Centralized architecture for extended Kalman filter.

Decentralized architecture for extended Kalman filter.
EKF
In most of the real-world applications, systems are described by nonlinear equations. 47 A simple model is represented by equations (1) and (2)
where
In short, here
Initialization
Prediction
We get the new prediction of the state
Measurement
In this step, we acquire the actual sensor data
Update step
Next, using the above information, we update our state vector and the covariance matrix
where the initial state
where
While we assume that (1) the noise in individual sensors are not correlated to each other (
M-EKF
As evident from the information above, the efficiency of the EKF algorithm depends heavily on the prior knowledge of the dynamic models along with the covariance matrices. Uncertainty in the knowledge of these parameters can significantly degrade the performance of the algorithm. In this article, we dynamically reduce the impact of the noisy sensor output by implementing a fault detection feature. The architecture for the modified extended Kalman filter is shown in Figure 4.

Modified extended Kalman filter (M-EKF) architecture with fault detection.
Using the equations described in the previous section, in a real-world example, we use only accelerometer data in this experiment to predict current location in combination with optical flow data. Incorporating the last known position and velocity information obtained by the optical flow method through the BM technique, we estimate and correct the next position. We will incorporate the modifications to show the advantage of M-EKF over the traditional method using simulations. Assuming the state vector of three accelerometers as the input of the system, we have
Process equations
where
We know the initial parameters of sensor bias and variance. For determining the threshold value for each of the sensors, the logged data are analyzed. The complete process flow can be understood from Figures 4 and 5.

Modified extended Kalman filter process loop.
Optical flow algorithm
At the bottom of the UAV, a CMOS-based camera with a resolution of 752 × 480 is placed. Optical flow algorithm uses the images acquired by the camera for flow measurement. The optical flow between two successive frames is calculated and refined to achieve subpixel accuracy. Angular rate is compensated using the onboard gyroscope. Finally, the laser-based range sonar provides the precise height from the ground; it is used to scale the optical flow reading to get the exact metric motion details. Figure 6 explains in greater detail the pinhole approach employed to scale the optical flow. Ground point is

Pinhole model.
BM
BM algorithm is used widely for motion estimation in video coding. 50 We are using its modified version to reduce its computational cost and maintain the accuracy to make it fit for our application. In BM, the image is divided into blocks. For each block, the algorithm tries to search the best matching block in the previous frame. The aim is to minimize the sum of absolute difference (SAD) in the search window.
Consider a target block at position
where
where

Block-matching algorithm to find motion vector.
For BM, FS is the most robust and accurate method to find MV. It tests all possible blocks in
BM based on ABC
We are employing an ABC algorithm for reducing the search locations for best BM. It uses an intelligent algorithm for finding the global minimum or the best MV. With ABC, the search locations vary from generation to generation and avoid being stuck at a local minimum.51,52 This algorithm uses a fitness strategy for reducing the computation of SAD values while starting with randomly generated solutions. We perform the following steps until the termination condition is met: 53
Create initial solutions
The algorithm begins by initializing
Here, the lower initial parameter bound is
Generate new solution in neighborhoods
At this stage, each employed bee generates a new solution
where
After the solution is selected, onlooker bees will go to the selected solution and generate innovative solutions inside the neighborhood of the chosen solution. Scout bees perform the task similar to this in nature. In the case that the fitness of the new solution is better than before, such position is held. Otherwise, the old solution remains.
Fitness strategy
With reference from Cuevas et al., 51 the fitness calculation model follows three important rules to evaluate or estimate fitness values. Figure 8 gives flow representation of fitness strategy.

Fitness strategy flow chart.
If a new block (solution) B is located closer than the distance
Algorithm of Artificial Bee Colony—Block Matching
ABC-BM algorithm
Using the flow chart in Figure 9, we have presented an algorithm that is implemented on the drone-computing platform for an ABC-BM algorithm, which is presented followed by a flow chart. Taking reference from Honegger et al., 8 the average number of search points reached in different test cases using FS-BM is 422.3, whereas, for similar performance, the ABC-BM searched an average of 12.14 points with similar accuracy. This performance makes ABC-BM the best choice for implementation in real-time applications.

ABC-BM Flowchart.
In our case, the camera can provide up to 60 frames per second. After applying 4× binning, we get approximately 240 frames per second. In 4× binning, we are getting the average of the 4 × 4 pixels as one pixel. We calculate the SAD value of 8 × 8 pixel block in the search locations given by the ABC algorithm. We now take the position having the minimum SAD block value as the flow measurement for the corresponding sample block. Up to 64 sample points are taken and passed through a histogram filter, and we select the one with highest histogram bin. Histogram filter normalizes the image after converting it into grayscale and produces a histogram of the image that represents the frequency of occurrence of each gray level in the image. Histogram filter reduces the effects of light and other radiation. In this way, every pixel has an optical flow value.
Afterward, we perform subpixel refinement, which estimates the optical flow with half-pixel step size in every direction of the best-matched pixel. Finally, we select the best match of the direction with the best-matched pixel.
Sensors
For our experiments, we have used several different sensors onboard to help navigate the UAV. These sensors include an accelerometer, gyroscope, magnetometer, barometric altitude sensor, laser-based proximity sensor, and an optical flow sensor. We are using 3DR IRIS+ UAV for our experimental purpose. The reason for choosing this particular UAV is that it is based on open hardware as well as software, making it possible for us to implement our algorithms and add more sensors to it.
Pixhawk is an independent open hardware kit that specifically developed for implementing high-performance autopilot software. 9 It is available for use by academics and industry, as well as hobbyists. A 168-MHz Cortex M4F CPU (256 KB RAM, 2 MB Flash) powers the Pixhawk. It also embeds a 3D accelerometer, gyroscope, magnetometer, and barometer with the below characteristics (Table 2). There is also an integrated backup or failsafe processor, which makes it a perfect choice for real-time autonomous UAV. Figure 10 shows the optical flow sensor, laser-based range sensor, and Pixhawk board (brain of the UAV). Optical flow and range sensors were attached at the bottom of the UAV, such that they face toward the ground while it is flying.
Sensors used.

(a) 3DR IRIS+ UAV with Pixhawk (open hardware) and (b) optical flow sensor, laser-based range sensor, and the Pixhawk board.
Results and discussion
Simulation results
We first used logged accelerometer data from a test flight and used our algorithm on the recorded data on a PC. Figure 11 shows the filter output when both the sensors are assigned equal weights, while Figure 12 involves assigning lower or negligible weight to the noisy sensor using modified EKF. The filter output is closer to the less noisy sensor.

Plot of filter output with dynamic weight assignment.

Plot of filter output without dynamic weight.
This approach enabled us to exploit the availability of multiple sensors for the same variable. During the real flight, this is helpful in the scenarios when the wind increases, thereby increasing the vibrations in the UAV, making the inertial sensors noisy while the optical flow is still working fine. The reverse happens when the terrain is featureless, making the optical flow less reliable and inertial sensors more accurate. Then, we plotted output of the flight data recorded during a test flight. Figures 13 and 14 show the position and velocity estimate of the UAV, respectively, during this test flight. We fed the logged sensor data to our implemented EKF on MATLAB and the UAV. The output results, as expected, are not as accurate as GPS-assisted navigation. However, the error is within an acceptable limit. Once the algorithm was proved to be giving results within acceptable error ranges compared with actual GPS values, field tests were used to check the actual error obtained in the real-world experiments. These results are discussed in the following section.

Position estimate: modified EKF versus GPS.

Velocity estimate: modified EKF versus GPS.
Experimental results
We experimented to verify the performance of our algorithm in a parking lot at the University of Toledo, shown in Figure 15. We uploaded a set of waypoints to the UAV for the autonomous flight. With each set of the waypoint, we fly it two times, the first time with GPS available to the system and the second time with no GPS. For the second flight, the UAV just had the coordinates of its initial position. Figure 16 shows the saved waypoints of the first path in the UAV.

Outdoor autonomous navigation of Pixhawk UAV in simulated GPS-denied environment demonstration in the University of Toledo parking lot (https://youtu.be/BmhQ-FfZspQ).

First set of waypoints stored on the UAV.
Figure 17 shows the logged data; the red color path is the first flight, which uses the GPS data for navigation, and the green colored path is the second flight that does not use the GPS data for navigation. We logged the GPS data to compare both the flights with the same reference. As can be seen in Figure 18, our algorithm is slightly shifted from the actual path; this is due to the high-speed wind blowing during the experiment. Although we currently do not have any sensor to detect the wind and compensate for it, our system gave an acceptable performance without using GPS in our algorithm.

First path: comparison of our algorithm versus GPS-aided navigation.

Third path: comparison of our algorithm versus GPS-aided navigation.
Figure 19 shows the logged data of the second test flight with new waypoints (logged within the UAV beforehand) to verify our algorithm further. It is a rectangular path of approximately 130 m. It still has the drifting effect from the wind. The yellow color line shows the GPS assisted flight, and the blue color line shows the path followed by the UAV without using the GPS. The third path is a simple line of approximately 49 m. Fortunately, the wind speed was minimal during this experiment; our UAV followed the GPS path quite efficiently. In Figure 19, if we consider the landing point for both the flights they differ by only 1.3 m. Figure 20 shows the spiral type of flight path completed by our UAV as the fourth experiment. We logged the wind speed data during every experiment. Table 2 shows the mathematical figures of the performance. Similarly, Figure 21 also exhibits accurate navigation.

Second path: comparison of our algorithm versus GPS-aided navigation.

Fourth path: comparison of our algorithm versus GPS-aided navigation.

Fifth path: comparison of our algorithm versus GPS-aided navigation.
Results presented in Figure 22(a) and (b) show flight path when (1) the UAV was guided by the GPS in a 3D outdoor environment (in red) and (2) the UAV maneuvered the same path generated in (1) when GPS outage occurs using our algorithm (in green). In these newly generated results, we used a complex 3D path compared with our previous results. In presented results, red lines indicate the path generated by Pixhawk with GPS-guided navigation, and green lines indicate the autonomous navigation of UAV that follows the original (red) path. This additional experiment demonstrates the repeatability of paths. Based on the visual results in the complex 3D navigation, the new path followed by the UAV in a GPS-denied environment is highly accurate, as seen in Figure 22.

Path followed with GPS (red) and followed without GPS (green) in 3D at the University of Toledo campus.
Conclusion and future work
Our system worked with acceptable accuracy in the GPS-denied environment in multiple instances. With the experimental data, we have proved its usability in a real-world scenario in controlled environments. Moreover, in uncontrolled environments, the performance overshoot created new paths and consumed excessive power that needs to be addressed in future work. Our algorithm will easily navigate through an environment with weak GPS signals or GPS-denied regions for a longer duration compared with a GPS/INS system. It is evident from Table 3 that when the speed of wind was lower, the accuracy of the system improved. We have achieved this by employing an intelligent and robust optical flow measurement algorithm, ABC-based BM with some modifications in traditional EKF. We achieved better noise reduction using modified EKF for data fusion. More work is needed to improve the system and increase robustness against physical parameters like the wind. We also plan to explore algorithms that could help to further improve the overall system performance.
