Price Prediction for Agricultural Commodities in Bandung Regency Based on Functional Link Neural Network and Artifical Bee Colony Algorithms

: In Indonesia, fluctuating agricultural commodity prices often impacts society negatively. In this study, farmers in Bandung Regency, West Java, Indonesia, were chosen as a case study. Fluctuating agricultural commodity prices can lead to farmers suffering losses due to the sale price being smaller or equal to the cost of planting. Price is influenced by crop productivity, while planting productivity is strongly influenced by weather. A system is developed in this study to predict the price of agricultural commodities based on price, productivity and weather history using a Functional Link Neural Network (FLNN) algorithm optimized with the Artificial Bee Colony (ABC) algorithm. The price prediction results can be used as recommendations for farmers as to whether they should plant or not. In addition, the prediction results are compared to the Artificial Neural Network (ANN) algorithm with Backpropagation algorithm as the learning algorithm. From the experimental result, the best Mean Absolute Percentage Error (MAPE) value was obtained with FLNN-ABC: 7.68% for the predicted price of chili and 10.59% for the predicted price of onion.


Introduction
Fluctuation in agricultural commodity prices is still an issue in Indonesia, especially for farmers in Bandung Regency, West Java, since price fluctuation can lead to losses because the sale price may be smaller or equal to the cost of planting.
The agricultural commodities discussed in this study are red chilies and onions used for daily needs (as spices in cooking). Price prediction information is needed so that farmers can get the right planting time information. Previous research has introduced planting calendars based only on weather prediction results, but these works did not consider price history information or plant productivity . Agricultural research is indispensable, some examples of which are Daruati et al. (2013;Suyantohadi et al., 2010;Iswanto et al., 2014).
A Soft Computing algorithm that is often used for classification or prediction is the Artificial Neural Network (ANN) algorithm. There are two things that must be determined in ANN: its architecture and weight. ANN requires weight optimization to obtain better performance values. Several studies have previously modified the architecture and weight optimization algorithms for weather prediction 2018;Nurcahyo et al., 2014;Adiwijaya and Nhita, 2014).
Other studies related to structural optimization and weighting of ANN have been done using the Artificial Bee Colony (ABC) algorithm with Functional Link Neural Network (FLNN) architecture, but with different pre-processing data and methods than this study. Pao and Takefuji (1992;Patra and Kot, 2002;Hassim and Ghazali, 2012;2014;. FLNN is a single layer architecture with extended input. A comparison was done between the results of this study and ANN using Multilayer perceptron architecture and Backpropagation (BP) algorithm as the learning algorithm. To improve system performance, pre-processing was performed using normalization, Principal Component Analysis (PCA) algorithm and Moving Average, which have been used in our previous work .
The structure of this paper starts with the introduction and related works in Section 1. The results and discussion are detailed in Section 3 and conclusions are laid out in Section 4.

Materials
The data used in this study are weather data, prices, and the productivity of agricultural commodities from 2014-2016. Weather data was obtained from the Meteorology Climatology and Geophysics Agency (BMKG), which includes 6 components, namely rainfall, temperature, humidity, evaporation, the duration of solar irradiance, and wind speed. Price data were obtained from the Department of Trade Bandung Regency, while productivity data was obtained from the Department of Agriculture Bandung Regency. Price data was taken from several prices in the parent market in Bandung Regency, and then the lowest price selected for each commodity so that the price data would be close to the price setby the farmer. There are two commodities discussed in this study, which are chili and onion.

Artificial Neural Network (ANN) Backpropagation
ANN is one of the Soft Computing algorithms that are widely used for prediction or classification. Before using ANN algorithm, its architecture and learning algorithm must first be determined. One of the most commonly used architectures is the Multi-Layer Perceptron (MLP) with Backpropagation algorithm (Hassim and Ghazali, 2012). Backpropagation is an algorithm that uses the method of supervised learning with multiple layers (multi-layer). In supervised learning, there are targets to be compared with the output. As the name implies, this algorithm performs two calculation phases, i.e. forward calculations to calculate the error between the actual output and the target; and backward calculations propagating back the error to correct synaptic weights on all existing neurons (Suyanto, 2008;2014).

Functional Link Neural Network
Functional Link Neural Network (FLNN) is one of the models within the Higher-Order Neural Network (HONNs) created by Pao and Takefuji (1992) and has been successfully used in various classification, pattern recognition and prediction problems. FLNN architecture is different from MLP because FLNN only uses a single layer without a hidden layer. In FLNN, learning is performed by the BP algorithm. In FLNN, the input vector is extended by the corresponding representation of the level of the input node, so that the number of dimensions of the input space is greater (Pao and Takefuji, 1992;Hassim and Ghazali, 2012). Pao and Takefuji (1992;Patra and Kot, 2002;Hassim and Ghazali, 2014; have shown that this architecture works well in the case of classification and prediction.

Artificial Bee Colony
The Artificial Bee Colony (ABC) algorithm is one of many optimization algorithms adapted from the Swarm Intelligence (SI) concept. The ABC algorithm is an algorithm that models the collective intelligence of honeybees when searching for food sources, and consists of 3 basic components (Hassim and Ghazali, 2012), namely food sources, employed foragers, unemployed foragers.
The ABC algorithm begins with a population consisting of a collection of bee agents. The ABC algorithm used for optimization of weights on FLNN. Figure 1 shows the representation of bee used in this research, each box contains the weight (w) of FLNN in real numbers as many as the number of neuron inputs.
An explanation of the learning process using Functional Link Neural Network (FLNN) architecture with the ABC algorithm is given below (Hassim and Ghazali, 2012

Experiment Scenarios
The experimental scenarios include parameter observations for FLNN-ABC and ANN-BP. In addition, there are also dataset scenarios that use different data and preprocessing in order to analyze the interrelationship between data and preprocessing used. The observation parameters for FLNN-ABC and ANN-BP are shown in Table 1 and 2, respectively. The training process uses data from 2014-2015 while the testing data uses 2016 data.
The pre-processing in this study is the Moving Average (MA), which is used to refine the value of rainfall as per previous research . The PCA algorithm was used to summarize the attributes of weather.  1. Actual value from price data and weather data 2. Actual value from price data and PCA result for weather data 3. Actual value from price data and weather data (same with scenario #1 but rainfall in preprocessing uses MA) 4. Normalization value from price data and weather data 5. Actual value from price data and rainfall data 6. Actual value from price data and productivity data Figure 2 shows a sample of the FLNN architecture used in this study.
In dataset scenario #1 with the number of month input = 2, where x1 to x14 is the input data. Meanwhile, x15 to x105 is the extended input dimension of the input data.
The multilayer perceptron architecture sample for ANN-BP is used for dataset scenario # 1 with number of inputs = 2, hidden layer = 1 and hidden neurons = 2, as can be seen in Fig. 3. (1), is used for the error calculation (Makridakis and Steven, 1987):

MAPE, shown in Equation
Where: Xi = The actual data value of the i-th period Yi = The value of prediction data for period i n = The number of data

Analysis and Experimental Results
In this section, we discuss the comparison of MAPE testing results using the two algorithms according to the dataset scenario and the parameter observation scenario in Tables 1 and 2. Then, we discuss and analyze the observation parameters for the best algorithm. Table 3 shows that FLNN-ABC obtained the best MAPE testing result compared to ANN-BP, so the modification of FLNN architecture and weight optimization using ABC will improve the performance of the forecasting result. As seen from Table 3 for the chili commodity, the difference in MAPE between FLNN-ABC and ANN-BP is huge, which is 12.32%. Meanwhile, for the data on onion, the MAPE testing difference is 9.6%. Because FLNN-ABC, the proposed method, has the best performance, then the next section will discuss more about the details related to the

Best Prediction Model
Details of MAPE for every scenario using FLNN-ABC are discussed in the following subsections. Table 4 shows the best MAPE testing results for all dataset scenarios for the chili commodity. Table 4 shows the best MAPE forecasting results of chili commodity prices, which is 7.68%, with the dataset scenario pre-processed using normalization and the predicted data returned to the original form (denormalization). The dataset in scenario 4 uses both normalized pricing and weather data. This shows a link between price and weather, where weather affects agricultural productivity. This is because the majority of farmers in Bandung Regency still rely on rain for their agricultural irrigation. Chili plant productivity will increase in the rainy season or with high rainfall, whereas in the dry season, productivity could decrease by about ½ kg.
Meanwhile, the best FLNN-ABC parameter in MAPE was obtained at ABC = 1500 colony count and with a monthly input = 2, indicating that the previous 2-month data was used to predict the next month. Table 4 also shows that the greater the number of colonies, the better MAPE results are obtained, since the average number of colonies for the best MAPE is >= 1000. Meanwhile, the best number of month input is between 1 to 2, indicating the relationship between the previous 2 months with the next month. Below is a comparison chart of predicted pricing data with actual price data for the chili commodity show in Fig. 4.
Another commodity studied is the onion, which is a basic need for society in meeting daily consumption.
Here are the best MAPE results for all test scenarios for the onion commodity show in Fig. 5. Table 5, the best MAPE forecasting results for onion commodity prices was 10.59% with dataset scenarios in the form of pricing data and weather data, but for rainfall, preprocessing was done using Moving Average. In addition, all the best dataset scenarios are obtained when the number of colonies in the algorithm ABC >= 1500 and the number of inputs = 1, which means data from 1 month earlier is used to predict the next month. Figure 5 shows a comparison graph of actual and predicted pricing data for the onion commodity.

Conclusion
From the results of experiments and the scenarios conducted, it can be concluded that the selected architecture and learning algorithm has an effect on the generation of weights for ANN. The FLNN architecture with optimization of weight using the ABC algorithm obtained the best MAPE testing result compared to ANN with Multi-Layer Perceptron architecture and Backpropagation learning algorithm. The best MAPE testing for chili commodity and onion commodity was 7.68% and 10.59%, respectively. The best number of colonies is greater than 1000 with the number of input months between 1 to 2 months before for predicting the next 1 month.