Abstract
With the rapid development of agricultural product sales data, the traditional prediction model cannot meet the processing needs. Based on deep learning theory, an improved ICM agricultural product sales prediction model using the softmax classifier is proposed. Introducing the sparse autoencoder in ICM can reduce feature loss. The features also can be extracted. In addition, using the pretreatment mode based on fuzzy membership theory, we can obtain the fuzzy correspondence of considerations and grades of agricultural product sales. At the same time, the precision of prediction for the model is further optimized. It can be seen that the agricultural product sales prediction model based on improved ICM can realize the real-time prediction of agricultural product sales. The maximum classification accuracy of the model can reach 80.98%, which means that it has certain practical application value.
1. Related Work
Agricultural products are necessities of daily life. With the increase of sales platform, the agricultural product sales model is more diversified, and the online sales model has gradually become the mainstream sales model of agricultural products. However, because of the particularity of its products, the agricultural products have a strict shelf life. Therefore, to reduce the waste of agricultural product resources during the shelf life of agricultural products, the accurate sales of the online agricultural products sales platform need to be achieved, which is an urgent problem for the online sales of agricultural products. The current online precision sales of agricultural products are mainly through the shallow-layer deep learning network model. Also, it extracts the value information from the massive agricultural product sales data to predict the trend of sales changes, so as to help merchants adjust the sales strategy in real time. For example, Grasman and Kornelis [1] and de Souza et al. [2] used the Bass model and agricultural product sales data to estimate the future agricultural product sales, so as to achieve the inventory management. Meanwhile, the confidence interval is used to process and obtain the required exact expression. Xiang and Cho et al. analyzed the essential characteristics of the self-service. Also, the importance and significance of building a self-service network marketing system are expounded. Therefore, a new sales model is proposed, which combines independent marketing and online customization. Her-e, merchants, businesses, and consumers collaborate to complete production and sales, so as to realize the precise services for consumers [3, 4]. Tsoumakas and Chen et al. realized accurate short-term sales prediction by reviewing video sales and applying machine learning. It enables the company to minimize in-store inventory and expired products. At the same time, it helps to avoid missing sales [5, 6]. Chen et al. and Eric et al. implemented online sales prediction of agricultural products by using multitask recursive neural network based on trend alignment [7, 8]. However, the prediction performance of the shallow-layer model is limited, so the real-time analysis processing of agricultural product trading data cannot be realized. At the same time, considering that agricultural sales data are growing exponentially every day, the semisupervised learning model is the main means of predicting such rapid growth data. So, this paper selects the semisupervised deep learning model as the sales prediction model of agricultural products. Also, it puts forward a super-imperial crown model based on the ICM to predict the agricultural product sales.
2. Basic Methods
2.1. Introduction to ICM Model
The ICM model is an autoencoder network model, which contains two hidden layers. In addition, its structure of the input node is same with the feature vector structure used for prediction. Because the self-coding network model only learns the predicted feature vectors but does not classify them, this feature enables the classification prediction function of the model by adding a classifier on the top layer. Typically, the ICM classifier can be selected to achieve the classification effect and can get the softmax classifier and the corresponding probability values.
If the input sample set is L, the hypothesis function method is used to analyze each type of j belonging to different classification probability value p = (y = j |x), and the hypothesis function can be expressed as [9]where represent the model parameters to be obtained. The cost function is defined as [10]
Add the self-coding network classified by softmax, and the structure of the ICM model is shown in Figure 1.

The steps for training the ICM model are as follows.
Firstly, the training samples are input into the model. Also, the two hidden layers are adopted to conduct unsupervised training on the training samples. So, the unlabeled output results are obtained. Secondly, the unlabeled output results are input into softmax classifier. At the same time, the labeled samples are used to train the softmax classifier. Thirdly, the values of some functions are solved, such as hidden layer kernel function, reconstruction error function, softmax classifier cost function, and the partial derivatives of all parameters. Finally, the parameters obtained in the above steps are utilized to initialize the model parameters. Furthermore, the BP algorithm is used to solve the optimum parameters, so as to carry out the supervised training.
2.2. Improved ICM Model
It can be seen from the above analysis that it is easy for the ICM model to ignore the reconstruction of original non-linear data during prediction, which will affect the prediction results. In order to solve this problem, the sparse autoencoder is introduced into ICM and an improved ICM model is proposed.
Sparse autoencoder is an unsupervised learning method. Linear representation of vectors can be achieved by using a set of basis vectors in the input vector [11]:
As can be seen from formula (3), k stands for the number of the input nodes and stands for the linear correlation coefficient.
The average activation value of hidden layer unit j is [12]
Here, , m = k; represent the hidden layer unit activation amount when the input is X.
Set the sparseness parameter to ρ, make , and use KL to optimize the penalty factor, such as formula (5). So, the neuron activity of hidden layer is controlled near ρ.
Therefore, the global cost function of sparse autocoding networks is [13]where represents the punishment coefficient, and the larger its value is, the greater the punishment intensity is. Here represents the global loss function. It can be calculated by formula (7). is responsible for avoiding overfitting [14].
represents the unit function:
The output error can be obtained from formula (8).
It can be seen from formula (8) that represents the error of output layer; represents the active function.
Thus, the hidden layer element error can be obtained as
The SICM model introducing sparse autoencoder is implemented as follows: Step 1. Randomly classify all data into training dataset and testing dataset in a ratio of 4 : 1 Step 2. Label the testing dataset and randomly select some data to train the SICM model. Furthermore, the remaining data are used to verify the improved ICM model. Step 3. Use the repeated experiment method to determine the hidden layers and the nodes of each layer in the sparse self-coding network. Step 4. Select the training dataset as the input vector of sparse autocoding network for unsupervised pretraining and input the labeled and unlabeled data into softmax classifier for training. Step 5. Adopt BP algorithm to tune network parameters. The global optimal parameters can be obtained. As can be seen from formula (12), when , the weight decay function is activated, so as to update the weight [15].
The formula shows that which represents the learning rate [16].
The weight updating formula can be expressed as
Here, = 0 represents the initial value, and the weight can be obtained according to formulas (14) and (15) [17].
The above process can be represented in Figure 2.

3. Sales Prediction of Agricultural Products Based on Improved ICM
3.1. Building Improved ICM Model
3.1.1. Parameter Selection
The improved ICM model parameter is selected by the characteristic variables of the sales influencing factors of agricultural product. According to literature [18], the characteristic variables affecting the sales of agricultural products mainly include the attribute parameters of agricultural products, the personal factors of buyers, and nine-dimensional characteristic vector formed by promotion channels. Therefore, the parameters of the improved ICM model in this study use to represent the 9-dimensional input vector, which is used for feature learning. Also, the preprocessed vector is expressed as .
3.1.2. Classifier Design
The improved ICM model classifier uses the softmax classifier of the ICM model. As the cost function of the softmax classifier of ICM is a non-strict convex function, it is easy to fall into local optimum [19]. Therefore, this paper adds a weight attenuation term to the cost function and penalizes the parameters whose weights are too large, so that the parameters can easily converge to the global optimal. The cost function added weighted attenuation term can be expressed as [20]
The optimal parameter value can be obtained by minimizing , and the classifier can be used for the improved ICM model of agricultural product sales prediction.
3.1.3. Model Structure
There are two parts for the improved ICM model used for agricultural product sales prediction, namely, data preprocessing and deep learning network. The specific structure is shown in Figure 3. The input vector of the model refers to the preprocessed data X, and the input cell number of SAE is N + 1, where N represents variable and 1 represents offsets. By processing the input vector through the hidden layer, the feature vector for classification can be obtained. Consider that SAE only digs deep features of sample feature vectors to obtain weight parameters of the hidden layer. The softmax classifier is needed to classify the processed data of hidden layers, so as to obtain all deep features [21]. In addition, the softmax classifier is added to the top layer of the model to obtain a complete improved ICM model. The output vector Y is the prediction result of agricultural product sales by the model.

3.2. Agricultural Product Sales Prediction Process Based on Improved ICM
The improved ICM model is applied to the sales forecasting of agricultural products. First of all, the sales data of agricultural products are preprocessed. Also, the sparse autocoding network is adopted to select representation samples with common features from the sales data of unlabeled agricultural products, so as to realize the adaptive feature extraction. After that use the labeled and unlabeled data training classifier to classify the agricultural product sales level. Furthermore, the parameters of each layer are tuned according to the backpropagation algorithm and strictly convex function to obtain the global optimal parameter values. Thus, we can get an accurate classification prediction improved ICM model which can realize the sales prediction of agricultural products. Finally, the data are input into the prediction model, and the output data are the prediction result. The specific process of agricultural product sales prediction based on Improved ICM is shown in Figure 4.

4. Simulation Experiment
4.1. Simulation Environment and Data Source
4.1.1. Experimental Environment Construction and Data Collection
This experiment is simulated on 64 bit Windows 7 system and coded on i386 platform. Crawler technology is used to obtain 5000 sets of data from Taobao egg agricultural products trading data; each set of data includes 20 samples.
4.1.2. Data Preprocessing
Considering that there are noise, incompleteness, and inconsistency in the crawled original data, this paper performs normalization, zero-phase component analysis, and fuzzy preprocessing for the original data before the experiment.(1)Normalization: carry out normalized preprocessing for experimental data to reduce the influence of data polarization on the final prediction results, which is shown in the following formula [22]: where Xn represents the weight of an attribute total parameters in the total samples; Z indicates the total samples; and Yn indicates sample feature vector with a total number n of an attribute.(2)Zero-phase component analysis: perform zero-phase component analysis for the normalized data. M sample data are selected to convert the original data into matrix X1 = V1. Set the single sample dimension to 9 and perform ZCA whitening processing on dataset. The specific process can be shown as follows: ① Set as the numerical matrix with original data of . G represents the matrix after normalizing , and the average value of each attribute in G matrix is 0. ② Calculate the sample covariance matrix of G to obtain the corresponding eigenvalues and eigenvectors and rank them in order from large to small. The eigenvalues are denoted as , and the corresponding eigenvectors are . ③ Multiply and to obtain the rotation matrix [23]: Make the rotation matrix attribute values with unit variance: The unit variance per attribute in the rotation matrix is obtained by multiplying with each element of row in , and denote the obtained matrix as , where is used to replace , which deals with the numerical fluctuation or overflow phenomenon when approaches 0. ④ The results of ZCA whitening processing are as follows:(3)Fuzzy processing: conduct fuzzy processing for the data by fuzzy membership theory, so the obtained data can be used in the experiment. The method based on fuzzy processing is as follows: ① Let . The time TS in the vector V2 represents the distance between the time of collecting sample data and the time of the system. Data are selected in a random way, and weights are marked for data in different states: where TSn represents the current system time when data are processed and TSc represents the time of data sample collection. The time label format is year-month-day. ② Use the fuzzy subset weight coefficient method to deal with the time weight and use the expert comment set method to set the weight of sample data at different distances: ③ Determine the membership function. Set as the weight in the sales prediction of each data obtained according to TS in V2, namely, . It can be seen that the factor set V3, the judgment set Y, and the weight matrix K select the membership function of trapezoidal distribution as Here, x represents the feature vector in V3; t represents the value at in the eigenvector x; and a and b can be determined by different characteristic attributes. ④ Obtain V3 by applying in step ①, and the input vector of SAE can be obtained by applyingV3 in step ②, which is as follows:
The experimental data for this study can be finally obtained by the above preprocessing. Some of the data are shown in Table 1.
As can be seen from the improved ICM model prediction process, part of the sample data is utilized to train the autocoding network, so as to obtain the kernel function, cost function, and derivative function. Also, a part of the sample data is adopted to train the softmax classifier. Therefore, the preprocessed experimental data should be divided into feature learning and classification learning. To ensure general applicability of the improved ICM model, 3000 samples are randomly selected from the experimental dataset to be the feature learning subset, and 1000 samples are selected as classification learning subset, including 600 softmax classifier training sets and 400 test sets.
4.2. Parameter Settings
4.2.1. Determination of Hidden Layers
Set hidden layers to 1∼10 and input 500 groups of samples to obtain the classification accuracy of the model [24], as shown in Figure 5. The figure shows that if the number of hidden layers is less than 3, the classification accuracy of the model will be gradually improved with the increase of hidden layers. If the number of hidden layers is greater than 3, the model classification accuracy does not change with the increase of hidden layers. So, it indicates that when there are 3 hidden layers, the model has reached the optimal classification accuracy. Therefore, the hidden layer number of the model is set as 3 in this paper.

4.2.2. Determination of the Unit Number of Hidden Layers
Set iterations to 100, hidden layers to 3, and the sparsity parameter to 0.05. Meanwhile, input 1200 sets of data and increase units of the three hidden layers in a ratio of 3 : 2:2, and the results are shown in Figure 6. Here, when the unit of hidden layer in the second and third layers changes, the classification accuracy changes accordingly. When the units of each hidden layer are 6, 4, and 4, the classification accuracy of the model is the highest. Therefore, the units of hidden layer is set to 6, 4, and 4, respectively.

4.3. Evaluation Index
Precision and recall are used to evaluate model classification performance in this paper, and false positive rate (FPR) and false negative rate (FNR) are used to evaluate risk. The specific calculation methods are shown in formulas (25)–(28).
4.4. Experimental Result
4.4.1. Model Performance Verification
To verify the performance of the proposed model, the improved ICM is used to classify experimental datasets of different sizes, and its classification accuracy is compared with that of SVM and softmax classifier. The results are shown in Table 2. The table shows that with the increase of data scale, the classification precision and recall of each model are improved, and the classification time increases accordingly. Compared with SVM and softmax classifier, the improved ICM has higher accuracy and shorter classification time under the same data scale. Furthermore, the advantage becomes more obvious with the increase of data scale. Therefore, there is strong self-learning ability for the proposed model to the massive and variable agricultural product sales data, where the high classification accuracy can be achieved, and the classification prediction advantage is obvious.
To verify the classification precision of the proposed model before and after optimization, in this paper, the classification accuracy of the model before and after optimization is determined by the number of iterations, which is shown in Table 3. The table shows that the classification accuracy before the proposed model optimization is 62.98%, and the classification accuracy after optimization is 80.98%, which increases by 18%. Therefore, the classification accuracy can be improved be fine-tuning the model.
4.4.2. Model Comparison
To verify the processing ability of the proposed model for fuzzy information, the improved ICM model is used to classify and predict 4000 sets of data, which are randomly selected from experimental samples. The false positives and false negatives of the two models are obtained by comparing the classification results with the ICM model, which are shown in Figure 7. The figure shows that the false positive rate and false negative rate of proposed model are obviously lower than those of the ICM model, which indicates that the proposed model can improve the classification and recognition ability of the model through fuzzy data preprocessing.

(a)

(b)
In order to further verify the classification performance of the improved ICM model, the improved ICM and ICM models are used for classification under different data scales, which are shown in Table 4. The table shows that the improved ICM model has better classification accuracy, recall, and classification time indexes than ICM model under different data scales. Also, this advantage becomes more obvious with the increase of data scale. The reason is that the improved ICM model adopts sparse autocoding on the basis of the ICM model to reduce the loss of data features as much as possible. Compared with ICM autoencoder, the improved ICM model has stronger feature learning ability. In addition, the theory of fuzzy membership degree is added to the data preprocessing of the improved ICM model. It solves the problem that the ICM model ignores the fuzzy correspondence between the influencing factors and the grades of agricultural product sales. Therefore, the improved ICM model is superior to the ICM model in classification prediction of agricultural product sales.
5. Conclusion
To sum up, the proposed prediction method of agricultural product sales based on deep learning uses sparse autocoding to reduce the loss of data feature as much as possible. Meanwhile, we use the preprocessing agricultural product sales data based on fuzzy membership theory to build the improved ICM classification prediction model, which can effectively achieve the sales prediction of agricultural products. Compared with the ICM model, SVM, and softmax classifier, the model has higher sales prediction accuracy. When the number of hidden layers of the model is 3 and the units of hidden layers are 6, 4, and 4, the maximum classification accuracy of the model can reach 80.98%, which can be used to predict the actual sales of agricultural products. Although some achievements have been made, there are still some shortcomings, such as limitations in data sample acquisition, small size of data, and no verification of data processing capability with a lot of noise. So, the next step is to further discuss the classification and prediction performance of the improved ICM for massive data, which makes the model have stronger universality.
Data Availability
The experimental data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The author declares that there are no conflicts of interest.
Acknowledgments
This study was sponsored in part by Research on the Development of Culture and Tourism Industry in Ethnic Minority Areas under the Background of Rural Revitalization (2021-GMB-020).