1 Introduction

Unmanned Aerial Vehicles (UAVs) can provide remote inspections, and obtain different digital imagery by sensors or cameras, such as thermal, ultrasonic, laser scanners, high-resolution, and near-infrared [1, 2]. Computer vision and other technologies can process the collected data to detect surface defects of infrastructure, including distortion, spalling, cracking, excessive movements, rusting, and misalignment [2]. Finding an informative and efficient path is required to perform UAV-based path planning inspection with data from different views [2].

This research was conducted because of an accident in Notre Dame de Paris, which attracted attention to protect the historical buildings and collect the building data in case of an accident. Historic buildings have historical value as symbols of specific eras and can exhibit the architect’s aesthetic and past people’s lives. Monitoring historic buildings’ condition and regular inspections of historic buildings are essential.

The Helix-HPSO approach is proposed as UAV-based path planning for building inspection of multiple historical buildings. It uses the helix-shaped path for inspecting each building, which is a smooth path at a low cost and suitable for UAV constraints. Also, the Helix path is compared with the traditional inspection path. The proposed HPSO algorithm generates the path for flying to another building, considering the distance and collision avoidance. The HPSO has been compared with other bio-inspired algorithms through benchmark functions and with PSO for path planning. The contributions of this paper include the following:

  • Improve PSO with the inspiration from the Harmony search algorithm as a new algorithm, HPSO

  • A novel 3D path planning approach based on the helix-shaped path and proposed HPSO for a smooth and safe path

  • Provide the generic building inspection approach in the multi-building environment

This paper proposes a UAV-based path planning for a building inspection as the Helix-HPSO approach, and it is organized as follows. Section 2 reviews the UAV path planning algorithms and building inspection approaches. Section 3 describes the problem formulation, and Sect. 4 proposes the Helix-HPSO approach. The result of the computational experiment is in Sect. 5. This paper is concluded in Sect. 6.

2 Related work

The path planning algorithms can be classified as node-based [3], sampling-based [4], mathematical mode [5], multi-fusion-based [1] and bio-inspired algorithms [2]. A* and DWA is integrated for global path optimization for UAV path planning to improve safety, and efficiency [3]. A genetic algorithm and A* algorithm are integrated to solve the travelling salesman problem for LiDAR-equipped UAV path planning [6]. An improved A* is combined with a gravitational search algorithm for the optimal path with several optimization objectives, such as the return point and the heading angle [7].

Moreover, for UAV path planning, a biased sampling potentially guided intelligent bidirectional RRT* algorithm is proposed to overcome the slow convergence rate of exploration [4]. UAV path planning can be transformed into a nonlinear optimal control problem, and sequential convex programming is proposed to solve it by approximating the non-convex parts [5]. An improved Artificial Potential field (APF) is proposed for UAV path planning with additional control force, and it avoids local minima [8]. The chaotic bat algorithm is combined with an improved APF for faster position update and adaptive inertia weight [9].

An odd-even layered genetic algorithm (GA) is proposed for cooperative inspection path planning in [10]. Particle swarm optimization (PSO) and the mutation operator of GA are combined to improve the central force optimization algorithm and aim for complicated path optimization [11]. In a proposed random chemical reaction optimization algorithm [12], PSO and elitist selections are combined to act as the subsets of the set of molecules. It is used for UAV inspection path planning.

Additionally, a heuristic evolutionary algorithm in [13] implements mutation, substitution, crossover, smoothness and length operations to build the path for UAV. The reinforcement learning is improved based on the grey wolf optimizer algorithm to control the switch operations for individuals during UAV path planning [14]. The differential evolution algorithm is modified with symbiotic organism search for impressive local and global search ability [15]. A modified Mayfly algorithm is proposed in [16] with an enhanced crossover operator, adaptive Cauchy mutation and an exponent decreasing inertia weight to search the configuration space and get the path with the lowest cost for UAV path planning.

UAVs offer excellent flexibility in many fields with the development of technologies and remote photogrammetry, including security, rural environment monitoring, urban planning, and, recently, infrastructure inspection [17,18,19]. UAV applications in construction include site surveying, safety inspection, building inspection, damage assessment, urban monitoring, road assessment, geo-hazard investigations, and progress monitoring [20, 21].

UAV infrastructure inspections can be classified into five categories: bridges, power lines, buildings and facades, railways and sewers, and geographical inspections [17]. A regular building inspection is necessary to ensure their condition is safe. Maintenance and detection of building facade anomalies require periodic safety inspections and examinations [22]. They are more critical to the historical buildings as heritage [19].

Detail three-dimensional heritage reconstruction is crucial for interpretation, further analysis and physical reconstruction eventually [23]. Heritage documentation includes post-catastrophe damage assessment and the modelling of facades, monuments or entire buildings [23]. Inspectors usually take photos directly of every element in general practice to record damage or dilapidation, which is time-consuming and expensive [1, 19]. UAV technology overcomes risky, time-consuming, and costly inspection practices for monitoring and inspecting infrastructure [24].

Additionally, the research of building inspection is for evaluating the condition of a building and checking the appearance of a building. The UAV survey aims to model the structure and recognize the state [25]. UAV-based photogrammetry evaluates the condition of facilities and allows complete documentation of buildings with fewer human resources and time, particularly for the areas difficult to access [2, 19, 26]. A UAV-based project’s geometric result relies on the UAV manufacturing quality and the onboard sensor system, materials, shutter modes and digital sensor types [23].

The autonomous navigation of UAVs relies on local information in the GNSS-denied zones, and an RGB-D Kinect camera or visual information can obtain such local information to compute an analytical path [27]. Distance measuring units can also calculate the angle and the range between the structure and the UAV during the inspection [28]. The pre-processing algorithm processes the local information obtained from the point cloud and then uses the path planning algorithm to generate the path for the indoor environment [27].

Range-based and image-based techniques are employed widely in the three-dimensional documentation of buildings, and UAVs have advantages for image-based techniques with aerial views [23]. UAVs follow a programmed flight path to record and survey historical buildings, obtaining survey data for unreachable areas with a terrestrial platform [2, 18, 29]. UAVs are equipped with sensors for navigation, 3D data acquisition, and obstacle avoidance [1, 2, 18]. It achieves higher flexibility with low-cost [30]. Survey data can vary from sensors, such as Forward-Looking Infrared technology, images, separate strips, multi-attributed point cloud, 3D point cloud, and laser scanners [1, 19, 30, 31]. UAV-derived point clouds can extract the surface after image processing [32]. The building information model and the UAV inspection workflow are integrated for an augmented reality solution with aerial video [33, 34].

Laser scanning data, close-range photogrammetric images, or a combination of both are generally applied for building inspection documentation [2, 26]. Close-range facade images are employed to inspect, and document facade anomalies, such as corrosion and cracks [22]. 2D photographs generated by UAVs enable the creation of a precise model of buildings with proper path planning and using dedicated software to identify the defects [26]. Close-range high-resolution inspections can achieve 3D modelling of a historical building [29]. Documentation of heritage buildings with 3D reconstruction and photogrammetry is based on motion with a dense matching algorithm and optical sensors [23]. LiDAR, stereo camera, IMU, and wide-angle camera are implemented for the UAV-UGV system for indoor and cluttered scenes [35].

Moreover, a GIS-based two-step procedure supports building facade inspection by processing the management of UAV-collected images [22] in the inspection, measuring the geometry of buildings and requiring documentation in the form of photogrammetric images [18, 36]. Advanced photogrammetric techniques and deep learning algorithms are applied to record building damages autonomously by a true-orthophoto [36]. A Convolutional Neural Network is fine-tuned to detect damage and surface cracks [37, 38]. Ultrasonic Beacon system replaces GPS for autonomous flight, and a geotagging method can locate damages [37].

For buildings with planar surfaces, particle swarm optimization is adapted as enhancing discrete particle swarm optimization to plan the path for UAV [1]. The most common path planning method for a building inspection is back-and-forth paths. The inspection of the Perak Museum used back-and-forth paths; the UAV flew from the bottom of the building, then moved to the top, and flew to the right side, then reached the ground [19].

From the literature, the popular algorithms used in UAV path planning are based on bio-inspired algorithms. The bio-inspired algorithms provide fast path generation with optimal solutions. For the building inspection, the related work lacks the consideration of multiple buildings. This paper proposes the Helix-HPSO approach to address the problem of the multi-building environment, generating the path for each building and between the buildings.

3 Problem formulation

The basic components of UAV path planning include the start, the goal and the environment. The shape of most buildings can be modelled as rectangular or cylinder. The building inspection requires broad coverage with a short path. For proceeding between buildings, collision avoidance and flight distance should be considered. It is aimed at generating a safe and optimal path. The developed cost functions to evaluate the paths are as below.

3.1 Cost functions for building inspection

The cost function is defined as Eq. (1), and it is to evaluate the inspection paths.

$$\begin{aligned} f_{cost} = w_{1}*f_{distance} + w_{2}*f_{time} + w_{3}*f_{altitude} \end{aligned}$$
(1)

where \(w_1\), \(w_2\) and \(w_3\) are the weights of the cost functions of distance, flight time, and the change of altitude. The cost functions are listed as Eqs. (2)–(4). The sum of the weights is 1.

$$\begin{aligned} f_{distance} = \sum _{k=1}^{n} \sqrt{(x_{k+1}-x_{k})^{2} + (y_{k+1}-y_{k})^{2} + (z_{k+1}-z_{k})^{2}} \nonumber \\ \end{aligned}$$
(2)

where n is the size of the path points, and \(x_{k}\) is the current path point.

$$\begin{aligned} f_{altitude} = \sum _{k=1}^{n} \sqrt{(z_{k+1}-z_{k})^{2}} \end{aligned}$$
(3)

where \(\sqrt{(z_{k+1}-z_{k})^{2}}\) is the change of altitude.

$$\begin{aligned} f_{time} = \sum _{k=1}^{n} \frac{\sqrt{(x_{k+1}-x_{k})^{2} + (y_{k+1}-y_{k})^{2} + (z_{k+1}-z_{k})^{2}}}{v} \nonumber \\ \end{aligned}$$
(4)

where v is the current velocity.

Fig. 1
figure 1

The Helix-cost

3.2 Cost functions for path planning

The cost functions are developed to evaluate the optimal path during path planning, considering the distance and collision avoidance. The best solution would be the generated path for flying to another building.

$$\begin{aligned} f_{path~cost} = w_{4}*f_{length} + w_{5}*f_{collision} \end{aligned}$$
(5)

where \(w_4\) and \(w_5\) are the weights of the length and collision cost functions. The cost functions are listed as Equations (6) – (9). The sum of the weights is 1.

$$\begin{aligned} f_{length} = \sum \limits _{k=1}^{n} \sqrt{(x_{k+1}-x_k )^2+(y_{k+1}-y_k )^2+(z_{k+1}-z_k )^2} \nonumber \\ \end{aligned}$$
(6)

where n is the number of path points, and \(x_{k}\) is the current path point.

$$\begin{aligned} d_{k} = \sqrt{(x_{k}-x_{c})^{2} + (y_{k}-y_{c})^{2} + (z_{k}-z_{c})^{2}} \end{aligned}$$
(7)

where \(d_{k}\) is the distance from the current path point to the centre of an obstacle.

$$\begin{aligned} c_{k} = \sum _{c=1}^{cn} r_c - d_k \end{aligned}$$
(8)

where cn is the number of obstacles. The collision occurs if \(r_c - d_k < 0\), which means that the current path point overlaps with an obstacle c.

$$\begin{aligned} f_{collision} = \sum _{k=1}^{n} c_k \end{aligned}$$
(9)

where \(f_{collision}\) sums up the violation value for collisions that happen between each path point and obstacles.

4 Helix-HPSO approach

4.1 Overview

The helix-HPSO approach generates the helix path for each building, defining the points where info is collected with reasonable time slots. After inspecting one building, the UAV proceeds to another building with an optimal path based on a visited vector and a cost matrix, as shown in Fig. 1a. Cost functions evaluate several factors, including distance, time, and altitude. The helix-HPSO approach is demonstrated in Fig. 1b. The steps of the proposed algorithm are as follows:

  1. 1.

    Build the model for the multi-building environment.

  2. 2.

    Generate the inspection path and the points where info is collected for each building.

  3. 3.

    Proceed to another building after inspecting one building.

4.2 Path planning for each building: Helix path

4.2.1 Helix path

The helix path [39] for inspecting each building is generated through Eqs. (10)–(12). The position of the UAV is denoted as (x(t), y(t), z(t)) at the specific time t. The time slot is set to 0.01 for t. Recording current t as \(t_{max}\) and terminating the iteration once z(t) reaches the determined height based on the inspection type.

$$\begin{aligned}{} & {} x(t) = r*sin(\frac{vt}{2{\pi }r}) + x_{g} \end{aligned}$$
(10)
$$\begin{aligned}{} & {} y(t) = r*cos(\frac{vt}{2{\pi }r}) + y_{g} \end{aligned}$$
(11)
$$\begin{aligned}{} & {} z(t) = (\frac{vh}{2{\pi }r})*t + z_{g} + 1 \end{aligned}$$
(12)

where v is the UAV flight speed, \((x_{g}\), \(y_{g}\), \(z_{g})\)represents the centre of the ground floor of a building, r is the radius of the helix path, and h is the height of each floor.

The time required for an n-floor building inspection is defined by Eq. (13), with a flight speed v.

$$\begin{aligned} T_{s} = \frac{2{\pi }rn}{v} \end{aligned}$$
(13)

The points of the path are stored as Eq. (14).

$$\begin{aligned} Points = \begin{bmatrix} x_{1} &{} y_{1} &{} z_{1} \\ x_{2} &{} y_{2} &{} z_{2} \\ \vdots &{} \vdots &{} \vdots \\ x_{n} &{} y_{n} &{} z_{n} \\ \end{bmatrix} \end{aligned}$$
(14)
figure a

Algorithm 1 presents the algorithm for generating the paths of interior and exterior inspection. The exterior and interior inspection paths are connected through the door, inspecting the entrance hall.

4.3 Path planning between buildings: HPSO

4.3.1 Cost matrix

After completing the inspection of one building, the UAV proceeds to another building for inspection. Each building is marked with numbers, and the cost matrix evaluates the order of inspecting buildings as Eq. (15). If a building has been visited, update the visited vector and the related costs as infinity.

$$\begin{aligned} Cost = \begin{bmatrix} infinity &{} cost(1,2) &{}... &{} cost(1,m)\\ cost(2,1) &{} infinity &{}... &{} cost(2,m)\\ \vdots &{} \vdots &{} \vdots &{} \vdots \\ cost(m,1) &{}cost(m,2) &{}... &{} infinity\\ \end{bmatrix} \end{aligned}$$
(15)

where m stands for the number of buildings in the environment.

4.3.2 Preliminary knowledge

Particle swarm optimization (PSO) Particle swarm optimization (PSO) is proposed by [40] and is inspired by the social behaviour of fish schooling or bird flocking. It uses the globally and local-oriented values to track each particle’s coordinates in hyperspace. PSO uses initial random solutions and updates the velocity and position for each particle as Equations (16)–(17) to seek the optimal solutions in the configuration space. Algorithm 2 shows the principle of PSO.

$$\begin{aligned}{} & {} v_i^{t+1}= \omega v_i^t+c_1 r_1 (pbest_i^t-x_i^t)+c_2 r_2 (gbest^t-x_i^t) \end{aligned}$$
(16)
$$\begin{aligned}{} & {} x_i^{t+1}= x_i^t+ v_i^{t+1} \end{aligned}$$
(17)

where v stands for particle velocity and \(\omega \) is the inertial weight. \(t+1\) is the current time slot, and i is the current particle. pbest is the best local-oriented value, and gbest is the best global-oriented value. x is the position of the particle.

figure b

Harmony search (HS) Harmony search (HS) is proposed by mimicking the improvisation of music players [41]. It aims to get better solutions but with fewer iterations than other heuristic algorithms. Music harmony consists of several sound waves with different frequencies, and performances seek the best state. HS initializes a harmony memory (HM). Set the harmony memory considering rate (HMCR), harmony memory size (HMS), and pitching adjusting rate (PAR). Then, improvise a new harmony from HM as Eqs. (18)–(20). Add the better harmony in HM and exclude the old harmony. Keep seeking harmony with the minimum harmony until satisfying the stopping criterion. HS is described by Algorithm 3.

$$\begin{aligned} x_{i}^{'}= \left\{ \begin{aligned}&x_{i}^{'} \in \left\{ x_{i}^{1},x_{i}^{2},...,x_{i}^{HMS} \right\} , \text { with probability HMCR} \\&x_{i}^{'} \in X_i, \text { with probability (1-HMCR)} \\ \end{aligned} \right. \end{aligned}$$
(18)

where HMCR is the probability of getting one historic value in the HM

$$\begin{aligned}{} & {} Pitch~adjusting~decision~of~x_{i}^{'}\nonumber \\{} & {} \quad = \left\{ \begin{aligned}&YES, \text { with probability PAR} \\&NO, \text { with probability (1-PAR)} \\ \end{aligned} \right. \end{aligned}$$
(19)

If a value is from the HM, the pitching process happens. If the decision is YES, then updating \(x_{i}^{'}\) as Eq. (20).

$$\begin{aligned} x_{i}^{'}= x_{i}^{'} + \alpha \end{aligned}$$
(20)

where \(\alpha \) can be the result of the arbitrary distance bandwidth multiplying a uniform distribution in \([-1,1]\) or the arbitrary distance bandwidth multiplying the standard normal distribution.

figure c

4.4 Harmony particle swarm optimization (HPSO)

From Sect. 2, The bio-inspired algorithms are widely used in UAV path planning, especially PSO and GA. Due to the requirement of fast computation, PSO is chosen to be improved for UAV path planning between buildings. HS is proposed for better solutions with fewer iterations, inspiring the improvement of the PSO approach. Thus, a hybrid HPSO is proposed for fast convergence and fewer iterations. The inertial weight in HPSO is adjusted based on Eqs. (21)–(23).

$$\begin{aligned} \alpha = BW + randn() \end{aligned}$$
(21)

where BW is the arbitrary distance bandwidth and randn() generates a Gaussian distribution.

$$\begin{aligned} \omega = \omega + \alpha \end{aligned}$$
(22)

where \(\omega \) is the inertial weight of HPSO, the adjust processing only occurs when the current cost is larger than the personal best value, and the probability is less than PAR.

$$\begin{aligned} \omega = \omega * damping~ratio \end{aligned}$$
(23)

where damping ratio is the ratio of updating the inertial weight.

Algorithm 4 demonstrates the proposed HPSO algorithm. The algorithm initializes the velocities and positions of the particles. Then update the positions and velocities ad Eqs. (16)–(17) and evaluate the solution by the cost function. If the current cost is less than the personal best value, it becomes the local best-oriented value. Otherwise, adjusting inertial weight for the algorithm based on the probability of PAR and \(\alpha \) is calculated by the bandwidth multiplying the standard normal distribution. The proposed algorithm allows better solutions with fewer iterations and adjusts the inertial weight randomly for better search abilities. The global best value keeps updating until the termination criteria reach.

figure d
Table 1 Test functions

5 Computational experiment

5.1 Performance measurements

The proposed HPSO was compared with other bio-inspired methods, such as PSO, HS, GA [42] and Firefly algorithm (FA) [43]. The test functions are listed in Table 1 to compare the performance of the proposed algorithm with other bio-inspired algorithms. Each test function is a typical benchmark function with different characteristics. Ackley function has many local minima. The shapes of Rosenbrock and Sphere functions are like valley and bowl, respectively. The shape of Michalewicz function is a steep ridge. The number of the maximum iteration was 200.

Table 2 lists the mean iteration times when getting the optimal solution, the runtime of each algorithm, and fitness values for each benchmark function with different algorithms. Each algorithm has been run 20 times. The best value is highlighted in bold. The proposed HPSO had the best performance for Ackley, which has many local minima. HPSO had minimal iteration times for the remaining test functions, while PSO had minimal runtime. Nevertheless, the difference between the runtime of PSO and HPSO was insignificant. It can be concluded that HPSO has great performance compared with other algorithms, especially for problems with many local minima. Getting rid of local optima and fast convergence are important for path planning, so HPSO is suitable for UAV path planning.

Table 2 Test functions

Figure 2 presents the test functions’ mean fitness value’s convergence curve. Figure 2 and Table 2 show that the proposed C-PSO converges faster than other bio-inspired algorithms. It has much fewer iteration times to get the optimization solutions, which is useful for path planning.

Fig. 2
figure 2

Convergence curve of HPSO

5.2 Scenario: Fujian Tulou

5.2.1 Modelling

A Tulou is an enclosed, large and fortified earthen building, most commonly circular or rectangular in configuration. It has thick, load-bearing, and rammed earthen walls, housing up to 800 people. It represents the living style from Song and Yuan Dynasty, around C.E. 960 to C.E. 1368. Figure 3a displays the photo of the Tianluokeng Tulou cluster comprising five main buildings, and Fig. 3b presents the model with the marked number of each building.

Fig. 3
figure 3

The Fujian Tulou

Fig. 4
figure 4

The flight path for each building

Fig. 5
figure 5

The Helix-HPSO path

Table 3 Details of the Helix-HPSO path
Fig. 6
figure 6

The exterior inspection paths

Table 4 Costs of the exterior paths
Fig. 7
figure 7

The generated paths

5.2.2 Simulation results

MATLAB validates the simulation of the path planning. The radius and the centre coordinate are inputted to generate the inspection path. The assumptions are as below:

  • The speed is 18 m/s, the speed of ascent is 6 m/s, and the descent speed is 4 m/s.

  • The UAV hovers when the UAV reaches the point of generating inspection data.

  • UAV has been charged fully and operates in excellent condition.

Figure 4 demonstrates the flight path of each building, with the points where info is collected marked by "*". The interior and exterior inspection paths are connected through the hall, and it provides the possibility to check the condition of the entrance hall.

Table 5 Comparison of PSO and HPSO paths

The start building is Building 1. From the visited vector and the cost matrix, the order of inspecting the buildings is 1 2 5 4 3, which is determined by Dijkstra’s algorithm. The start is the exterior path of Building 1, which is close to the top.

The Helix-HPSO approach integrates the flight path; the entire flight path is shown in Figs. 5 and 7a. The Helix-HPSO path starts from the exterior inspection path of Building 1, following the interior path inspection path. After reaching the end of the interior path, the UAV flies to the next building defined in the order. After getting to Building 2, the UAV inspects the exterior and interior areas. The loops of inspection keep until the UAV reaches the last building. Table 3 lists the details for the generated path.

Comparison of path planning for each building The back-and-forth path is widely implemented for a building inspection to get the inspection data. It is programmed to compare with the Helix-HPSO approach. The distance between a UAV and a building is less than 2 m. The path length of the vertical flight is 1 m. The back-and-forth path is only for the exterior inspection without considering the costs of taking inspection photos, as shown in Fig. 6a. Figure 6b displays the exterior inspection path by defining the data generation points through the proposed Helix-HPSO approach.

The proposed approach implements the helix-shaped path for coverage inspection. Table 4 compares the costs of the exterior inspection of each building for different paths. The cost only considers the exterior inspection path, and they are calculated by Equation (1), considering the distance, altitude, and time. For getting complete documentation of the building, coverage path planning is required to get complete documentation of the building. If comprehensive coverage is required, the costs of traditional back-and-forth paths rise rapidly.

Comparison of path planning between the buildings PSO is compared with the proposed HPSO for path planning between the buildings. Figure 7 compares the path generated by PSO and HPSO. The HPSO path is marked orange, and the PSO path is marked blue.

Table 5 compares the performance of PSO and HPSO for path planning. If the algorithm gets the best solution ten times, the algorithm terminates. For the path between Buildings 1 and 2, Buildings 2 and 5, and Buildings 4 and 3, PSO and HPSO have the same performance. While for the path between 5 and 4, HPSO has fewer iteration times and costs than PSO. HPSO reduces by around 53.62\(\%\) iteration times to get the optimal path.

6 Conclusion

The Helix-HPSO path planning approach is developed for UAV multi-building inspection, considering the paths travelling between buildings. Usually, the building inspection algorithm is designed for one building, while our approach is for a multi-building environment. The proposed method can be used for interior inspection, extending the traditional inspection area. The proposed helix path provides broader coverage and smooth turn angles at lower costs than traditional inspection paths. Cost function factors include time, distance, and altitude, as altitude change affects energy consumption and speed.

A visited vector and a cost matrix are implemented to determine the order of proceeding inspections for travelling between buildings. The PSO algorithm is improved by the inspiration of HS for getting rid of trapping on the local optima. The proposed HPSO exhibits outstanding performance when dealing with many local optima in the benchmark functions compared to other bio-inspired algorithms. For UAV path planning, the cost functions consider the distance and achieve collision avoidance. The HPSO provides faster convergence than PSO during UAV path planning, so it is used in the path planning between buildings.