# Research on Forecasting Methods of Agricultural Products Consumption Behavior Based on Unsupervised Learning

Authors: Hui Yang; Tian Yang; Xiangxin Ma; Jia Lin
Journal: Advances in Multimedia
 (2022)

---

## Abstract

Constructing a perfect urban fresh agricultural product supply system is the basic guarantee for the stability of urban life, and it is also the basic condition for supporting urbanization. This paper combines unsupervised learning algorithms to predict and analyze agricultural product consumption behaviors, determines whether to generate new neurons through the cumulative error value of the winning neurons, and gives a network model that can dynamically self-grow. Moreover, this paper constructs an agricultural product consumption behavior prediction model based on unsupervised learning and uses data to verify the performance of the algorithm in this paper. After confirming the performance test of the algorithm, it verifies the prediction effect of this method on the consumption behavior of agricultural products. Through statistical analysis of data, it can be known that the prediction method of agricultural consumption behavior based on unsupervised learning has a certain effect.


---

## Body

## 1. Introduction

Consumer demand refers to the consumer’s demand and desire for consumer products. This need must meet two basic elements together: purchasing power and purchasing desire. Consumers need to have many characteristics such as diversity, variability, and relevance, so it is extremely complicated to study consumer needs [1]. Maslow’s needs theory is what we often call the “basic needs theory”. It was put forward by the aesthetics scientist Maslow. The theory divides the basic needs from low to high into five levels from the perspective of the different development stages of human needs. Safety needs and physiological needs are the most basic needs of human beings. All activities must be based on the satisfaction of basic life; otherwise, they will not operate normally. Social needs, respect needs, and self-realization needs are high-level needs, and all human material activities are a process of transition from low-level to high-level [2]. Demand theory starts from the basic needs of people to find ways to inspire people and grasps the core of the problem. Maslow said that people’s needs are progressive, and they have experienced a continuous development process from low-level to high-level. They are in line with the law of development of personal needs. However, the shortcoming of this theory is that it has separated from the basic conditions of society, separated from the historical development process of human beings in different periods and social practice to simply consider human needs and demand structure. Its theoretical basis is that the nature of human beings is beyond social history, and human beings are abstracted as “natural persons” instead of “social persons”, so there are certain limitations [3].Clarifying the factors that affect consumers’ online shopping of specialty agricultural products under the socialized e-commerce model can not only effectively expand the channels for smallholder farmers and enterprises to sell specialty agricultural products but also avoid vicious competition in the same industry under the same model. Therefore, companies and suppliers must fully consider the changes in consumer demand and purchasing methods before formulating marketing strategies. Consumer research is a compulsory course for companies and merchants to carry out marketing activities. Through behavioral research on consumers’ online shopping process, determine which factors are affected by consumers in the process of consumer behavior, increase the driving force of positive factors, and eliminate negative factors, so as to maximize the satisfaction of consumer needs and then achieve the purpose of marketing, that is, to obtain consumer recognition, so as to obtain greater benefits. This article combines the rise of the social e-commerce model and the penetration rate of various social software applications and, on this basis, studies many e-commerce models and conducts research on consumer online shopping behaviors of characteristic agricultural products under the social e-commerce model. It is of great practical significance to explore the factors affecting consumers’ online purchase of characteristic agricultural products.This article combines the unsupervised learning algorithm to predict and analyze the consumption behavior of agricultural products and test the method proposed in this paper to improve the prediction effect of subsequent agricultural product consumption behavior, which provides a theoretical reference for subsequent agricultural product marketing.


## 2. Related Work

Consumer needs and changes in purchasing methods. Consumer research is a compulsory course for companies and merchants to carry out marketing activities. Through behavioral research on consumers’ online shopping process, determine which factors are affected by consumers in the process of consumer behavior, increase the driving force of positive factors, and eliminate negative factors, so as to maximize the satisfaction of consumer needs and then achieve the purpose of marketing, that is, to obtain consumer recognition, so as to obtain greater benefits [4]. Combining with the rise of social e-commerce model and the penetration rate of various social software applications, on this basis, research on many e-commerce models, conduct research on consumer online shopping behaviors of characteristic agricultural products under the social e-commerce model, and discuss the influencing factors of consumers’ online shopping of characteristic agricultural products are of very important practical significance [5]. Under the social e-commerce model, research on the behavior of consumers to purchase characteristic agricultural products online through social software will help small farmers, retail suppliers, and agricultural products enterprises to optimize the marketing strategies of characteristic agricultural products, improve their deficiencies, and attract more consumers. Increase the transaction volume of characteristic agricultural products in social software, improve the level of social e-commerce, and increase the economic benefits of farmers, retailers, and enterprises [6]. Determine whether there is any merit in selling characteristic agricultural products through emotional and social relationships under the social e-commerce model. Under the social e-commerce model, whether the method of selling characteristic agricultural products can exist stably between consumers and merchants [7]. Special agricultural products occupy an important position in daily life. With the acceleration of life and the popularization of online shopping, consumers can purchase special agricultural products online through various e-commerce platforms [8]. Literature [9] verifies the influence of the professionalism of the sender of Internet Word of Mouth, the trust of the receiver, and the degree of risk perceived by consumers on consumption behavior by establishing a theoretical model. Literature [10] takes the three variables of communicator, recipient, and word-of-mouth content as independent variables and consumers’ perceived risk and trust as intermediate variables and establishes a model of the influence mechanism of negative Internet word-of-mouth on consumer behavior intentions, indicating the communicator that the strength of the relationship with the receiver is directly proportional to the receiver’s perceived risk. Literature [11] uses fine processing models and cognitive matching–related theories to study a series of consumer behaviors in processing Internet word-of-mouth and the effect of Internet word-of-mouth on purchasing behavior. Literature [12] studied the mechanism of online word-of-mouth impact on book sales by studying online reviews, and the results showed that Internet word-of-mouth expands sales by increasing its popularity and influence, thereby convincing consumers to buy is not obvious. Literature [13] divides customer perceived value into three measurement dimensions: functional value, emotional value, and social value, and proposes related hypotheses: Internet word-of-mouth has a positive impact on the three dimensions of customer perceived value.Literature [14] concluded in the research that the purchaser who cares about safety directly determines the purchase and payment of green agricultural products. Literature [15] found that the demand for safe and nutritious agricultural products is very high. The reason is that ordinary agricultural products will be affected by environmental pollution and other aspects, leading to quality and safety problems. Under such circumstances, consumption and purchase of organic food are healthy and environmentally friendly. Literature [16] mainly analyzes the perception of consumers in the research and concludes that what consumers ultimately buy is not only the product but also the value of the product. Literature [17] believes that consumers are cognized by buyers in terms of perception. When performance and cognitive input are balanced, buyers’ willingness to buy will be low at this time. Literature [18] pointed out that when consumers’ willingness to consume is considered by price factors, they will make corresponding decisions while paying attention to the quality of agricultural products and finally make corresponding value evaluations. When choosing guaranteed agricultural products, cultural background, social factors, and personal psychology will all affect consumers’ decision-making [19]. The demand for green agricultural products consumption is very high in western developed countries. Consumers in western developed countries are willing to buy organic agricultural products, and almost all consumers have purchased organic agricultural products [20].


## 3. Unsupervised Learning Prediction Method

The mapping process of the unsupervised learning network is slightly different from that of the standard learning network. It can be divided into the following three phases: the initialization phase, the self-growth phase, and the stable phase.The self-growth stage is the core stage of the unsupervised learning network. In this stage, the algorithm will not only add new neurons at the neuron with the largest cumulative error but also use the probability distribution of the training sample as a measure of the self-growth mechanism. This overcomes the limitations caused by the fixed network structure of the standard machine learning network. In the process of self-growth, the grid keeps adding or deleting neurons on the basis of keeping square neighborhoods until the data mapping reaches the required granularity. The specific manifestation is that the input pattern is mapped to clusters with obvious boundaries, the data within the clusters have similar characteristics, and the data between the clusters have different characteristics.In the self-growth stage, unsupervised learning will be carried out according to the following algorithm:(1)
The algorithm inputs the sample data into the initialized network model.(2)
The algorithm uses Euclidean distance to find the weight vector closest to the input vector (similar to machine learning).This process can be summarized as finding the neuronq to make(1)∀q∈N,v−wq′≤v−wq.Here,v and w are the input vector and the weight vector respectively, and q is the vector coordinate of the neuron.(3)
The adaptation of the weight vector is only applicable to the neighborhood of the winning neuron or the winning neuron itself. Even in the neighborhood, the adaptability of the weights close to the winning neuron is better than those farther away. The adaptive learning rate will decrease exponentially in the iterative process. The adaptive process of weights can be described by formula (1):(2)wjk+1=wjk,j∉Nk+1wjk+LRk×xk−wjk,j∈Nk+1.Here, LR(k) is the learning rate,wjk is the weight of the weight vector of neuron j before the structure adjustment, wjk+1 is the weight of the weight vector of neuron j after structural adjustment, and Nk+1 is the neighborhood of the winning neuron in the k+1 iteration. The deceleration rate of the learning rate LR(k) depends on the number of neurons in the unsupervised learning network at time t.(4)
The algorithm accumulates the error value of the winning neuroni (Total Error, TE, that is, the difference between the input vector and the weight vector).(5)
When TEi ≥ GT, if neuroni is a boundary neuron, a new neuron is added to its neighborhood. If neuron i is a nonboundary neuron, TE is assigned to other neurons in its neighborhood.(6)
The algorithm initializes the weight vector of the newly generated neuron.(7)
The algorithm assigns an initial value to the Learning Rate (LR).(8)
The algorithm repeats steps (2)∼(7) until all input patterns have been input, and the growth rate of the neuron has been reduced to a small, fixed value.The set of neuron weight vectorwi can be regarded as a vector quantization of the input space. Therefore, each neuron i can be used to represent a region Vi. All points in this area are closer to wi than the weight vector of any other neuron. Vi is called the Voronoi region, that is, the weight vector divides the input space into several Voronoi regions, and each region is represented by a neuron. In the self-growth stage, when the sample data is input into the network, according to the above algorithm, a winning neuron will be generated. The difference TE between the input vector and the weight vector of the corresponding winning neuron will be added to the neuron. If neuron i contributes significantly to TE, the Voronoi area will be represented by neuron i. To better represent this area, a new neuron will be generated as a neighbor of neuron i.Here, the error distanceE needs to be defined:(3)Eit+1=Eit+∑k=1DimMetvk,wik2.Here,i and t represent the t-th iteration of neuron i, Dim is the dimension of the input data, v represents the input vector, and w represents the weight vector. Met is a function that calculates the distance between the vectors v and w. For each winning neuron, the difference between the weight vector and the input vector will be calculated as the error value. If a neuron wins multiple times, then this error value will be accumulated during the iteration process. The Euclidean function is used to calculate the distance, so formula (1) can be rewritten as follows:(4)Eit+1=Eit+∑k=1Dimvk−wi2.For each weight update, ifEinew>HErr, then there is HErr=Einew, otherwise the value of HErr remains unchanged. Therefore, HErr will always maintain the maximum error value of the neuron. The error value of each neuron can be regarded as a quantized error, and the sum of the quantized error values is as follows:(5)QE=∑i=1NEi.Here, N is the number of neurons in the network andE is the error value of neuron i. The sum of quantization errors, QE, is used to determine when to generate new neurons. If neuron i contributes the most to the total error value QE, the Voronoi region V of the input space where it is located will be represented by neuron i, so a new neuron will be generated and used to share the responsibility of neuron i.Neuroni should generate a new neuron:(6)∂QE∂E>GT.SinceHErr records the maximum error value of the neuron, if HErr>GT, a new neuron should be generated.For the generation of a new neuron, the following restrictions are required:.(1)
Determination of the location of newly generated neurons: newly generated neurons must be generated from boundary neurons, as shown in Figure1.(2)
Initialization of the weights of newly generated neurons: newly grown neurons will be given initialization weights. For initializing new nodes, the following four situations need to be considered, as shown in Figure2.Figure 1
New neurons generated from boundary neurons.
(a)(b)(c)Figure 2
Initialization of the weights of newly generated neurons.
(a)(b)(c)(d)W1 and W2 are the weight of the growing source neuron, and Wnew is the weight of the newly growing neuron. At the beginning of the unsupervised learning network, there are four initialization neurons. New neurons are always generated as neighbors of an existing node. In Figure x, (a) and (b) are the most frequently occurring situations. The initialization formula for the weight of the newly grown neuron is given below:In Figure2(a), the newly generated neuron is on one side of two consecutive neurons. If w2>w1, then wnew=w1−w2−w1, otherwise wnew=w1+w1−w2.In Figure2(b), the newly generated neuron is between two neurons, and wnew=w1+w2/2;In Figure2(c), the newly generated neuron is directly connected to only one neuron, and the other neuron connected to this neuron is on the side opposite to the newly generated neuron, and the three neurons are in an “L” shape. If w2>w1, then wnew=w1−w2−w1, otherwise wnew=w1+w1−w2. This situation is the same as (a), except that the location of neighboring neurons is slightly different.In Figure2(d), the newly generated neuron has only one neuron as a neighbor. This happens at the beginning of self-growth or when a neuron becomes an isolated neuron due to neuron deletion. wnew=r1+r2/2 , where r1 and r2 are the minimum and maximum values of the weight vector distribution interval.In cases (a) ∼ (c), ifr1≤wnew≤r2, the new neuron will be given a weight. In case (d) or wnew exceeds the range of r1,r2, wnew will be assigned to r1+r2/2, where the value is generally 0.5. The self-organizing network will quickly adjust this value to adapt to the neighborhood. It can be said that in case (a(c), the weight of the new neuron will be close to the weight of the neighboring neuron. In other cases, the initial value of the weight of the new neuron will be assigned an intermediate value. Then, the self-organizing network adjusts the value.The adaptive learning rate is defined as follows:(7)LRt+1=LRt×α.α is the reduction coefficient of the learning rate, and 0<α<1. LR(t) is the learning rate of the t-th iteration. When t⟶∞, LR(t)⟶0. LR, like the machine learning network, is generally assigned a large value (close to 1) during initialization. However, since there are only a small number of neurons (usually 4) when unsupervised learning is initialized, a situation that may arise at this time is that even with the same neuron set weight vector, the network may grow in a completely different direction.To better solve this problem, a new learning coefficient rule is introduced here, and the number of neurons in the current neural network is added to the learning coefficient. Therefore, the adaptive learning rate can be defined as follows:(8)LRt+1=α×ψn×LRt.Here,n is the number of neurons in the network and ψn can control the value of the learning rate according to the value of n. For example, the ψn function can be set to 1−R/nt, and when the number of initialized neurons is n = 4, R = 3.8 is generally adopted. Thus, there are the following:(1)
In the initialization phase, when the number of neurons is small, the LR value will be effectively reduced byψn, which will reduce the weight fluctuation of the network.(2)
When the network topology continues to increase and the number of neurons continues to increase,ψn will also gradually increase and approach 1, and LR will not fluctuate by a large margin as in the case (1).The unsupervised learning network skips the value setting stage, and the weight of the new neuron is initialized to the weight of the surrounding neighborhood. In the self-growth stage, the unsupervised learning network will initialize the learning rate and neighborhood size Ng for each new input. The weight is continuously adjusted adaptively when the range of the neighborhood, and the learning rate are gradually reduced until the number of neurons in the neighborhood is 1, and then the new input is initialized again. The weight adaptive adjustment can be expressed by formula (8).(9)dwidt=LR×v−wi,i∈Nk.It is stipulated here that if a neuron is not a boundary neuron of the network, it will not generate a new neuron, and use formula (9) to transfer the cumulative error value of the neuron to its neighboring neurons:(10)Et+1w=GT2.Here,Etw is the error value of the winning neuron. The error value of the neighborhood neuron of the winning neuron will increase according to formula (10):(11)Et+1ni=Etni+γEtni,where Et+1nii=1,2,3,4 is the error value of the i-th neighbor of the winning neuron (its error value is Etni). y is a constant value, which is called a distribution factor (FD), and is used to control the accumulation of error values. The value of FD is generally between 0 and 1.When the cumulative error value exceeds the growth threshold GT, the neuron will grow by itself, and the total error value of neuroni can be calculated as(12)TEi=∑Hi∑j=1Dxij−wj2.Here,Hi is the number of wins of neuron i, D is the dimension of the data set, and xij and wj are the input and weight vector of neuron i, respectively. For a boundary neuron, if it wants to grow a new neuron, it requires(13)TEi≥GT.The value of GT is derived experimentally based on the requirements of network growth. It can be seen from the formula (12) that the dimensionality of the data set has a very important influence on the cumulative error value TE.Because of0<xij,wj<1, the maximum contribution of an input attribute to the error value is 1, that is, maxxij−wj=1. Therefore, TEmax=D×Hmax, where TEmax is the maximum accumulated error, and Hmax is the maximum number of times that this neuron becomes a winning neuron. If H(t) is considered as a function of time (number of iterations) t, then there is 0≤GT≤D×Ht.The definition of GT needs to consider the expansion factor of the network, which depends on the dimensionality of the data set and the number of wins of the neuron. For different data sets, there will be different GT values. Therefore, the GTs of different data sets are not comparable. To solve this problem, the spreading factor SF (Spread-Out Factor) is introduced here to control and calculate the GT value of the unsupervised learning network.The GT value can be defined as follows:(14)GT=D×fSF.Here,SF∈R,0≤SF≤1, and f(SF) are functions of SF.The range of the total error value TEi of neuroni is as follows:(15)0≤TEi≤TEmax.Here, TEmax is the maximum cumulative error value, and then formula (14) can be obtained:(16)0≤∑Hi∑j=1Dxij−wj2≤∑Hmax∑j=1Dxij−wj2.Since the purpose of GT is to allow the network to grow new neurons by providing a threshold for the cumulative error value, there is also formula (16):(17)0≤GT≤∑Hmax∑j=1Dxij−wj2.SinceHmax can be infinite in theory, 0≤GT≤∞. According to the definition of the spreading factor, a function f(SF) needs to be defined such that 0 ≤ SF ≤ 1 and 0≤D×fSF≤∞. In other words, the value range of the function f(x) is from zero to infinity, and the value range of the parameter x is between 0 and 1.We givey=−a×ln1−x, which can meet the above requirements. If we set η=1−SF and GT=−D×ln1−η, then GT=−D×lnSF. Therefore, the expansion factor SF can now be used to replace the growth threshold GT, thereby eliminating the trouble of setting different GT values for different data sets. Through the expansion factor, different network mappings can be compared. Figure 3 is a graph showing changes in GT values of data sets of different dimensions with a given expansion factor SF.Figure 3
Expansion factor-GT value curve.Now, the GT value of the unsupervised learning network can be calculated by a given expansion factor. The range of the expansion factor SF is between 0 and 1. If the data set has no prior knowledge, the recommended value range of the initial SF is 0 to 0.3. This will show the most important clusters in the unsupervised learning network. Based on these most basic clusters, you can decide whether to conduct a deeper data analysis. We can select some areas that have been clustered and use a larger SF value for further data analysis, as shown in Figures4 and 5.Figure 4
Data analysis based on the value of SF..Figure 5
Hierarchical clustering based on the value of SF.


## 4. Prediction of Agricultural Product Consumption Behavior Based on Unsupervised Learning

This paper uses unsupervised learning method to predict the consumption behavior of agricultural products. This article takes fresh agricultural products as an example to study. Figure6 shows the relationship between “eating, clothing, housing, transportation, and play” in the traditional sense and the hierarchical model of consumption needs. It is also easy to understand the importance and basis of “eating,” and the consumption of fresh agricultural products is also the embodiment of “eating.”Figure 6
The relationship between life needs and needs models in the traditional sense.Based on the existing consumer behavior selection process model, this paper combines the observation and analysis of consumption behavior of fresh agricultural products to divide the consumption behavior of fresh agricultural products into four stages: purchase demand formation, purchase decision making, purchase decision implementation, and post-purchase evaluation feedback. Moreover, this article believes that the final performance of consumer behavior is produced under the dynamic and continuous influence of internal and external factors, that is, consumer behavior is a dynamic and continuous process, and the specific behavior of fresh agricultural products is shown in Figure7.Figure 7
Structure diagram of consumption behavior pattern of fresh agricultural products.The basis for the ultimate realization of the purchase of fresh agricultural products is the formation of purchase motivation. That is to say, only when consumers feel or realize that they need to buy fresh agricultural products can the final purchase behavior occur. The so-called no cause means no result. Consumer purchase motivation is formed or disappeared under the combined effect of demand factors and constraints. The content and mechanism of demand factors and constraints formed by purchase motivation are shown in Figure8.Figure 8
The influencing factors and mechanism of the formation of buying motives.The purchase decision itself is a complicated psychological process, and the measurement of “profit” and “strength” is a huge project. On the other hand, the focus of this article is not to measure the utility of the sales terminal but to explore the development direction of the urban fresh agricultural product supply system through the performance of consumer behavior. Therefore, in the research process, this article ignores the measurement standards of the “strength” of each fresh agricultural product sales terminal at the factor level and the quantitative research process of the consumer’s “profit” at the factor level. To facilitate research, a comprehensive system for purchasing decision research is established as shown in Figure9.Figure 9
The comprehensive system for purchasing decision-making research on fresh agricultural products.On the basis of the above analysis, we conduct research on the prediction methods of agricultural product consumption behavior and study the distribution of consumer household income under different attitudes. The answer can be clearly obtained from the statistics and analysis in Figure10. When we analyze the distribution of consumer household income under different attitudes, it can be seen that the lower the average household income, the higher consumers’ expectations of “lower prices”. Conversely, the higher the average household income, the weaker the consumer’s expectation of “lower prices”. This shows that although the “lower price” is the “profit” side, it shows different “profits” according to the level of consumer income.Figure 10
Average level of household income under different price attitudes.In order to show the influence of the factors of each sales terminal more clearly, draw the radar distribution diagram of the influence intensity, as shown in Figure11. Through the comparison of the main influencing factors of various sales terminals, it can be found that the same attributes of different sales terminals have very different influences for consumers, but different terminal advantages for the operation of sales terminals. Based on the specific scope of this survey (Chengdu), the advantages of supermarkets in operating fresh agricultural products over other sales terminals are mainly reflected in safety (quality and safety), selectivity (multiple product types), demand relevance (buying other products, like shopping), comfort (good shopping environment), and credibility (high business reputation). The advantages of the farmer’s market in operating fresh agricultural products are reflected in economy (low price level), efficiency (less queues to save time), convenience (short travel distance), and product appearance (product freshness). The advantages of roadside vendors in operating fresh agricultural products are reflected in convenience (short travel distance) and economy (low price level).Figure 11
Radar distribution map of the influence intensity of various factors in different sales terminals.The above-mentioned research not only analyzes the prediction of agricultural product consumption behavior but also verifies that the prediction method of agricultural product consumption behavior based on unsupervised learning has certain effects.


## 5. Conclusion

This article studies the urban agricultural product supply system based on consumer behavior, that is, from the fundamental purpose of agricultural product logistics, fully considers the characteristics of consumer demand for agricultural products, and understands the key factors that affect the consumption of agricultural products. Moreover, this article theoretically enriches the ideas and methods of urban agricultural product supply chain optimization and construction and better explores the mechanism of urban agricultural product supply system construction and the key factors that determine its construction. In addition, the study of the supply system of agricultural products from the perspective of consumer behavior can have more practical significance and provide feasible decision-making reference and development ideas for the planning, management, transformation, and operation of urban agricultural product supply systems. This article combines the unsupervised learning algorithm to predict and analyze the consumption behavior of agricultural products and test the method proposed in this paper to improve the prediction effect of subsequent agricultural product consumption behavior, which provides a theoretical reference for subsequent agricultural product marketing. Finally, this paper verifies that the agricultural product consumption behavior prediction method based on unsupervised learning has certain effects through experiments.



---

*Source: 5034976-2022-01-19.xml*