# An Algorithm for Construction Project Cost Forecast Based on Particle Swarm Optimization-Guided BP Neural Network

Authors: Dan Ye
Journal: Scientific Programming
 (2021)

---

## Abstract

Construction project cost prediction is an important function in construction-related fields; it can provide an important basis for project feasibility study and design scheme comparison and selection, and its accuracy will directly affect the investment decision of the project. The successful realization of construction cost prediction can bring great convenience to the control and management of construction cost. The purpose of this paper is to study a fast, accurate, convenient, deducible, and rational construction project cost prediction method, to provide a basis for the cost management of the whole life cycle of the project. Therefore, this paper uses particle swarm optimization algorithm to improve BP neural network and proposes a novel construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network. Aiming at the defects of BP neural network updating weights and thresholds with the gradient descent method, this paper uses the advantages of particle swarm optimization in the field of parameter optimization to optimize BP neural network with PSO algorithm. The structure of BP neural network weights and the threshold of each neuron in the coding, through intelligent search for each particle, find the most suitable weights and thresholds, so that the BP neural network has faster convergence speed, better generalization ability, and higher prediction precision. Simulation results also show that the proposed algorithm is competitive enough.


---

## Body

## 1. Introduction

Construction project management [1–3] primarily consists of preliminary investment estimation [4, 5], plan design expansion design [6], construction drawing design [7], stage design budget, project budget in the bidding stage, project settlement, and project final accounts after completion, among other things. The investment estimation of construction costs [8–10] is the focus of construction project management. The profitability of a project is determined by the investment estimate of the construction cost [11]. The cost of construction and installation works, or the cost of construction works, plays a significant role in estimating the investment value of construction projects. As a result, estimating the cost of a construction project is crucial [12].Predicting the cost of a construction project [13] is an important topic in the construction industry. It can serve as a solid foundation for project feasibility studies and design alternatives. Its precision has a direct impact on project investment decisions. The successful implementation of construction project cost prediction can improve the control and management of construction project costs, making it a valuable research topic.The cost of a construction project is forecasted using historical data from similar projects and mathematical models. In the past, traditional statistical analysis [14–16] and simple regression theory [17] were frequently used to predict construction project costs [18], using moving smoothing, linear regression, or the unit index method, for example. We discovered through extensive scientific research that the traditional construction engineering cost estimation method has several flaws, including low calculation accuracy and long calculation times. Since the influencing factors of construction project cost are many and complicated, and the data collected on the past project cost has high randomness and ambiguity. Also, when selecting indicators for estimation, most of the indicators have a certain degree of consistency. It refers to a geographical area or the construction industry. The uniformity in the field, for example, did not take into account the management level, professional capabilities of the travel industry unit, as well as project quality, safety, and construction period, and was unable to adapt well to the market economic system. As a result, traditional construction project cost forecasting [19, 20] often fails to achieve satisfactory accuracy, and it often takes a long time. The construction project cost prediction loses its practical significance as a result of its low precision and time-consuming nature.The realization of high-precision cost forecasting through mathematical modeling has piqued the interest of industry professionals and academics [21, 22], thanks to the rapid advancement of computer and neural network technologies [23–25]. Certain mathematical models and related historical engineering data are used to make the construction cost forecast. The BP neural network [26] is a relatively simple mathematical model in comparison to other learning models, but it has a lot of application value in project cost prediction. However, the traditional BP neural network prediction model has defects such as low calculation accuracy, poor stability, and insufficient generalization ability. Therefore, this paper intends to use the combination of particle swarm optimization algorithm and BP neural network to quickly predict the project cost.The main contributions of this article are as follows:(1)
This paper proposes a novel construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network, which can predict the construction project cost more accurately and provide a basis for the cost management of the whole life cycle of the project.(2)
This paper uses the advantages of particle swarm optimization in the field of parameter optimization to optimize the BP neural network through the PSO algorithm. That is, to code the weights and thresholds between the neurons in the BP neural network structure, and find the most suitable weights and thresholds through the intelligent search of each particle, so that the BP neural network has a faster convergence speed, stronger generalization ability, and higher prediction accuracy.The rest of this article is organized as follows: Section2 introduces the background of the research. Section 3 introduces the principle of the proposed algorithm in detail. Section 4 provides the experimental results. In Section 5, a conclusion based on this work is given.


## 2. Background

Construction project cost prediction is a very important aspect of work in the construction engineering industry, and it is very important in the management of construction projects. The prediction of construction project cost often occurs in the early stage of project construction. It is the basis of the feasibility study of construction projects and the important basis for the comparison and selection of design schemes, which will directly affect the investment decision of the project. In view of the timely accuracy required for project investment decision-making, therefore, the accuracy and effectiveness of construction project cost forecasts are of vital importance.In the past, the prediction of construction project cost was mainly achieved through the unit index method, that is, according to the characteristics, structure, and scale of the project, the corresponding forecasting index was applied, calculated, and summarized. The whole process is relatively complicated and time consuming; at the same time, this set of forecasting schemes also has the problem that the forecasting accuracy is difficult to guarantee. The unit index method is used to predict the construction project cost. The index system is unified by the local or industry, each project’s construction management level and construction site conditions are not uniform, and they have strong individualism. Therefore, the use of the unit index method fails to fully consider the individuality of each single project, which leads to the insufficient accuracy of the method for predicting the construction project cost.In recent years, many domestic and foreign experts and scholars have proposed a new method of construction project cost prediction in order to achieve accurate and rapid construction cost forecasting, that is, forecasting based on traditional statistical analysis methods. Most of these researchers have adopted methods such as probability theory and linear regression to quickly predict the cost of construction projects. These forecasting technologies can often realize the forecast of construction project cost under certain conditions; but, they often have problems such as low forecasting accuracy and time-consuming forecasting, and their generalization ability is poor, and their application prospects are not good.Many researchers are focusing their efforts on construction cost prediction, and it is difficult to find a more suitable mathematical model to achieve satisfactory construction cost prediction accuracy and speed. The previous unit index method had an index system that was uniformly formulated by localities or industries and had poor marketability. It is often difficult to consider the unique construction management circumstances of each project, and it has no promotional value. Traditional statistical analysis methods, such as linear regression analysis, are difficult to use and time consuming. In recent years, with the advancement of science and technology, the development of computer science and artificial intelligence theory, some intelligent mathematical theoretical models have been gradually applied to the application of these theories in the construction cost forecasting, and certain effects have been achieved. For example, with the development of the construction project cost prediction model based on artificial neural network prediction with higher prediction accuracy, the prediction speed is also faster. However, these research results are often due to the unreasonable construction of the project cost index system or the lack of clear selection of case projects, resulting in poor universality of the research results. There are still many problems to be solved in the prediction of construction project cost.


## 3. Methodology

### 3.1. Project Costs

The estimated or actual expenditure of the construction project during the construction period is referred to as project cost. In today’s market, project cost can take on two different meanings depending on the supply and demand objects. The total fixed asset investment cost of the expected or actual expenditure of a project is analyzed from the perspective of the investor (owner). Investors must complete a series of activities, including investment decision-making, survey and design, bidding, construction, and completion and acceptance, in order to obtain the expected benefits of an investment project. The project cost refers to the total cost of the above activities. From this perspective, the project cost is the total investment in fixed assets of the construction project, as shown in Figure1.Figure 1
Composition of the project cost.From the standpoint of market exchanges, the contract price of construction projects formed by the market is referred to as project cost. It is a common and important type of project cost. Using the construction project as the transaction object, the market forms the price agreed upon by the main body of demand (investors) and the main body of supply (contractors)—construction and installation project costs, through the contract transaction (most contract parties bid, and the contractor bids), on the basis of multiple estimates.From the above content, we can see that the meaning of the project cost changes with the change of the construction object. In fact, the two meanings grasp the essence of the project cost from different perspectives. For the investor (owner), the project cost not only involves the construction of a project to pay all the costs, in addition to the contract price, but also includes the construction of early investment management fees, consulting fees, research and test fees, environmental impact assessment fees, reserve fees, and interest generated in the construction period and other costs. But for the contractor, the cost of the construction project refers to the cost of the construction and installation project signed with the investor (owner). For the whole construction project, the cost of construction and installation can account for 65–70% of the total cost, and other costs are calculated based on the cost of construction and installation. Therefore, this paper takes the second meaning of construction installation project cost as the research object.It is the construction and installation project investment in the construction project investment, as well as a component of the project cost, from the perspective of investment. It is a price determined by the market and agreed upon by the investor and the construction party in the context of market transactions. The cost of construction and installation projects refers to the costs of the project’s construction, supporting projects, and production equipment installation. The structure is depicted in Figure2.Figure 2
Composition of construction and installation engineering costs.


### 3.2. Particle Swarm Optimization Algorithm

#### 3.2.1. Mathematical Description of PSO

The goal of particle swarm optimization (PSO) is to set the initial position and speed of a swarm of random particles, then find the best solution using a constant iterative search under certain conditions. It is a clever algorithm that is based on group behavior. Bird behavior appears to be under some control, according to research into their flight characteristics. There appears to be some relationship between individuals and between individuals and groups under this control, and the birds rely on this connection for food.Suppose that in aD-dimensional target search space, there are n particles that represent the possible solutions of the problem, that is to say, the position of the particle is the possible solution of the research problem in the D-dimensional space. The population is X=x1,x2,…,xd, where the position and velocity of the particle i are Xi=xi1,xi2,…xid,i=1,2,…,n, Vi=vi1,vi2,…vid,i=1,2,…,n and the particles will be updated in the iterative process according to the optimal solution. One is the best position Pbest of the individual searched by the particle, that is,Pi=pi1,pi2,…pid,i=1,2,…,n, and the other one is the best position Gbest determined by the population search, that is, Pg=pg1,pg2,…pgd,g=1,2,…,n. When the i-th particle finds the abovementioned best extreme point, the velocity of the particle and the position of the next iteration are updated according to the following equation:(1)vidk+1=vidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk,Xidk+1=Xidk+vidk+1,where k is the number of iterations and c1 and c2 are acceleration constants, namely, learning factors. c1 mainly adjusts the step size of the particle flying to its own best position, c2 mainly adjusts the step size of the particle flying to the global best position, r1 and r2 are random numbers evenly distributed between 0 and 1.In order to improve the search ability of particles, a particle swarm algorithm with inertia weight is proposed, and the inertia weight factorω is introduced to the initial velocity of each iteration of the particles:(2)vidk+1=ωvidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk.The introduction of inertial weight can affect the optimization ability of particles. Specifically, a largerω can improve the global search ability of the algorithm, and a smaller ω can improve the local search ability of the algorithm. According to the different forms of inertial weight ω, a variety of particle swarm algorithms have been produced. Common ones include adaptive weights, linearly decreasing weights, and random weight algorithms. This paper uses linearly decreasing inertia weights, and the weight change formula is as follows:(3)ω=ωmax−t∗ωmax−ωmintmax.


#### 3.2.2. Optimization Process of PSO

The PSO algorithm flow is shown in Algorithm1.Algorithm 1: Flow of particle swarm algorithm.
Steps of specific operationStep 1: set parameters such asω, N, c1 and c2, termination conditions in the algorithm.Step 2: initialize the population, including random positions and speeds.Step 3: evaluate the fitness value of the particle fitness.Step 4: the fitness value of each particle is compared with the best position (individual extreme value) it has passed. If the current fitness value is better, its position is taken as the current best positionPbest.Step 5: similarly, the fitness value of each particle is compared with the global best position it has passed, and if the current fitness value is better, its location is taken as the current global best positionGbest.Step 6: update the speed and position of particles.Step 7: determine whether the termination conditions are met, if not, return to the third step to continue the iterative update. Otherwise, thePbest corresponding to the current fitness value is output as the global optimal solution, and the search is stopped.


### 3.3. Project Cost Prediction Model

BP neural network algorithm is a single point search method based on gradient descent of error function, which has no global search ability. Therefore, in the process of learning and training of BP neural network, it is inevitable that there will be poor robustness, slow convergence speed, poor generalization ability, and other shortcomings. However, the PSO algorithm has the advantages of simple structure, large search range, strong robustness, fast convergence, and so on, and can solve most global optimal solutions. Therefore, this study combines the advantages of the two and establishes a project cost prediction model based on PSO optimization and BP neural network parameters.In the modeling process of the BP neural network, two key numbers need to be set: weightω and threshold θ, which are a group of random values and easily fall into local minimum values. The training of weights and thresholds is actually a complex problem to find the optimal parameters. The gradient descent method is used to update the connection weights and thresholds. Even if there is a slight change in weights and thresholds, the neural network will get completely different operating results. The determination and optimization of these two factors determine the generalization ability and stability of the model to a great extent. To optimize the BP network through the PSO algorithm, it is necessary to encode the weights and thresholds among each neuron in the structure of the BP network, and search each particle intelligently to find the most appropriate weights and thresholds, so that the BP neural network has faster convergence speed and better generalization ability.The individual in the PSO algorithm corresponds to the initial weight parameters of each layer of the BP network, and the weight coefficient of each layer is adjusted by the particle swarm algorithm. When the termination condition is met, the search is stopped. The structure of the BP neural network proposed in this paper isi−b−j. There are i∗b weights connecting the input layer and the hidden layer, b∗j weights connecting the hidden layer and the output layer, and the number of hidden layer thresholds is b., There are j thresholds in the output layer, so the dimension of the particle is d=i∗b+b∗j+b+j. The fitness function F of PSO is expressed in the following equation:(4)F=1M∑i=1M∑j=1Nyij−xij2,where M is the total number of input learning samples, N is the number of output nodes, yij is the actual output value of the corresponding parameter, and xij is the expected output value of the corresponding parameter. Therefore, the model of the construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network is shown in Figure 3.Figure 3
Schematic diagram of the model of construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network.


## 3.1. Project Costs

The estimated or actual expenditure of the construction project during the construction period is referred to as project cost. In today’s market, project cost can take on two different meanings depending on the supply and demand objects. The total fixed asset investment cost of the expected or actual expenditure of a project is analyzed from the perspective of the investor (owner). Investors must complete a series of activities, including investment decision-making, survey and design, bidding, construction, and completion and acceptance, in order to obtain the expected benefits of an investment project. The project cost refers to the total cost of the above activities. From this perspective, the project cost is the total investment in fixed assets of the construction project, as shown in Figure1.Figure 1
Composition of the project cost.From the standpoint of market exchanges, the contract price of construction projects formed by the market is referred to as project cost. It is a common and important type of project cost. Using the construction project as the transaction object, the market forms the price agreed upon by the main body of demand (investors) and the main body of supply (contractors)—construction and installation project costs, through the contract transaction (most contract parties bid, and the contractor bids), on the basis of multiple estimates.From the above content, we can see that the meaning of the project cost changes with the change of the construction object. In fact, the two meanings grasp the essence of the project cost from different perspectives. For the investor (owner), the project cost not only involves the construction of a project to pay all the costs, in addition to the contract price, but also includes the construction of early investment management fees, consulting fees, research and test fees, environmental impact assessment fees, reserve fees, and interest generated in the construction period and other costs. But for the contractor, the cost of the construction project refers to the cost of the construction and installation project signed with the investor (owner). For the whole construction project, the cost of construction and installation can account for 65–70% of the total cost, and other costs are calculated based on the cost of construction and installation. Therefore, this paper takes the second meaning of construction installation project cost as the research object.It is the construction and installation project investment in the construction project investment, as well as a component of the project cost, from the perspective of investment. It is a price determined by the market and agreed upon by the investor and the construction party in the context of market transactions. The cost of construction and installation projects refers to the costs of the project’s construction, supporting projects, and production equipment installation. The structure is depicted in Figure2.Figure 2
Composition of construction and installation engineering costs.


## 3.2. Particle Swarm Optimization Algorithm

### 3.2.1. Mathematical Description of PSO

The goal of particle swarm optimization (PSO) is to set the initial position and speed of a swarm of random particles, then find the best solution using a constant iterative search under certain conditions. It is a clever algorithm that is based on group behavior. Bird behavior appears to be under some control, according to research into their flight characteristics. There appears to be some relationship between individuals and between individuals and groups under this control, and the birds rely on this connection for food.Suppose that in aD-dimensional target search space, there are n particles that represent the possible solutions of the problem, that is to say, the position of the particle is the possible solution of the research problem in the D-dimensional space. The population is X=x1,x2,…,xd, where the position and velocity of the particle i are Xi=xi1,xi2,…xid,i=1,2,…,n, Vi=vi1,vi2,…vid,i=1,2,…,n and the particles will be updated in the iterative process according to the optimal solution. One is the best position Pbest of the individual searched by the particle, that is,Pi=pi1,pi2,…pid,i=1,2,…,n, and the other one is the best position Gbest determined by the population search, that is, Pg=pg1,pg2,…pgd,g=1,2,…,n. When the i-th particle finds the abovementioned best extreme point, the velocity of the particle and the position of the next iteration are updated according to the following equation:(1)vidk+1=vidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk,Xidk+1=Xidk+vidk+1,where k is the number of iterations and c1 and c2 are acceleration constants, namely, learning factors. c1 mainly adjusts the step size of the particle flying to its own best position, c2 mainly adjusts the step size of the particle flying to the global best position, r1 and r2 are random numbers evenly distributed between 0 and 1.In order to improve the search ability of particles, a particle swarm algorithm with inertia weight is proposed, and the inertia weight factorω is introduced to the initial velocity of each iteration of the particles:(2)vidk+1=ωvidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk.The introduction of inertial weight can affect the optimization ability of particles. Specifically, a largerω can improve the global search ability of the algorithm, and a smaller ω can improve the local search ability of the algorithm. According to the different forms of inertial weight ω, a variety of particle swarm algorithms have been produced. Common ones include adaptive weights, linearly decreasing weights, and random weight algorithms. This paper uses linearly decreasing inertia weights, and the weight change formula is as follows:(3)ω=ωmax−t∗ωmax−ωmintmax.


### 3.2.2. Optimization Process of PSO

The PSO algorithm flow is shown in Algorithm1.Algorithm 1: Flow of particle swarm algorithm.
Steps of specific operationStep 1: set parameters such asω, N, c1 and c2, termination conditions in the algorithm.Step 2: initialize the population, including random positions and speeds.Step 3: evaluate the fitness value of the particle fitness.Step 4: the fitness value of each particle is compared with the best position (individual extreme value) it has passed. If the current fitness value is better, its position is taken as the current best positionPbest.Step 5: similarly, the fitness value of each particle is compared with the global best position it has passed, and if the current fitness value is better, its location is taken as the current global best positionGbest.Step 6: update the speed and position of particles.Step 7: determine whether the termination conditions are met, if not, return to the third step to continue the iterative update. Otherwise, thePbest corresponding to the current fitness value is output as the global optimal solution, and the search is stopped.


## 3.2.1. Mathematical Description of PSO

The goal of particle swarm optimization (PSO) is to set the initial position and speed of a swarm of random particles, then find the best solution using a constant iterative search under certain conditions. It is a clever algorithm that is based on group behavior. Bird behavior appears to be under some control, according to research into their flight characteristics. There appears to be some relationship between individuals and between individuals and groups under this control, and the birds rely on this connection for food.Suppose that in aD-dimensional target search space, there are n particles that represent the possible solutions of the problem, that is to say, the position of the particle is the possible solution of the research problem in the D-dimensional space. The population is X=x1,x2,…,xd, where the position and velocity of the particle i are Xi=xi1,xi2,…xid,i=1,2,…,n, Vi=vi1,vi2,…vid,i=1,2,…,n and the particles will be updated in the iterative process according to the optimal solution. One is the best position Pbest of the individual searched by the particle, that is,Pi=pi1,pi2,…pid,i=1,2,…,n, and the other one is the best position Gbest determined by the population search, that is, Pg=pg1,pg2,…pgd,g=1,2,…,n. When the i-th particle finds the abovementioned best extreme point, the velocity of the particle and the position of the next iteration are updated according to the following equation:(1)vidk+1=vidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk,Xidk+1=Xidk+vidk+1,where k is the number of iterations and c1 and c2 are acceleration constants, namely, learning factors. c1 mainly adjusts the step size of the particle flying to its own best position, c2 mainly adjusts the step size of the particle flying to the global best position, r1 and r2 are random numbers evenly distributed between 0 and 1.In order to improve the search ability of particles, a particle swarm algorithm with inertia weight is proposed, and the inertia weight factorω is introduced to the initial velocity of each iteration of the particles:(2)vidk+1=ωvidk+c1r1Pidk−Xidk+c2r2Pgdk−Xidk.The introduction of inertial weight can affect the optimization ability of particles. Specifically, a largerω can improve the global search ability of the algorithm, and a smaller ω can improve the local search ability of the algorithm. According to the different forms of inertial weight ω, a variety of particle swarm algorithms have been produced. Common ones include adaptive weights, linearly decreasing weights, and random weight algorithms. This paper uses linearly decreasing inertia weights, and the weight change formula is as follows:(3)ω=ωmax−t∗ωmax−ωmintmax.


## 3.2.2. Optimization Process of PSO

The PSO algorithm flow is shown in Algorithm1.Algorithm 1: Flow of particle swarm algorithm.
Steps of specific operationStep 1: set parameters such asω, N, c1 and c2, termination conditions in the algorithm.Step 2: initialize the population, including random positions and speeds.Step 3: evaluate the fitness value of the particle fitness.Step 4: the fitness value of each particle is compared with the best position (individual extreme value) it has passed. If the current fitness value is better, its position is taken as the current best positionPbest.Step 5: similarly, the fitness value of each particle is compared with the global best position it has passed, and if the current fitness value is better, its location is taken as the current global best positionGbest.Step 6: update the speed and position of particles.Step 7: determine whether the termination conditions are met, if not, return to the third step to continue the iterative update. Otherwise, thePbest corresponding to the current fitness value is output as the global optimal solution, and the search is stopped.


## 3.3. Project Cost Prediction Model

BP neural network algorithm is a single point search method based on gradient descent of error function, which has no global search ability. Therefore, in the process of learning and training of BP neural network, it is inevitable that there will be poor robustness, slow convergence speed, poor generalization ability, and other shortcomings. However, the PSO algorithm has the advantages of simple structure, large search range, strong robustness, fast convergence, and so on, and can solve most global optimal solutions. Therefore, this study combines the advantages of the two and establishes a project cost prediction model based on PSO optimization and BP neural network parameters.In the modeling process of the BP neural network, two key numbers need to be set: weightω and threshold θ, which are a group of random values and easily fall into local minimum values. The training of weights and thresholds is actually a complex problem to find the optimal parameters. The gradient descent method is used to update the connection weights and thresholds. Even if there is a slight change in weights and thresholds, the neural network will get completely different operating results. The determination and optimization of these two factors determine the generalization ability and stability of the model to a great extent. To optimize the BP network through the PSO algorithm, it is necessary to encode the weights and thresholds among each neuron in the structure of the BP network, and search each particle intelligently to find the most appropriate weights and thresholds, so that the BP neural network has faster convergence speed and better generalization ability.The individual in the PSO algorithm corresponds to the initial weight parameters of each layer of the BP network, and the weight coefficient of each layer is adjusted by the particle swarm algorithm. When the termination condition is met, the search is stopped. The structure of the BP neural network proposed in this paper isi−b−j. There are i∗b weights connecting the input layer and the hidden layer, b∗j weights connecting the hidden layer and the output layer, and the number of hidden layer thresholds is b., There are j thresholds in the output layer, so the dimension of the particle is d=i∗b+b∗j+b+j. The fitness function F of PSO is expressed in the following equation:(4)F=1M∑i=1M∑j=1Nyij−xij2,where M is the total number of input learning samples, N is the number of output nodes, yij is the actual output value of the corresponding parameter, and xij is the expected output value of the corresponding parameter. Therefore, the model of the construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network is shown in Figure 3.Figure 3
Schematic diagram of the model of construction project cost prediction algorithm based on particle swarm optimization-guided BP neural network.


## 4. Experiments and Results

### 4.1. Experimental Setup

The Matlab 2018b platform is used to simulate and analyze the construction project cost prediction model developed in this study. It is created using a matrix system. Its instruction expression is similar to engineering mathematics language, reducing the time-consuming challenges connected with programming in language and other languages. It greatly reduces the number of programming sentences and improves the efficiency of computing. It is a type of powerful mathematical software that is well-suited for mathematical modeling and the processing of extremely complex mathematical operations. A large number of toolboxes are preinstalled, and users can name them as needed. In addition, the operating system used is Windows 10, and the parameter settings of the improved BP neural network are shown in Table1.Table 1
Hyperparameter setting.
.trainParam.goal = 0.1.trainParam.epochs = 300.trainParam.show = 20.trainParam.mc = 0.95.trainParam.lr = 0.05.trainParam.min_grad = 1e − 6.trainParam.min_fail = 5


### 4.2. Dataset

The data selected in this paper are from the final accounting data of a real estate enterprise’s existing project in Jiangsu. We obtained the final account data of 240 completed high-rise residential projects constructed by the real estate company in Jiangsu in the past three years. After eliminating unnecessary and redundant information, 227 sets of valid training samples were obtained. In Section3.1, the high-rise residential project cost prediction index includes numerical quantitative index and character qualitative index. For the selected sample data, quantitative indicators such as floor area and number of floors can be directly input according to the actual engineering data, but qualitative indicators such as basic types and interior wall decoration cannot be directly input. It makes it simple for the prediction model to learn and train on the sample data. The unilateral cost Y is taken as the output set, and the remaining indicators X1X17 are taken as the input set. The data of qualitative indicators of character type after quantitative processing are shown in Table 2.Table 2
Examples of data sets.
IDX1X2X3X4X5X6X7X8X9X10X11X12X13X14X15X16X17Y152364.126321.233122.895.341040431131443125.21271256.234215.743112.910041051432132442369.23.........................................................22725456.391423.053332.999.341082331131343253.24


### 4.3. Evaluation Index

In this paper, the relative error and the relative error of the average absolute value are used to reflect the influence of different algorithms on the prediction effect of the model. The calculation equation is as follows:(5)δ=Ti−FiTi,MAPE=1m∑i=1mδ×100%,where Ti and Fi represent the actual value and predicted value of the i-th sample, respectively, and m represents the number of test samples.


### 4.4. Forecast Result Analysis

According to the input set of the prediction model obtained above, 20% of the 227 sets of data were first selected as test data, and then the remaining 80% of the data were used as training data to train the model. BP neural network and PSO-BP neural network are used to simulate and predict the construction cost, respectively. The prediction comparison results are shown in Table3.Table 3
Comparison of prediction results of different algorithms.
Test sampleTrue valuePredictive valueBPARIMAOurs2142263.212305.322301.252271.232192314.202412.232501.252319.222202514.632519.652501.362515.232222412.222432.332438.522410.252252272.582289.252279.012274.36The prediction model that optimizes the BP neural network parameters through the PSO algorithm is significantly better than the single BP neural network model in terms of predictive stability, as shown in Table3 and Figure 4, and the model is more stable. Simultaneously, the relative errors of the three models can be controlled within 10%, and the prediction effects of the three models are excellent, as shown in Table 3. Forecast accuracy can be achieved during the investment decision-making stage. The optimized PSO-BP model, on the other hand, is significantly less accurate than the BP neural network, and the BP neural network’s error is lower than the ARIMA model, as determined by the average absolute relative error of the test samples. Thus, the high-rise residential project cost prediction model based on PSO-BP neural network performs better in terms of error control and prediction accuracy.Figure 4
Forecast curve.The results show that the BP neural network model with optimized parameters has a good application effect in cost prediction. For the construction project cost prediction, the prediction model based on PSO optimization BP neural network parameters has a good guiding significance, and it is very suitable for the preliminary construction cost prediction.


### 4.5. Ablation Experiments

In order to further verify the effectiveness and superiority of the algorithm in this section, this section conducts the particle swarm optimization algorithm to improve the ablation experiment of the BP neural network. Let “PSO” represent the particle swarm algorithm, the results of the ablation experiment are shown in Table4.Table 4
Comparison of prediction results of different algorithms.
Test sampleTrue valuePredictive valueBP-NO-PSOPSOBP + PSO (ours)2142263.212411.312357.882271.232192314.202198.662411.442319.222202514.632318.132688.112515.232222412.222333.672422.662410.252252272.582411.992316.432274.36It can be clearly seen from Table4 that the average absolute percentage error of using only the BP network is the largest. Secondly, the MAPE of PSO is lower than that of the BP network, but no matter what, BP + PSP has achieved the best prediction performance. This again proves the superiority of the algorithm in this paper.


## 4.1. Experimental Setup

The Matlab 2018b platform is used to simulate and analyze the construction project cost prediction model developed in this study. It is created using a matrix system. Its instruction expression is similar to engineering mathematics language, reducing the time-consuming challenges connected with programming in language and other languages. It greatly reduces the number of programming sentences and improves the efficiency of computing. It is a type of powerful mathematical software that is well-suited for mathematical modeling and the processing of extremely complex mathematical operations. A large number of toolboxes are preinstalled, and users can name them as needed. In addition, the operating system used is Windows 10, and the parameter settings of the improved BP neural network are shown in Table1.Table 1
Hyperparameter setting.
.trainParam.goal = 0.1.trainParam.epochs = 300.trainParam.show = 20.trainParam.mc = 0.95.trainParam.lr = 0.05.trainParam.min_grad = 1e − 6.trainParam.min_fail = 5


## 4.2. Dataset

The data selected in this paper are from the final accounting data of a real estate enterprise’s existing project in Jiangsu. We obtained the final account data of 240 completed high-rise residential projects constructed by the real estate company in Jiangsu in the past three years. After eliminating unnecessary and redundant information, 227 sets of valid training samples were obtained. In Section3.1, the high-rise residential project cost prediction index includes numerical quantitative index and character qualitative index. For the selected sample data, quantitative indicators such as floor area and number of floors can be directly input according to the actual engineering data, but qualitative indicators such as basic types and interior wall decoration cannot be directly input. It makes it simple for the prediction model to learn and train on the sample data. The unilateral cost Y is taken as the output set, and the remaining indicators X1X17 are taken as the input set. The data of qualitative indicators of character type after quantitative processing are shown in Table 2.Table 2
Examples of data sets.
IDX1X2X3X4X5X6X7X8X9X10X11X12X13X14X15X16X17Y152364.126321.233122.895.341040431131443125.21271256.234215.743112.910041051432132442369.23.........................................................22725456.391423.053332.999.341082331131343253.24


## 4.3. Evaluation Index

In this paper, the relative error and the relative error of the average absolute value are used to reflect the influence of different algorithms on the prediction effect of the model. The calculation equation is as follows:(5)δ=Ti−FiTi,MAPE=1m∑i=1mδ×100%,where Ti and Fi represent the actual value and predicted value of the i-th sample, respectively, and m represents the number of test samples.


## 4.4. Forecast Result Analysis

According to the input set of the prediction model obtained above, 20% of the 227 sets of data were first selected as test data, and then the remaining 80% of the data were used as training data to train the model. BP neural network and PSO-BP neural network are used to simulate and predict the construction cost, respectively. The prediction comparison results are shown in Table3.Table 3
Comparison of prediction results of different algorithms.
Test sampleTrue valuePredictive valueBPARIMAOurs2142263.212305.322301.252271.232192314.202412.232501.252319.222202514.632519.652501.362515.232222412.222432.332438.522410.252252272.582289.252279.012274.36The prediction model that optimizes the BP neural network parameters through the PSO algorithm is significantly better than the single BP neural network model in terms of predictive stability, as shown in Table3 and Figure 4, and the model is more stable. Simultaneously, the relative errors of the three models can be controlled within 10%, and the prediction effects of the three models are excellent, as shown in Table 3. Forecast accuracy can be achieved during the investment decision-making stage. The optimized PSO-BP model, on the other hand, is significantly less accurate than the BP neural network, and the BP neural network’s error is lower than the ARIMA model, as determined by the average absolute relative error of the test samples. Thus, the high-rise residential project cost prediction model based on PSO-BP neural network performs better in terms of error control and prediction accuracy.Figure 4
Forecast curve.The results show that the BP neural network model with optimized parameters has a good application effect in cost prediction. For the construction project cost prediction, the prediction model based on PSO optimization BP neural network parameters has a good guiding significance, and it is very suitable for the preliminary construction cost prediction.


## 4.5. Ablation Experiments

In order to further verify the effectiveness and superiority of the algorithm in this section, this section conducts the particle swarm optimization algorithm to improve the ablation experiment of the BP neural network. Let “PSO” represent the particle swarm algorithm, the results of the ablation experiment are shown in Table4.Table 4
Comparison of prediction results of different algorithms.
Test sampleTrue valuePredictive valueBP-NO-PSOPSOBP + PSO (ours)2142263.212411.312357.882271.232192314.202198.662411.442319.222202514.632318.132688.112515.232222412.222333.672422.662410.252252272.582411.992316.432274.36It can be clearly seen from Table4 that the average absolute percentage error of using only the BP network is the largest. Secondly, the MAPE of PSO is lower than that of the BP network, but no matter what, BP + PSP has achieved the best prediction performance. This again proves the superiority of the algorithm in this paper.


## 5. Conclusion

In this paper, a fast, accurate, convenient, and reasonable construction project cost forecasting method to provide a basis for the cost management of the whole life cycle of the project has been studied. Therefore, this paper improves the BP neural network through the particle swarm optimization algorithm, and proposes a novel construction project cost prediction algorithm based on the particle swarm optimization-guided BP neural network. Aiming at the defects of the BP neural network using gradient descent method to update weights and thresholds, this paper uses the advantages of the particle swarm algorithm in the field of parameter optimization to optimize the BP neural network through PSO algorithm. That is, to code the weights and thresholds between the neurons in the BP neural network structure, and find the most suitable weights and thresholds through the intelligent search of each particle, so that the BP neural network has a faster convergence speed. Stronger generalization ability, higher prediction accuracy, and simulation experiments also show that the discussed algorithm has competitive performance.In addition, considering that the current work is time series data, in the next work, an attempt will be made to use the LSTM network to continue the research.



---

*Source: 4309495-2021-10-21.xml*