Keywords

1 Introduction

A very important content for the management of university management is the management for restaurant. But now the restaurant management is still mainly relying on personal experience, there is no data system support [1]. This paper uses BP artificial neural network technology to create a university canteen sales forecast model for the university restaurant management to provide a credible reference data – the sales amount. It is not only helpful for the school to better carry out the logistics management of the canteen, but also helpful to provide a reference for the restaurant to make a more suitable production plan.

In this paper, a pioneering achievement is the use of Baidu index, meteorological factors to predict the restaurant turnover. The prediction model established in this paper can reproduce the restaurant management to a great extent. The results show that the Baidu index of the takeaway site plays a more important role than the rainfall information. Liwen Vaughan, Yue Chen demonstrated the use of Google trends and Baidu index in the availability of data mining [2], and this article will continue to refine its application in the field of prediction. Prediction model based on BP artificial neural network is one of the most effective methods for forecasting problems. In 2008, Wang Wanjun [3] used the gray BP neural network to forecast the sales of commercial housing. In Although the results were satisfactory, the paper did not apply the sales-related factors to model. The model constructed in our research also obtains the predictive variables such as meteorological information and Baidu index. And at the same time, we obtained a more accurate prediction result. In 2014, Song Guofeng and Liang Changyong [4] used the improved BP neural network to forecast the traffic volume of the tourist scenic spot. In the paper, meteorological information and period information were used as the prediction factors, and the satisfactory results were obtained. It can be seen that BP Neural networks have powerful predictive functions for variables with periodic variation rules. Also in 2014, Luo Ronglei et al. [5] used genetic algorithm BP neural network prediction to model the clothing sales, but the predictive variables selected in this paper are expert score which are quite subjective. However, the predictor variables we selected are the objective data that avoid the influence of human subjectivity.

2 The BP Neural Network Algorithm

2.1 Initialization

Input training samples, the input vector X and the expected output vector d are obtained, and the output of each layer is calculated [7].

Net input of hidden layer neuron j:

$$ net_{j} = \sum\nolimits_{i = 0}^{n} {v_{ij} *x_{i} \,\,\,j = 1,2 \ldots \ldots m} $$
(1)

The net input to the hidden layer neuron j is equal to the sum of initial weight multiplied by the input value.

Output of hidden layer neurons j:

$$ y_{j} = f(net_{j} )\,\,\,j = 1,2 \ldots \ldots m $$
(2)

The output of j in the hidden layer neurons is equal to the activation function acting on the net input value of j.

The net input of the output layer neuron k:

$$ net_{k} = \sum\nolimits_{j = 0}^{m} {\omega_{jk} *y_{j} } $$
(3)

The net input of the output layer neuron k is equal to the weight of the hidden layer to the output layer multiplied by the output weight of the hidden layer j.

Output the output layer of the neuron j:

$$ o_{k} = f(net_{k} ) $$
(4)

The output of k in the output layer neurons is equal to the activation function acting on the net input value of k.

Activation function:

$$ {\text{f}}\left( {\text{x}} \right) = \frac{{1 - e^{ - x} }}{{1 + e^{ - x} }} $$
(5)

2.2 Calculate Network Output Error

The root mean square error is used as the total error of the network:

$$ {\text{E}} = \sqrt {\sum\nolimits_{{\text{k} = 1}}^{l} {\left( {d_{k} - o_{k} } \right)^{2} } } $$
(6)

Hidden layer expected output vector [9]:

$$ Y^{ '} \left( t \right) = f(\sum\nolimits_{i = 1}^{n} {(W_{ij} \left( t \right)X_{i} \left( t \right) + \theta_{j} \left( t \right))} $$
(7)

Output node expectation and prediction error:

$$ e_{j} = Y\left( t \right) - Y^{ '} \left( t \right) (1 \le \,j\, \le k) $$
(8)

2.3 Adjust Each Layer Weight

Adjustment of each layer:

$$ \Delta \omega_{jk} = \eta ({\text{d}}_{k} - {\text{o}}_{k} )o_{k} \left( {1 - o_{k} } \right)y_{j} $$
(9)
$$ \Delta {\text{v}}_{ij} = \eta \left\{ {\sum\nolimits_{k = 1}^{l} {\left( {d_{k} - o_{k} } \right)o_{k} \left( {1 - o_{k} } \right)} } \right\}\omega_{jk} y_{j} \left( {1 - y_{j} } \right)x_{i} $$
(10)

\( \eta \) is the learning rate.

Adjusted weights:

$$ \omega_{j}^{ '} = \omega_{j} + \Delta \omega_{jk} $$
(11)
$$ {\text{v}}_{j}^{ '} = v_{j} + \Delta {\text{v}}_{ij} $$
(12)

Complete training once for all samples, check whether the maximum training time is reached, and if the end condition is satisfied, training is stopped; otherwise, training is continued from step (2) until the end condition is satisfied.

3 Evaluation System of Result

3.1 Network Accuracy

$$ {\text{Network accuracy }} = 1/p\sum\nolimits_{t = 1}^{p} {\frac{{1 - \left| {{\text{Predictive value}} - {\text{Actual value}}} \right|}}{{{\text{Maximum predicted value}} - {\text{Minimum predicted value}}}}*100\% } $$
(13)

Where p represents the total number of test data sets, the greater the network accuracy, the better the quality of the network. Because of the accuracy of the model is calculated for the training set, this parameter is more optimistic than fact.

3.2 Mean Absolute Percentage Error (MAPE)

In order to evaluate the accuracy of the prediction model, this paper uses MAPE as another indicator of model evaluation.

$$ {\text{MAPE}} = \mathop \sum \nolimits \frac{{|{\text{Predicted value }} - {\text{Actual value}}|}}{\text{Actual value}}/p $$
(14)

MAPE is less than 10%, indicating that the model has high precision prediction effect. MAPE in 10%–20% shows that the model has a good prediction effect. MAPE between 20% and 50% indicates that the model is feasible. MAPE is greater than 50% indicating that the model is wrong, it doesn’t have the function of prediction.

3.3 Importance of Predictive Variables

The importance of the predictor variables indicates the relative importance of each variable in the prediction process, independent of the accuracy of the model predictions. The sum of all predictor variables was 1. The closer the importance value of the predictor variable to 1, the more important it is to establish the model. Here we use the Tchaban algorithm based on network weights to calculate the importance of predictive variables.

The sensitivity coefficient of input variable xi to output variable ok is:

$$ Q_{ik} = \frac{{X_{i} \left( t \right)}}{{O_{k}^{'} \left( t \right)}}\sum\nolimits_{j = 1}^{m} {W_{ij} \left( t \right)V_{jk} \left( t \right)} $$
(15)

t represents time. For numeric variables, t is selected as 0, 0.23, 0.5, 0.75, and 1. The average value of all the values of all input variables is taken as the input variable.

4 Experiment

The data used in this paper include the students’ card record of Minhang campus of Shanghai Jiao Tong University, the information of Minhang campus weather station and the Baidu index in Shanghai area.

4.1 Preliminary Data Processing

First remove the attributes that are not relevant to the purpose of this study from card data set, such as the opening hours of the restaurant and so on, and then complete the missing meteorological data.

Summarize the required variables and add the teaching week, holiday, and Wednesday information according to the Shanghai Jiao Tong University 2014–2015 school calendar, and finally get the data shown in Table 1. “Education Week” represented 2014–2015 year the first few weeks of teaching. Here a negative number indicates before the semester begins, a number more than 18 represent weeks after the end of the winter semester. “Holiday” shows that whether or not the date of the day is a holiday, and the field is divided into five categories: summer vacation (SV), winter vacation (WV), weekends (W), holidays (H), working days (WD). The week is represented by 1–7, 1 here represent Monday.

Table 1. The experimental data sample

We get 2014/09/01 to 2015/01/31 in the Shanghai region of the takeaway platform Baidu index from Baidu index search engine. In this article, according to the strength of the demand map in the Shanghai area we selected four network takeaway platform: ele.me, Delivery Hero, Baiduwaimai, Meituanwaimai.

The data were normalized by the students, and the outliers were removed. Finally, 7012 records were obtained.

4.2 Contrast Test

The sales data of four shops (First Floor Restaurant, Sichuan Snack, Xinjiang Restaurant, Chow Mein) were randomly selected by using time series and BP neural network respectively to forecast the sales.

  1. 1.

    Time Series Prediction Model

    Time series algorithm prediction is to use statistical techniques and methods or intelligent algorithms to find out the evolution model from the time series of prediction indicators, then establish mathematical models and make quantitative estimates of the future development trend of forecast indicators [10]. In this paper, we use SPSS Modeler’s own expert modeler algorithm for time series modeling, and finally calculate the MAPE value as shown in Table 2.

    Table 2. MAPE of Time series prediction model

    As can be seen from Table 2, in addition to the “First Floor Restaurant” outside the use of time series models are built with good prediction accuracy of the forecast model. The error of “First Floor Restaurant” is very large because there are some missing values.

  2. 2.

    BP Neural Network

    Applicate of BP neural network on the “First floor restaurant”, “Sichuan snack”, “Xinjiang restaurant”, “Chow Mein” these four restaurant sales data modeling. In order to avoid the over fitting of the model, 70% of the data were randomly selected as the training set, and the remaining 30% were tested. The evaluation index of the model is shown in Table 3.

    Table 3. Evaluation index of BP neural network model

    According to the MAPE value, it can be seen that the model based on BP neural network has higher accuracy than the time series prediction model. And for the “Sichuan Snack”, “Xinjiang Restaurant” in terms of two restaurants this model achieved high precision of prediction result. The comparison between the predicted results in September 2014 and the actual data in Fig. 1 is drawn for the direct comparison of the two models. It can be seen from the graph that BP neural network has better prediction effect than time series model.

    Fig. 1.
    figure 1

    Comparison of experimental results with real data

5 Result

Through the comparison experiment, it can be proved that the prediction model based on BP neural network has higher accuracy. We put “Merchant name”, “Baidu index of Baidu-waimai”, “Baidu index of Meituan-waimai”, “Baidu index of ele.me”, “Baidu index of Delivery Hero”, “Precipitation”, “Maximum wind speed”, “Temperature”, “Teaching week”, “Holidays”, “week”, a total of eleven variables as input variables to the BP neural network. And then we get a BP neural network model with three layers and 12 hidden layer nodes is established. The accuracy of network prediction can reach 93.7%, and MAPE is 19.74%. The MAPE value is higher than the previous test results. This is because in this model, the business situation of each merchant is different, so for each merchant, whether it is the transaction amount or the importance of the predictive variables have a greater discrepancy. If the total revenue of all restaurants in Minhang campus of Shanghai Jiao Tong University as the forecast target, the accuracy of BP neural network is 92.1%, and MAPE can reach to 8.46%, which is a high precision prediction model. If the total income of all restaurants in Minhang campus of Shanghai Jiao Tong University is used as the forecast target, the accuracy of BP neural network is 92.1% and MAPE can reach 8.46%, which is a high precision prediction model. Figure 2 shows the comparison of the actual values of the test data with the predicted values in September 2014. It can be seen from the graph that the prediction results are quite close to the actual results (Total transaction amount for all restaurants).

Fig. 2.
figure 2

Comparison of the actual transaction amount and the forecast transaction amount

Figure 3 shows the importance of each model prediction variable. “Merchant name” is the most important variable which accounted for 57%. This is because the management rule of each merchant is different, the forecast results will have great differences in merchant. “Teaching Week” occupied 9%, which explains the reasons for the slight downward trend in the amount of restaurant transactions. This is because that the cafeteria dishes change less, with the passage of time the students gradually lose the freshness of the cafeteria dishes, and are more inclined to choose other ways to eat. “Holiday” accounted for 8%, which explains the reasons for the decline in the amount of holiday restaurant transactions. The reason for this is that students are more inclined to go out or go home in the holidays, the number of students in school is less than usual which led to a decrease in the number of transaction amount. “Baidu index of Baiduwaimai” accounts for 6%. This shows that Baiduwaimai to a certain extent has impact on the school cafeteria business. But because the BP neural network is a black ox, it is unable to confirm the degree of influence. “Temperature” here accounts for 4%. For the “temperature”, too low temperature will affect the restaurant sales, because the weather is too cold students tend to buy takeout or dine out. For “Week”, the impact of weekends is undoubtedly huge, because students trend go out on weekends, the school restaurant turnover will decline. And in the working day, also roughly decline in accordance with Monday to Friday by the reduction changes in the law of change. “Baidu index of Meituanwaimai”, “Baidu index of ele.me”, “Baidu index of Delivery Hero” accounts for the same ratio was 3%. These three all have a certain impact on the canteen management, the same as the effect manner of “Baidu index of Baiduwaimai”. Students are more willing to buy food in the supermarket or order a take-away in the rain and windy weather, so the precipitation and wind speed will also affect the restaurant sales, although its impact is limited.

Fig. 3.
figure 3

The importance of each prediction variable

6 Conclusion

In this paper, the Baidu index of four takeaway websites, meteorological factors and cycle factors are used as predict variables. The choice of variables is also a major innovation in this article. Three-layer BP neural network is used to forecast the restaurant sales of Minhang campus of Shanghai Jiao Tong University. By comparing with the time series modeling method, finally prove that the model established has higher accuracy. Adopt the method of BP neural network model projections for individual businesses, the MAPE index under 20%, network accuracy above 90%. There are some defects, such as the paper chooses variables may not be comprehensive. In the future, we need to complete the variables and improve the algorithm, we need to continue to study.