Next Article in Journal
The Relationship Between Organic Carbon and Ca in the Profile of Luvisols: A Case Study of a Long-Term Experiment in Pulawy, Poland
Next Article in Special Issue
The Extraction of Torreya grandis Growing Areas Using a Spatial–Spectral Fused Attention Network and Multitemporal Sentinel-2 Images: A Case Study of the Kuaiji Mountain Region
Previous Article in Journal
Effect of Humic Biostimulant Agriful on Agronomic and Nutritional Parameters of Radish (Raphanus sativus)
Previous Article in Special Issue
Plant Disease Segmentation Networks for Fast Automatic Severity Estimation Under Natural Field Scenarios
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research on Ginger Price Prediction Model Based on Deep Learning

1
School of Information Science and Engineering, Shandong Agricultural University, Tai’an 271018, China
2
Key Laboratory of Huanghuaihai Smart Agricultural Technology, Ministry of Agriculture and Rural Affairs, Tai’an 271018, China
3
Agricultural Big Data Research Center, Shandong Agricultural University, Tai’an 271018, China
*
Authors to whom correspondence should be addressed.
Agriculture 2025, 15(6), 596; https://doi.org/10.3390/agriculture15060596
Submission received: 11 February 2025 / Revised: 1 March 2025 / Accepted: 6 March 2025 / Published: 11 March 2025
(This article belongs to the Special Issue Computational, AI and IT Solutions Helping Agriculture)

Abstract

:
In order to ensure the price stability of niche agricultural products and enhance farmers’ income, the study delves into the pattern of the ginger price fluctuation rule and its main influencing factors. By combining seasonal decomposition STL, long and short-term memory network LSTM, attention mechanism ATT and Kolmogorov-Arnold network, a combined STL-LSTM-ATT-KAN prediction model is developed, and the model parameters are finely tuned by using multi-population adaptive particle swarm optimisation algorithm (AMP-PSO). Based on an in-depth analysis of actual data on ginger prices over the past decade, the STL-LSTM-ATT-KAN model demonstrated excellent performance in terms of prediction accuracy: its mean absolute error (MAE) was 0.111, mean squared error (MSE) was 0.021, root mean squared error (RMSE) was 0.146, and the coefficient of determination (R2) was 0.998. This study provides the Ginger Industry, agricultural trade, farmers and policymakers with digitalised and intelligent aids, which are important for improving market monitoring, risk control, competitiveness and guaranteeing the stability of supply and price.

1. Introduction

As a large agricultural country, China’s agriculture is the foundation of the country’s economy. The stability of agricultural prices has a direct impact on the rural economy, market regulation and the interests of farmers and consumers. Ginger price fluctuations are influenced by a variety of factors and have a significant impact on the downstream industry chain [1]. Therefore, accurate prediction of ginger price is crucial for farmers’ production planning, consumers’ consumption arrangement and government market regulation.
For the price fluctuation of agricultural products, researchers have widely used the ARIMA model in the field of agricultural price forecasting and verified its effectiveness. And successfully predicted the price trend of agricultural products such as cabbage, corn, mango, cucumber and potato [2,3,4,5]. The model is used to forecast the price trend of agricultural products such as cabbage, corn, mango, cucumber and potato. Meanwhile, the researchers improved the accuracy of the model by applying machine learning techniques such as time series analysis, support vector machine and neural network [6,7,8,9,10,11]. Nevertheless, researchers still need to face the challenges of insufficient model generalisation capability and incomplete consideration of complex influencing factors. In recent years, significant progress has been made in research on agricultural price forecasting, covering from traditional time series analysis to advanced machine learning and deep learning techniques. Sun et al. provide a review of existing methods, pointing out that combinatorial models and intelligent forecasting methods have a promising application in the future. However, the complexity and nonlinear nature of time series makes it still challenging to accurately forecast price fluctuations [12].
Deep learning techniques are pushing traditional boundaries, and their potential in the field of prediction is becoming increasingly significant. At the same time, elements such as online public opinion and government support are being integrated into the prediction model to improve the accuracy of prediction. Jinling Teng et al. used Prophet model to predict ginger price [13]; Wang Yan improved ginger price prediction accuracy using STCN-LSTM model and improved loss function [14]; Xingchen Lv showed that online public opinion can improve the price prediction accuracy of small agricultural products [15]; Chaudhary et al. used value chain analysis to propose ginger market optimisation strategies, pointing out the importance of government and technical support [16]; Manjubala et al. used complex exponential smoothing to accurately predict weekly prices of garlic and ginger [17]; Hongfeng Li et al. investigated the price factors of ginger [18]; Fu et al. revealed the mechanism of multiple and complex factors affecting the prices of small-scale agricultural commodities [19]; Anamisa et al. used a normalised LSTM model to improve the accuracy of ginger price prediction [20]; Lin et al.’s GCRNN model improves time series classification accuracy and model interpretability [21]; CH-LSTM model developed by Linmei Hu et al. to predict future sub-events [22]; ATTAIN network proposed by Zhang et al. which improves the prediction accuracy and model interpretability through the attention mechanism [23]; Zhang Dabin et al. proposed a VMD-ELM-based integrated prediction model for agricultural futures price decomposition, which significantly improved the prediction accuracy by optimising the VMD parameters and combining with the learning capability of ELM, providing a new method for agricultural futures price prediction [24]; Wang Runzhou et al. proposed a prediction model for agricultural commodity prices based on signal decomposition and deep learning, which effectively improves the prediction accuracy and stability of agricultural commodity prices by complementary ensemble empirical modal decomposition (CEEMD) and deep learning network to extract features, combined with multidimensional data, effectively improved the prediction accuracy and stability of the price of agricultural products such as white pork, spinach, apples, eggs, etc. [25]; Xueqing Fang et al. proposed EEMD-LSTM model for short-term price prediction of agricultural products, which significantly improved the prediction performance through feature extraction and LSTM network training [26]; Gu Yeong Hyeon et al. proposed a DIA-LSTM model for cabbage and radish price forecasting in Korea, which significantly reduces the forecasting error by dynamically selecting meteorological and trading volume data from the main production areas and provides a new method to stabilise the supply and demand of agricultural products [27]; Sun Changxia et al. proposed a hybrid VMD-EEMD-LSTM forecasting model, which effectively improves the pork in China through quadratic decomposition and LSTM training, leek, mushroom and cauliflower price prediction accuracy [28].
Deep learning techniques have made remarkable achievements in the field of agricultural price prediction, but the research for multi-factor models still needs to be further deepened. Sun et al. suggested that future research directions should include the development of more effective combinatorial models in order to integrate the advantages of different models so as to improve the accuracy and stability of the prediction [12]. Price volatility is the result of a combination of factors, so it is particularly critical to analyse these factors and develop integrated forecasting models. Integrated models can effectively improve the accuracy of forecasts by combining the advantages of different models. Building an integrated model requires integrating multiple data sources and optimising the model structure. Future research needs to explore the development and optimisation of multi-factor models further to capture the factors that influence price volatility in a more comprehensive way. Sun et al. also highlighted this point and suggested that structured and unstructured data should be integrated into the model to improve the accuracy of the prediction [12]. Based on this, this paper constructs a combined STL-LSTM-ATT-KAN (Seasonal Trend Decomposition-Long and Short-Term Memory Network-Attention Mechanism-Kolmogorov-Arnold Network) model for the purpose of predicting ginger prices with the expectation that the accuracy of the prediction will be further improved by this model and its practical application value will be enhanced. In order to further improve the accuracy of ginger price prediction, an improved particle swarm optimisation algorithm, the Adaptive Multi-Population Particle Swarm Optimisation (AMP-PSO) algorithm, is introduced in this study [29]. AMP-PSO effectively improves the efficiency and accuracy of the model parameter optimisation through the multi-population structure and adaptive parameter tuning mechanism and provides a powerful model for ginger price prediction. Ginger price prediction provides powerful technical support.

2. Materials and Methods

2.1. Analysis of Factors Affecting the Price of Ginger

This study aims to investigate the fluctuation pattern of ginger prices, analyse the price history and fluctuation pattern, and identify the key influencing factors through literature review, expert interviews and fieldwork. The specific influencing factors are shown in Table 1.
Ginger price fluctuations reflect regional and inter-variety trends, and market linkage effects indicate shifts in supply and demand, improving forecasting accuracy. Supply and demand indicators map supply conditions and market dynamics to predict price volatility. Agricultural valuation indicators reflect production conditions and price changes that affect the ginger market. Economic indicators show the macroeconomic impact on prices, including money supply and exchange rate movements. A comprehensive analysis of these factors allows for a more comprehensive forecast of ginger prices and improves the model’s accuracy and generalizability.

2.2. Theoretical Approach and Model Construction

This paper innovatively constructs a model consisting of a combination of STL-LSTM-ATT-KAN aimed at forecasting ginger prices. The model first decomposes the time series using STL (Seasonal Trend Decomposition), then captures the long-term dependencies through LSTM (Long Short-Term Memory Network), followed by ATT (Attention Technique) to strengthen the identification of key information, and finally optimises the integration of information through KAN network [30]. In addition, the AMP-PSO (Adaptive Multi-Particle Swarm Optimisation) algorithm was used to optimise the model parameters to improve the accuracy and performance of the prediction [29]. AMP-PSO provides an efficient and accurate solution for ginger price prediction by effectively balancing global and local search capabilities through a multi-population structure and adaptive parameter adjustment mechanism.
As shown in Figure 1, the STL-ATT-LSTM-KAN model structure contains three main steps:
(i)
The STL (Seasonal Trend Decomposition) module serves to decompose the ginger price time series into a trend component, a seasonal component and a stochastic component.
(ii)
In the LSTM-ATT-KAN process, LSTM processes time series data to capture long-term dependent information; the attention mechanism highlights key time point information, and the KAN module optimally integrates the information to improve prediction accuracy.
(iii)
The AMP-PSO optimisation step ensures optimal model prediction performance by adaptively adjusting the particle swarm search space and optimising the model parameters.
The final output module displays the model’s predictions, revealing the trend changes in the future price of ginger.

2.2.1. Seasonal-Trend Decomposition Using STL for Ginger Price Analysis

The Seasonal-Trend Decomposition using LOESS (STL) is a robust time series decomposition technique that decomposes ginger price data into three independent components:trend ( T t ), seasonality ( S t ), and residual ( R t ), estimated separately using the Locally Weighted Scatterplot Smoothing (LOESS) method. The calculation formula for this method, as shown in Equation (1):
y t = T t + S t + R t
where y t represents the time series data, T t denotes the trend component, which reflects the overall upward or downward trend of prices;   S t denotes the seasonal component, which reveals the regularity of price fluctuations over a one-year cycle; R t denotes the residual component, which represents stochastic fluctuations in prices that cannot be explained by the model and may be caused by factors such as weather changes, natural disasters, or sudden market events.
The trend component   T t and the seasonal component S t are calculated as shown in Equations (2) and (3).
T t = LOESS y t , λ T
S t = LOESS y t T t , λ S
Of these, the λ T and λ S denote the smoothing parameters for the trend and seasonal components, respectively.
In this study, STL enhances the forecasting accuracy and stability of our STL-LSTM-ATT-KAN model by isolating seasonal and trend components, enabling the subsequent LSTM layer to better capture temporal dependencies. Later experimental results demonstrate the effectiveness of STL in coping with the high volatility of ginger prices, especially during the peak harvest season.

2.2.2. LSTM-ATT-KAN Model Construction

  • Step 1: LSTM in STL-LSTM-ATT-KAN Model
LSTM (Long Short-Term Memory Network) is an improved recurrent neural network (RNN) that efficiently captures long-term and short-term dependencies in time-series data by means of memory units and gating mechanisms (input gates, forgetting gates, and output gates). In this study, LSTM is combined with seasonal decomposition (STL) to process the trend and seasonal components of the decomposition and extract time-dependent features. The first layer of LSTM focuses on serial pattern modelling, while the second layer of LSTM further refines the advanced features to improve the accuracy of ginger price prediction. The basic unit structure of LSTM is shown in Figure 2.
The basic unit of the LSTM can be expressed as the following equation:
Oblivion Gate:
f t = σ W f h t 1 , x t + b f
Input Gate:
i t = σ W i h t 1 , x t + b i
C t ~ = tanh W C h t 1 , x t + b C
Memory Updates:
C t = f t C t 1 + i t C t ~
Output Gate:
o t = σ W o h t 1 , x t + b o
h t = o t tanh C t
  • Step 2: Attention Mechanism in STL-LSTM-ATT-KAN Model
ATT (Attention Mechanism) is a dynamic feature selection technique that focuses on critical information in time series data while de-emphasising less relevant details, mimicking human attention allocation by calculating weights of different feature vectors to achieve high-quality feature extraction. In this study, ATT is integrated into the STL-LSTM-ATT-KAN model to enhance the focus on key time points in ginger price sequences, improving the prediction of price fluctuations. The basic principle of the attention mechanism is illustrated in Figure 3, where it dynamically prioritises influential time steps based on their relevance. Figure 3 illustrates the attention mechanism’s workflow, highlighting the dynamic weighting of time steps to prioritise relevant features in ginger price time series data.
The weight calculation is formalised in Equations (10) and (11):
e t = tanh W e h t + b e
α t = exp e t i = 1 T exp e i
where e t represents the energy score for time t , W e is a weight matrix, h t is the hidden state vector, b e is a bias term, t a n h is the hyperbolic tangent function compressing values between −1 and 1, and e x p with the denominator ensures α t forms a probability distribution over all time steps T .
This mechanism acts as a dynamic feature selector, allowing the model to focus on key price patterns in the ginger price data. In the experiments, ATT significantly improves the performance of the STL-LSTM-ATT-KAN model by improving the capture of key temporal dependencies.
  • Step 3: Kolmogorov-Arnold Network (KAN) in STL-LSTM-ATT-KAN Model
KAN (Kolmogorov-Arnold Network) is a neural network architecture based on the Kolmogorov-Arnold theorem, which decomposes complex multivariate functions into combinations of simple one-dimensional functions [30]. This enables KAN to effectively extract key features from high-dimensional data, enhancing model performance. In this study, KAN is integrated into the STL-LSTM-ATT-KAN model to process the high-dimensional features extracted by the LSTM and Attention Mechanism, further improving the expressive power for ginger price prediction.
The structure of KAN is depicted in Figure 4, comprising:
  • Input Features: Represented as x1, x2, x3, these are the initial features (e.g., decomposed trends and seasonal components from ginger price data).
  • One-Dimensional Functions: Each input feature is transformed by a corresponding one-dimensional function ( ϕ i j x j ).
  • Feature Fusion: The outputs are aggregated into a fused feature y , as shown in Equation (12):
    y = i = 1 n g i j = 1 m ϕ i j x j
    where y is the fused feature, g i are transformation functions, ϕ i j are one-dimensional functions, and x j are input variables, with n representing the number of transformation functions and m the number of input features.
  • Output Layer: The fused feature y is mapped through a fully connected layer to generate the final prediction y ^ , as described in Equation (13):
    y ^ = R e L U W f c y + b f c
    where W f c is the weight matrix mapping high-dimensional features to the target dimension, b f c is the bias adjusting the feature space centre, and ReLU is the rectified linear unit activation function, enabling nonlinear modelling of future ginger price trends.
This architecture enhances the STL-LSTM-ATT-KAN model’s ability to capture complex nonlinear patterns in ginger prices (e.g., market shocks and seasonal dynamics), achieving superior prediction performance for agricultural market monitoring.

2.2.3. Adaptive Multi-Population Particle Swarm Optimisation (AMP-PSO) Algorithm

The Adaptive Multi-Population Particle Swarm Optimisation (AMP-PSO) algorithm is an enhanced version of the Particle Swarm Optimisation (PSO) algorithm, incorporating a multi-population strategy and adaptive parameter adjustments to significantly improve global search capability and convergence speed. In this study, AMP-PSO is applied to optimise the parameters of the STL-LSTM-ATT-KAN model, ensuring optimal prediction performance for complex ginger price time series data.
(1)
Multi-Population Strategy
AMP-PSO divides the particle swarm into multiple sub-populations, each performing independent optimisation to balance global exploration and local exploitation. Particles are categorised into:
    • Leader Population: Conducts global searches by interacting with other sub-populations to expand the solution space.
    • Follower Population: Focuses on local refinement, leveraging local optima to enhance precision.
Through periodic particle exchanges, AMP-PSO maintains population diversity and accelerates convergence, effectively preventing traditional PSO from getting trapped in local optima.
(2)
Adaptive Parameter Adjustment
AMP-PSO dynamically adjusts the inertia weight ( ω t ) and learning factors ( c 1 , c 2 ) to balance global and local search capabilities. The adaptive inertia weight is updated as:
ω t = ω m a x ω m a x ω m i n t T m a x
where ω m a x and ω m i n are the maximum and minimum inertia weights, t is the current iteration, and T m a x is the maximum iteration number. This mechanism enhances the search efficiency and convergence speed for optimising the STL-LSTM-ATT-KAN model’s parameters in ginger price prediction.
(3)
Particle Update Mechanism
Particle positions and velocities are updated for each dimension j of particle i using the following Equation (15):
  • Velocity Update:
v i , j t + 1 = ω t v i , j t + c 1 r 1 p i , j t x i , j t + c 2 r 2 g b e s t , j t x i , j t
where v i , j t and x i , j t are the velocity and position of particle i at dimension j and iteration t , p i , j t is the individual best position, g b e s t , j t is the global best position, ω t is the adaptive inertia weight (updated in Equation (14)), c 1 , c 2 are the learning factors, and r 1 , r 2 ~ U (0, 1) are random numbers in [0, 1].
  • Position Update:
x i j t + 1 = x i j t + v i j t + 1
where x i j t + 1 and v i j t + 1 are the position and velocity of particle i at dimension j and iteration t + 1 , respectively, and x i j t is the position at iteration t .
To constrain particle states within reasonable bounds, AMP-PSO applies a s i g m o i d function to limit velocity and position elements to [0, 1]:
s i g m o i d x = 1 1 + e x
During each iteration, the algorithm evaluates the objective function F for each particle. If the current position yields a better fitness than the individual best, p b e s t , i j is updated for each dimension j , as described in Equation (18). Suppose the fitness surpasses the global best, g b e s t , j is updated for each dimension j , as described in Equation (19). Here, F is the objective function, defined as minimising the prediction error of ginger prices in the STL-LSTM-ATT-KAN model, x i j ( t + 1 ) denotes the current position for dimension j of particle i at iteration ( t + 1 ) , and p b e s t , i j ( t ) and g b e s t , j ( t ) denote the individual and global best positions, respectively, for dimension j at iteration t .
p b e s t , i j ( t + 1 ) = x i j ( t + 1 )   i f   F ( x i j ( t + 1 ) ) > F ( p b e s t , i j ( t ) )
If the fitness surpasses the g b e s t , j is updated for each dimension j :
g b e s t , j ( t + 1 ) = x i j ( t + 1 )   i f   F ( x i j ( t + 1 ) ) > F ( g b e s t , j ( t ) )
where F is the objective function, defined as minimising the prediction error of ginger prices in the STL-LSTM-ATT-KAN model, p i , j t denotes the current position, and p b e s t , i j ( t ) denotes the individual best position, both for dimension j of particle i at iteration t , while g b e s t , j ( t ) denotes the global best position for dimension j at iteration u p d a t e d across all particles i to optimise the model parameters. Note that p b e s t , i j ( t + 1 ) and g b e s t , j ( t + 1 ) are updated in the next iteration if the fitness improves, as described in Equations (18) and (19).
(4)
Particle Exchange Mechanism
To enhance diversity and prevent premature convergence, AMP-PSO periodically exchanges particles between the leader and follower populations after a predefined number of iterations, introducing new solution space information to accelerate convergence.
(5)
Determination of Global Optimal Solution
At each iteration, AMP-PSO updates individual and global optima based on fitness values. The algorithm terminates when reaching the maximum iteration T m a x , achieving convergence of the objective function, or finding a solution meeting performance criteria (e.g., minimising prediction error). The global optimal position determines the optimal parameters for the STL-LSTM-ATT-KAN model, balancing multiple objectives to yield a Pareto-optimal solution set.
Compared to traditional PSO, AMP-PSO avoids local optima through its multi-population strategy and adaptive adjustments. The follower population’s local search capability improves parameter precision, while particle exchanges and adaptive inertia weights enhance diversity and adaptability. In our experiments, AMP-PSO significantly improved the STL-LSTM-ATT-KAN model’s prediction accuracy and stability for ginger prices, maintaining high computational efficiency for agricultural applications.

2.3. Experimental Design

2.3.1. Experimental Setup

  • Experimental environment
The experiments were conducted using a Suttai ST-SN260 server with an AMD EPYC 9754 CPU (128 cores, 2.25 GHz), NVIDIA RTX 4060 GPU (8 GB), Samsung 384 GB DDR5 RAM, Samsung 2 TB SSD and 16 TB HDD. The operating system was Ubuntu 20.04 LTS version, with the installation of Python 3.8.10 and libraries PyTorch 1.9.0, NumPy 1.21.0, and Pandas 1.3.0.
  • Data sources
The agricultural product price data used in the study comes from the National Key Agricultural Product Market Information Platform of the Ministry of Agriculture and Rural Affairs (PRC). The platform compiles and publishes price information from major wholesale markets for agricultural products across the country. The time span chosen for the experiment is nearly ten years, from 1 January 2014 to 29 September 2024, for the daily wholesale price data of ginger. In order to deeply explore the formation mechanism of ginger price and its fluctuation pattern, 13 dimensions of key influencing factor indicators, including daily wholesale price of garlic, daily wholesale price of green onion, temperature of main production area, planting area, production, production volume index, consumer price index (CPI) of fresh vegetables, export volume, export volume, M2 money supply, exchange rate, crude oil price, and public opinion of ginger, are selected in a comprehensive manner and in combination with the actual situation. The data for the selected indicators come from the Ministry of Agriculture and Rural Affairs (PRC), Ministry of Commerce of the People’s Republic of China (MOFCOM), National Bureau of Statistics of China (NBS), General Administration of Customs of the People’s Republic of China (GACC), The People’s Bank Of China (PBC), China Meteorological Administration (CMA), Brick Agricultural Database, Baidu Index, as well as authoritative organisations and platforms such as the Food and Agriculture Organisation of the United Nations (FAO), and the Energy Information Administration (EIA). These data sources are rich and varied and of high reference value, providing solid support for the study. Specific platform website information is detailed in the subsequent description of data sources (Abbreviations).
This study collects public data from websites through crawling techniques. Static web pages are mainly crawled using Python’s BeautifulSoup and Request libraries, while dynamically loaded content (e.g., sections requiring login authorisation) is efficiently processed using Selenium and XPath tools.
  • Data processing
With regard to the data preprocessing stage, the collected ginger dataset was systematically organised and cleaned to ensure data quality. The specific steps involved are as follows:
① Initially, the data underwent a thorough cleansing process, encompassing the removal of duplicate records and the management of outliers.
② For instances where values were missing, the interpolation of similar mean values was employed to ensure the integrity and consistency of the data.
③ Conversion of the data format was conducted to facilitate the seamless progression of subsequent analyses.
The efficacy of these preprocessing steps in enhancing the reliability and applicability of the dataset is evident.
The aggregated dataset (3925 data points from 1 January 2014 to 29 September 2024) was divided into a training set (65%), a validation set (20%), and a test set (15%) according to the time series. The division is as follows: The training set contained 2551 entries (1 January 2014 to 26 December 2020), the validation set contained 785 entries (27 December 2020 to 23 February 2023), and the test set contained 589 entries (24 February 2023 to 29 September 2024). This division increases the proportion of training data to reduce the risk of overfitting while ensuring that the validation and test sets have sufficient sample sizes on unseen data to improve the generalisation ability of the model.
In order to enhance the interpretability and predictive ability of the model, the price volatility analysis was simplified by dividing the ginger price series data using the STL method. The STL decomposition separates the raw data into three components: trend, seasonal and residual. The results are displayed in Figure 5.

2.3.2. Forecast Evaluation Indicators

When forecasting ginger prices, the assessment of the model’s predictive performance is crucial. Metrics such as mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R2) are usually used for the assessment.
The mean square error (MSE) is the average of the squares of the differences between the predicted and true values:
MSE = 1 n i = 1 n y i y i ^ 2
where y i is the true value and y i ^ is the predicted value, and n is the sample size.
The root mean square error (RMSE) is the difference between the observed value and the true value. The square root of the ratio of the square of the deviation of an observation from the true value to the number n of observations:
  R M S E = 1 n i = 1 n · y i y i ^ 2
The Mean Absolute Error (MAE) is the average of the absolute values of the difference between the predicted and true values:
MAE = 1 n i = 1 n y i y i ^
The coefficient of determination (R2) is used to measure the proportion of total variance in the explanatory variables of the model and indicates the goodness of fit of the model:
R 2 = 1 i = 1 n y i y i ^ 2 i = 1 n y i y ¯ 2
where y ¯ is the mean of the true values. The value range of R2 is between 0 and 1, which can intuitively reflect the goodness of fit of the model, and the closer the value of R2 is to 1, the stronger the explanatory power of the model.

2.4. Model Optimisation Parameter Setting

To ensure that all parts of the model are fully functional, the parameters of the model were finely tuned in this study using the Adaptive Particle Swarm Optimisation algorithm for Multiple Populations (AMP-PSO). The main parameters of the model were set as follows: kan_units (number of KAN network units) to 10, lstm_units (number of LSTM network units) to 10, learning_rate (learning rate) to 0.005, and batch_size (batch size) to 26.908, as shown in Table 2 below.

3. Results

3.1. Experimental Results

To better understand and optimise the training process of the model, in order to further validate the effect of model training, this paper plots the loss map of the STL-LSTM-ATT-KAN model during the training process, as shown in Figure 6 below.
As shown in Figure 6, the model training loss (blue line) and validation loss (orange line) vary with epoch. The initial training loss decreases rapidly, indicating that the model converges quickly and captures the training data patterns. The training loss is low and stable for most of the training cycles, indicating that the model fits well and the training process is stable.
The residual plot shows the distribution of the difference between the true value and the predicted value (i.e., the residual). By looking at the distribution of the residuals, it is possible to visually assess the model’s prediction bias and error patterns. This is shown in Figure 7.
Figure 7 shows the distribution of the residuals between the model’s predicted and true values, where the residuals are defined as the difference between the true value and the predicted value, which is used to assess prediction accuracy. In the figure, the red dashed line indicates the baseline, where the residuals are zero, and the blue dots show the residuals for each sample. Most of the blue points are distributed around the zero line (residuals range from about −0.5 to 0.5), indicating that the model predicts most of the data more accurately and close to the true value. However, when the true value is large (especially above 10), the distribution of blue points becomes more spread out and extends to a range of −1.0 to 1.5, suggesting that the model’s error in predicting high values increases. In particular, the residuals are skewed towards positive values (above the zero line) in regions where the true value is greater than 14, reflecting the fact that the model may be underestimating the true data for these high values.
In addition, the model performs better in regions with low (less than 8) or moderate (around 8–12) true values, with less fluctuation in the residuals, whereas the residuals in regions with high values fluctuate more, suggesting a limitation of the model in dealing with large or extreme values. If the distribution of residuals shows a clear pattern (e.g., trend or periodicity), this may indicate that the model is not fully capturing certain features in the time series data. In the future, the prediction accuracy and stability of the model can be improved by increasing the data set, optimising the data processing method, and improving the prediction algorithm to reduce errors in the high-value range.
Through the training and prediction process of the model, it is possible to obtain the predicted values of ginger prices. In order to visualise these predictions more, a trend comparison graph between the real and predicted values and a predicted trend graph for the next seven days were produced, respectively, as shown in Figure 8 and Figure 9.
This study demonstrates the effectiveness of AMP-PSO in optimising the parameters of the ginger price prediction model. The multi-population structure and adaptive parameters of AMP-PSO improve the searchability and convergence speed of the model, providing an efficient and accurate solution for ginger price prediction. Experiments show that the AMP-PSO optimised STL-LSTM-ATT-KAN model significantly outperforms other algorithms in terms of prediction accuracy, with specific metrics of MAE: 0.111, MSE: 0.021, RMSE: 0.146, and R2: 0.998. This demonstrates that the model has high accuracy and stability when dealing with complex time series data. Therefore, the optimised model of AMP-PSO performs well in terms of prediction accuracy, stability, and adaptability, and it provides powerful technical support for ginger price prediction. Traditional PSO is easy to fall into a local optimum, has limited accuracy, and performs poorly when dealing with complex data. Genetic algorithm GA has strong global search capability but is computationally complex and slow. Multi-population PSO (MP-PSO) improves the optimisation ability but lacks adaptive tuning and has limited effect. AMP-PSO combines multi-population and adaptive parameters and is superior in optimisation accuracy and speed. Experiments show that AMP-PSO performs well on all indicators with high computational efficiency, provides technical support for ginger price prediction, and verifies its effectiveness in complex time series prediction.

3.2. Comparative Experimental Results

In order to verify the prediction advantages of this model, it is compared with RF, SVM, ARIMA, XGBoost, CNN, RNN, LSTM, GRU, etc. RF and XGBoost are integrated models based on decision trees, which are good at dealing with nonlinear relationships. RF reduces overfitting, and XGBoost reduces errors. SVM is a linear classifier that is used by the kernel method to deal with nonlinear problems but has limited flexibility in time series prediction tasks. ARIMA is suitable for linear time series data. CNN is good at extracting local features, RNN is the basic model for time series modelling, LSTM deals with long-term dependencies, and GRU has fewer parameters and is computationally efficient. By comparing these eight models, the prediction results of different models are shown in Figure 10.
Comparative experiments and quantitative analysis were conducted to evaluate the performance of the model in ginger price prediction. The evaluation metrics and error comparisons are shown in Table 3 and Figure 11, respectively.
The MAE measures the mean absolute error between the predicted and true values. From Figure 11, the STL-LSTM-ATT-KAN model and the RF model have the smallest Mean Absolute Error (MAE) in prediction, showing that they have the least deviation from the true value. XGBoost also shows a low MAE, demonstrating the ability of these integrated learning models to capture trends and patterns in the data. In contrast, the ARIMA model has a high MAE, indicating that it performs poorly in capturing nonlinear features, leading to larger prediction errors.
The MSE not only reflects the magnitude of the prediction error but also weights the larger errors. From Figure 11, the STL-LSTM-ATT-KAN model has the lowest MSE, implying that the model not only has small errors but also exhibits better robustness and immunity to interference in the case of extreme values or outliers. This is due to its integrated model architecture of STL decomposition and attention mechanism, which can finely regulate the weights of different features to reduce large errors; the model effectively captures trends and seasonal variations in the time series and accurately identifies the key time points through the attention mechanism. The MSEs of RF and XGBoost are slightly higher, but the difference is not that big compared with STL-LSTM-ATT-KAN, which is not significant, indicating that they also have better performance in extreme error control.
RMSE, root mean square error, is the square root of MSE (mean square error), which provides a measure of error that is consistent with the scale of the original data. From Figure 11, the STL-LSTM-ATT-KAN model exhibits the lowest RMSE value in terms of processing complex time series data, which further confirms the high accuracy and consistency of the model. This suggests that the LSTM structure incorporating the attention mechanism is able to effectively capture the temporal and feature dependencies in time series data, thereby significantly reducing the overall error. Following closely behind, the RF (Random Forest) and XGBoost models also exhibit good performance, showing that their errors are relatively small and evenly distributed.
The R2 metric is used to measure the model’s ability to explain changes in the data. From Figure 11, all models except the ARIMA model have high R2 values, which indicates that they are able to effectively explain the variation in ginger prices. However, the STL-LSTM-ATT-KAN model not only maintains a high R2 value but also significantly reduces the MAE, MSE, and RMSE, which indicates that the model demonstrates a significant advantage in terms of all-round performance when dealing with complex time series data.

3.3. Results of Ablation Experiments

The results in Table 4 show that the number of ATT-KAN has a significant impact on the performance of the STL-LSTM model: Too few (e.g., 20) or too many (e.g., 75, 100) ATT-KAN lead to performance degradation, while the baseline model (which may use the optimal number of ATT-KAN) performs best, suggesting that the number of ATT-KAN needs to be experimentally optimised to achieve optimal performance. The ablation analysis in Table 5 also shows that STL and ATT are crucial for performance improvement, while KAN contributes little, but the complete model (STL-LSTM-ATT-KAN) has the best performance. In contrast, traditional LSTM performance deteriorates significantly when used alone, demonstrating that advanced features such as STL and ATT are essential for the task at hand. The evaluation indices show that the smaller the MAE, MSE and RMSE, the more accurate the model prediction. The closer R2 is to 1, the better the model fit, and these metrics consistently validate the superior performance of the complete model on the task at hand.
Figure 12, the significant decrease in MAE, suggests that the STL-LSTM-ATT-KAN model significantly improves the prediction accuracy by incorporating the attention mechanism and the KAN network. In contrast, the STL-LSTM model that lacks the attention mechanism and KAN network leads to a significant increase in MAE, while the LSTM model that lacks the advantage of time series decomposition further exacerbates the prediction error.
The significant decrease in MSE reveals that the combination of the ATT and KAN networks not only improves forecasting accuracy but also strengthens the stability of the model, making it perform better in the face of abnormal volatility. Although the STL-LSTM model lacking ATT and KAN networks still retains the advantages of STL decomposition, it is still inferior to the full STL-LSTM model integrating ATT and KAN networks in terms of error control in complex scenarios. The LSTM model lacking STL decomposition, on the other hand, shows a higher error rate, which further proves the key role of STL in time series feature decomposition.
The significant reduction in RMSE further confirms the overall superiority of the STL-LSTM-ATT-KAN model in time series forecasting. The lower RMSE values indicate that the model is able to provide more accurate forecasts in most cases. Although the RMSE of the STL-LSTM model is lower than that of the standard LSTM model, its prediction results still suffer from a large error due to the lack of enhancement by the ATT and KAN networks. In contrast, the standard LSTM model is unable to decompose the time series efficiently, which leads to the poor stability of its prediction results.
The R2 values indicate that both the STL-LSTM-ATT-KAN and STL-LSTM models can excellently elucidate the variance of ginger price fluctuations, which is mainly due to the STL decomposition technique and the LSTM network’s accurate capture of the long-term dependence of the time series. However, the R2 value of the LSTM model is almost zero, which indicates that it is extremely weak in explaining the ginger price fluctuations without applying the time series decomposition, and the prediction effect is significantly reduced.
The STL-LSTM-ATT-KAN model performs optimally on the evaluation metrics with low MAE, MSE and RMSE values, showing its ability to reduce prediction errors. The achievement is attributed to the combination of STL decomposition and the attention mechanism, which improves the prediction accuracy. The increase in error after removing the attention mechanism emphasises its role in error reduction. The LSTM model, although fitting the data well, does not have as good a prediction accuracy as the STL-LSTM-ATT-KAN, confirming the enhancement of the model performance by the STL decomposition and the attention mechanism.
By applying the STL (Seasonal Trend Decomposition) technique to decompose the time series data, the model is able to handle the trend, seasonality, and residual components independently, which significantly reduces the forecast error. The Long Short-Term Memory Network (LSTM), with its superior ability to capture long-term dependencies in time-series data, enables the model to more accurately handle the long-term trend of ginger prices. Incorporating the attention mechanism in the model allows the model to focus more on key time points during the forecasting process, which improves the accuracy of the forecasts and further reduces errors. The integration of the KAN network integrates external knowledge sources, improves the generalisation ability of the model, and ensures the stability and reliability of the model when dealing with new data.

4. Discussion

The STL-LSTM-ATT-KAN ginger price prediction model proposed in this study shows significant advantages in prediction accuracy and stability. This result is due to the optimal design of the model structure and the efficient adjustment of parameters by the adaptive multi-population particle swarm optimisation (AMP-PSO) algorithm. AMP-PSO balances the global and local search ability through the multi-population strategy and the adaptive adjustment mechanism, which improves the efficiency of parameter optimisation and enhances the accuracy and stability of ginger price prediction.
However, the model has some limitations. The study covers the last ten years, and the data are more obviously affected by seasonal fluctuations, economic situations and policies. The current analysis is based on data availability and the typical cycle of ginger prices, and the performance of the model in other time horizons has not been adequately tested, and the generalisability has not been verified in a wider range of scenarios.
Future research proposes to improve the model in the following directions. The model will be applied to the price forecasting of other agricultural products, such as garlic, shallots, chillies and peppers, to assess its applicability and robustness. The dataset will be extended to more agricultural product types by introducing macroeconomic indicators (e.g., inflation rate, gross domestic product, trade-weighted exchange rate index, agricultural production costs, domestic diesel price) and climatic variables (e.g., rainfall, temperature, relative humidity, sunshine hours and frequency of extreme weather events) to capture the drivers of price fluctuations. The optimisation of data sources will improve accuracy and completeness and provide high-quality support to the model. The forecasting horizon will be extended from short-term fluctuations to long-term trends to test its adaptability over different business cycles. Improvements in algorithm design and parameter tuning methods are expected to enhance forecasting performance.
The practical value of the model will need to be validated through collaboration with agribusiness and government agencies, and it is expected to play a role in agricultural market monitoring, risk management, and policy formulation.

5. Conclusions

In the context of agricultural markets, price volatility carries significant ramifications for a range of stakeholders, including farmers, traders, consumers and policymakers. This is particularly evident in the case of agricultural products such as ginger, which are produced and consumed on a seasonal basis. Price uncertainty can result in market imbalances, fluctuations in farmers’ incomes and unpredictability in consumer spending. Consequently, the development of a model capable of accurately predicting ginger price fluctuations is imperative for enhancing market efficiency, stabilising farmers’ incomes, guiding consumer behaviour and facilitating policy formulation.
The objective of the present study is to enhance the precision and reliability of predictions by integrating seasonal decomposition, long- and short-term memory networks, attention mechanisms, and Kolmogorov-Arnold networks. The proposed STL-LSTM-ATT-KAN prediction model has been developed to address this need, with a focus on capturing seasonal fluctuations and long-term trends in ginger prices. The incorporation of an attention mechanism is a key innovation as it enables the identification of key factors affecting prices, thereby providing more reliable decision support for relevant stakeholders.
The model was constructed and validated in this study, and it was found to significantly improve the accuracy and stability of forecasting by accurately capturing the linkage effects among markets and the interactions between ginger production and macroeconomics. The introduction of the AMP-PSO algorithm further optimises the model parameters and enhances the performance of the model in complex time series forecasting. The experimental results demonstrate that the proposed model significantly outperforms alternative algorithms in terms of forecasting accuracy (MAE: 0.111, MSE: 0.021, RMSE: 0.146, R2: 0.998), thereby substantiating its efficacy in complex time series forecasting.
In addition, the model demonstrates considerable potential in the domains of agricultural market monitoring and risk early warning control, thereby providing substantial support for the stable operation of agricultural markets and the prosperous development of agricultural economies. Notwithstanding the positive outcomes achieved by this study, there is still scope for further enhancement and refinement. Future research directions include the following: the application of the model to a wider range of agricultural price forecasts to assess its generalisation ability; the addition of further influencing factors, such as climate change and policy adjustments, to capture the influences on price fluctuations more comprehensively; and the exploration of more efficient optimisation algorithms to reduce the computational complexity of the model. Expanding the model’s temporal range and incorporating macroeconomic indicators and seasonal data to assess its performance in long-term trend forecasting, and collaborating with agribusinesses and government departments to apply the model to real market monitoring and policy formulation to validate its application value in real-world scenarios.
Through these future endeavours, it is expected that the application scope of the model will be further validated and expanded, thereby providing more powerful support for agricultural market monitoring, risk early warning and control, and policy formulation.

Author Contributions

Conceptualisation, F.L. and X.M.; methodology, F.L.; software, F.L.; validation, L.L. and K.Z.; formal analysis, P.L.; investigation, F.L. and X.M.; resources, P.L.; data curation, J.Y.; writing—original draft preparation, F.L.; writing—review and editing, F.L. and X.M.; visualisation, F.L.; supervision, P.L.; project administration, K.Z.; funding acquisition, P.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Shandong Province Higher Education Program for the Introduction and Cultivation of Young Innovative Talents (2021) and the Shandong Province Key Research and Development Program under the Rural Revitalisation Science and Technology Innovation Enhancement Action Plan (grant number 2022TZXD0030).

Data Availability Statement

The data in this study are available upon request from the authors and corresponding author. This study analyses ginger price information as well as a variety of indicators across multiple industries in China, and the aggregated dataset cannot be publicly disclosed due to confidentiality restrictions. The aggregated data is not publicly available due to the confidentiality requirements of the project team. Daily wholesale prices for ginger, garlic and shallots were obtained from the State Key Agricultural Products Market Information Platform of the Ministry of Agriculture and Rural Development of China. Data on key indicators affecting the price of ginger (daily wholesale prices of garlic and onion, temperature in main production areas, planting area, production, production index, consumer price index (CPI) for fresh vegetables, export volume, import volume, M2 money supply, exchange rate, crude oil price, ginger public opinion, etc.) were obtained from the Ministry of Agriculture and Rural Affairs (MArA), Ministry of Commerce (MOFCOM), the National Bureau of Statistics (NBS), the General Administration of Customs (GAC), the People’s Bank of China (PBOC), the China Meteorological Administration (CMA), the Bricker Agricultural Database, Baidu Index, Food and Agriculture Organisation of the United Nations, U.S. Energy Information Administration and other authoritative institutions. Specific data sources are listed below: Daily wholesale prices of ginger, garlic and green onion from the Ministry of Agriculture and Rural Development (PRC) National Key Agricultural Products Market Information Platform (https://ncpscxx.moa.gov.cn (accessed 24 September 2024)); Temperature data for major ginger-producing areas from the China Meteorological Administration (CMA) (https://weather.cma.cn/ (accessed 24 September 2024)); Ginger planting area and consumer price index (CPI) for fresh vegetables from the National Bureau of Statistics of China (NBS). (https://data.stats.gov.cn (accessed 24 September 2024)); M2 money supply and exchange rate data from the Ministry of Commerce of China (https://cif.mofcom.gov.cn (accessed 24 September 2024)) and the People’s Bank of China (http://www.pbc.gov.cn (accessed 24 September 2024)); Ginger public opinion data from Baidu Index (https://index.baidu.com (accessed 24 September 2024)); Ginger export data from China’s General Administration of Customs (http://stats.customs.gov.cn (accessed 24 September 2024)); International crude oil prices from the U.S. Energy Information Administration (https://atlas.eia.gov (accessed 24 September 2024)); Production index and volume data from the Food and Agriculture Organisation of the United Nations (https://www.fao.org (accessed 24 September 2024)), China Statistical Yearbook (https://www.stats.gov.cn/sj/ndsj/ (accessed 24 September 2024)), Brick Database (http://www.chinabric.com/service.html (accessed 24 September 2024)), China Ginger Website (https://www.jiang7.com (accessed 24 September 2024)). All data used were accessed and retrieved on 24 September 2024 and some data required authorised access to retrieve. This study was supported by the Key Laboratory of Smart Agricultural Technology in the Huanghuaihai Region of the Ministry of Agriculture and Rural Affairs (MARD), which provided important contributions to the data collection, financial and technical resources for this study. We would also like to thank Prof Pingzeng Liu and Prof Xianyong Meng of Shandong Agricultural University for their valuable guidance on this study.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

AbbreviationFull Name
ATTAttention Mechanism
ATTAINAttention-based Time-Aware LSTM Network
AMP-PSOAdaptive Multi-Population Particle Swarm Optimization
ARIMAAutoregressive Integrated Moving Average
CEEMDComplementary Ensemble Empirical Mode Decomposition
CESComplex Exponential Smoothing
CNNConvolutional Neural Network
CMAChina Meteorological Administration
CPIConsumer Price Index
CH-LSTMContextualized Hierarchical Long Short-Term Memory
DIADual Input Attention
EEMDEnsemble Empirical Mode Decomposition
EIAU.S. Energy Information Administration
FAOFood and Agriculture Organization of the United Nations
GACCGeneral Administration of Customs, PRC
GCRNNGroup-Constrained Convolutional Recurrent Neural Network
GRUGated Recurrent Unit
KANKolmogorov-Arnold Network
LOESSLocally Estimated Scatterplot Smoothing
LSTMLong Short-Term Memory Networks
MAEMean Absolute Error
M2Broad Money Supply
MARAMinistry of Agriculture and Rural Affairs, PRC
MSEMean Squared Error
MOFCOMMinistry of Commerce, PRC
NBSNational Bureau of Statistics
PBCPeople’s Bank of China
PROPHETProphet
PRCPeople’s Republic of China
PSOParticle Swarm Optimization
R2Coefficient of Determination
RNNRecurrent Neural Network
RMSERoot Mean Squared Error
RFRandom Forest
STLSeasonal-Trend Decomposition using LOESS
STL-LSTM-ATT-KANSeasonal-Trend Decomposition-Long Short-Term Memory-Attention Mechanism-Kolmogorov-Arnold Network Combination Model
SVMSupport Vector Machine
STCN-LSTMSpatial-Temporal Convolutional Network with Long Short-Term Memory
USD/CNYUnited States Dollar to Chinese Yuan
VMDVariational Mode Decomposition
XGBoostExtreme Gradient Boosting
TermSynonyms
AMP-PSO AlgorithmAdaptive Multi-Population Particle Swarm Optimization
Attention MechanismAttention Model, Attention Network
CESComplex Exponential Smoothing
Coefficient of DeterminationR2, Goodness of Fit
Data PreprocessingData Cleaning, Data Processing
Feature ExtractionFeature Selection, Feature Processing
Ginger Price PredictionGinger Price Forecasting, Ginger Market Prediction
KAN NetworkKolmogorov-Arnold Network
LOESS MethodLocally Estimated Scatterplot Smoothing
LSTM NetworksLong Short-Term Memory Networks, Long Short-Term Memory Units
LSTM UnitLong Short-Term Memory Unit
MAEMean Absolute Error, Average Error
MSEMean Squared Error, Squared Error
Market RegulationMarket Adjustment, Market Intervention
Model EnsembleModel Fusion
Model FittingModel Training, Model Learning
Model OptimizationParameter Optimization, Model Tuning
Model TestingModel Validation, Model Evaluation
Pareto OptimalityPareto Optimal Solution, Non-Dominated Solution
Prediction AccuracyPrediction Precision, Prediction Performance
Price ForecastingTime Series Forecasting
RMSERoot Mean Squared Error, Root Mean Square Error
STL DecompositionSeasonal-Trend Decomposition
Sequence DecompositionData Decomposition, Time Series Decomposition

References

  1. Xu, K. Short-Term Price Forecasting Model for Fresh and Live Agricultural Products Based on Price Decomposition. Ph.D. Thesis, Chinese Academy of Agricultural Sciences, Beijing, China, 2016. [Google Scholar]
  2. Liu, F.; Wang, R.; Li, C. Application of ARIMA model in agricultural products price forecasting. Comput. Eng. Appl. 2009, 45, 238–239+248. [Google Scholar]
  3. Ding, W.; He, Y.; Liu, C. China’s corn price fluctuation trend and short-term forecast. Price Theory Pract. 2014, 83–84. [Google Scholar] [CrossRef]
  4. Ravishankar, P.; Rakesh, S.; Ranjit, P.K. Price Forecasting of Mango in Varanasi Market of Uttar Pradesh. Price Theory Pract. 2018, 6, 218–224. [Google Scholar]
  5. Wang, B.; Song, Y.; Zong, Y. Cucumber price trend analysis and market forecast based on ARIMA model. Stat. Manag. 2019, 87–90. [Google Scholar] [CrossRef]
  6. Van Gestel, T.; Suykens, J.; Baestaens, D.-E.; Lambrechts, A.; Lanckriet, G.; Vandaele, B.; De Moor, B.; Vandewalle, J. Financial time series prediction using least squares support vector machines within the evidence framework. IEEE Trans. Neural Networks 2001, 12, 809–821. [Google Scholar] [CrossRef]
  7. Das, M.; Ghosh, S.K. A probabilistic approach for weather forecast using spatio-temporal inter-relationships among climate variables. In Proceedings of the 2014 9th International Conference on Industrial and Information Systems (ICIIS), Gwalior, India, 15–17 December 2014; IEEE: Piscataway, NJ, USA, 2014; pp. 1–6. [Google Scholar]
  8. Duan, Q.; Zhang, L.; Wei, F.; Xiao, X.; Wang, L. Forecasting model and validation of aquatic product price based on time series GA-SVR. J. Agric. Eng. 2017, 33, 308–314. [Google Scholar]
  9. Wang, P.; Zhang, H.; Qin, Z.; Zhang, G. A novel hybrid-Garch model based on ARIMA and SVM for PM2.5 concentrations forecasting. Atmos. Pollut. Res. 2017, 8, 850–860. [Google Scholar] [CrossRef]
  10. Polyiam, K.; Boonrawd, P. A hybrid forecasting model of cassava price based on artificial neural network with support vector machine technique. In Proceedings of the 2017 3rd International Conference on Information Management (ICIM), Chengdu, China, 21–23 April 2017; IEEE: Piscataway, NJ, USA; pp. 123–127. [Google Scholar] [CrossRef]
  11. Zhao, B.-H.; Huo, Q.; Lu, Y.-H. Research on the characteristics of ginger price fluctuation and its law—Analysis based on ARCH class model. Price Theory Pract. 2022, 5, 130–133. [Google Scholar]
  12. Sun, F.; Meng, X.; Zhang, Y.; Wang, Y.; Jiang, H.; Liu, P. Agricultural Product Price Forecasting Methods: A Review. Agriculture 2023, 13, 1671. [Google Scholar] [CrossRef]
  13. Teng, J.; Liu, P.; Zhang, Y.; Xu, S.; Xu, G.; Han, W. A study on ginger price prediction based on Prophet. Chin. J. Agric. Mech. Chem. 2020, 41, 211–216. [Google Scholar]
  14. Wang, Y. Research on the Combination Prediction Model of Ginger Price Based on Multiple Influencing Factors; Shandong Agricultural University: Tai’an, China, 2023. [Google Scholar]
  15. Lv, X. Research on Price Prediction of Small Agricultural Products Based on the Influence of Network Public Opinion. Ph.D. Thesis, Northeast Agricultural University, Harbin, China, 2023. [Google Scholar]
  16. Chaudhary, R.; Giri, H.N.; Bhusal, N.R.; Dahal, S.; Timalsina, P.; Bhandari, N. An analysis of the ginger value chain in palpa, Nepal. Cogent Food Agric. 2023, 9, 2270799. [Google Scholar] [CrossRef]
  17. Manjubala, M. Weekly price prediction of garlic and ginger using complex exponential smoothing. Int. J. Stat. Appl. Math. 2023, 8, 214–220. [Google Scholar]
  18. Li, H.; Jia, Y.; Zhang, Y. Research on Pricing Strategies Based on Time Series Analysis Model and Greedy Algorithm Model. Highlights Bus. Econ. Manag. 2024, 25, 127–133. [Google Scholar] [CrossRef]
  19. Fu, L.; Zhang, H. Analysis of Price Influencing Factors of Small-Scale Agricultural Products Based on Network Perspective. Front. Sustain. Food Syst. 2023, 8, 1355853. [Google Scholar]
  20. Anamisa, D.R.; Mufarroha, F.A.; Jauhari, A.; Yusuf, M.; Khotimah, B.K.; Haq, A.F. Long Short-Term Memory Method Based on Normalisation Data for Forecasting Analysis of Madura Ginger Selling Price. In Proceedings of the 4th International Conference on Informatics, Technology and Engineering 2023 (InCITE 2023), Yogyakarta, Indonesia, 14–15 September 2023. [Google Scholar]
  21. Lin, S.; Runger, C.G. GCRNN: Group-Constrained Convolutional Recurrent Neural Network. IEEE Trans. Neural Netw. Learn. Syst. 2018, 29, 4709–4718. [Google Scholar] [CrossRef]
  22. Hu, L.; Li, J.; Nie, L.; Li, X.-L.; Shao, C. What Happens Next? Future Subevent Prediction Using Contextual Hierarchical LSTM. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence (AAAI’17), San Francisco, CA, USA, 4–9 February 2017; AAAI Press: Palo Alto, CA, USA; pp. 3450–3456. [Google Scholar] [CrossRef]
  23. Zhang, Y.; Yang, X.; Ivy, J. ATTAIN: Attention-based Time-Aware LSTM Networks for Disease Progression Modeling. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence {IJCAI-19}, Macao, China, 10–16 August 2019. [Google Scholar] [CrossRef]
  24. Zhang, D.B.; Zeng, L.L.; Ling, L.W. An integrated prediction model based on VMD-ELM for agricultural futures price decomposition. Oper. Res. Manag. 2023, 32, 127–133. [Google Scholar]
  25. Wang, R.; Zhang, X.; Wang, M. Agricultural product price prediction based on signal decomposition and deep learning. J. Agric. Eng. 2022, 38, 256–267. [Google Scholar]
  26. Fang, X.; Wu, C.; Yu, S.; Zhang, D.; Ouyang, Q. Research on short-term prediction model of agricultural products price based on EEMD-LSTM. China Manag. Sci. 2021, 29, 68–77. [Google Scholar] [CrossRef]
  27. Gu, Y.H.; Jin, D.; Yin, H.; Zheng, R.; Piao, X.; Yoo, S.J. Forecasting Agricultural Commodity Prices Using Dual Input Attention LSTM. Agriculture 2022, 12, 256. [Google Scholar] [CrossRef]
  28. Sun, C.; Pei, M.; Cao, B.; Chang, S.; Si, H. A Study on Agricultural Commodity Price Prediction Model Based on Secondary Decomposition and Long Short-Term Memory Network. Agriculture 2023, 14, 60. [Google Scholar] [CrossRef]
  29. Zhi, L.; Zuo, Y. Collaborative Path Planning of Multiple AUVs Based on Adaptive MultiPopulation PSO. J. Mar. Sci. Eng. 2024, 12, 223. [Google Scholar] [CrossRef]
  30. Liu, Z.; Wang, Y.; Vaidya, S.; Ruehle, F.; Halverson, J.; Soljačić, M.; Hou, T.Y.; Tegmark, M. Kan: Kolmogorov-arnold networks. arXiv 2024, arXiv:2404.19756. [Google Scholar]
Figure 1. STL-ATT-LSTM-KAN model structure.
Figure 1. STL-ATT-LSTM-KAN model structure.
Agriculture 15 00596 g001
Figure 2. LSTM Basic Unit.
Figure 2. LSTM Basic Unit.
Agriculture 15 00596 g002
Figure 3. Structure of the Attention Mechanism.
Figure 3. Structure of the Attention Mechanism.
Agriculture 15 00596 g003
Figure 4. KAN network structure.
Figure 4. KAN network structure.
Agriculture 15 00596 g004
Figure 5. Exploded view of STL time series.
Figure 5. Exploded view of STL time series.
Agriculture 15 00596 g005
Figure 6. Training loss curve.
Figure 6. Training loss curve.
Agriculture 15 00596 g006
Figure 7. Model residual plot.
Figure 7. Model residual plot.
Agriculture 15 00596 g007
Figure 8. Comparison of true value prediction trends.
Figure 8. Comparison of true value prediction trends.
Agriculture 15 00596 g008
Figure 9. Forecast trend for the future seven days.
Figure 9. Forecast trend for the future seven days.
Agriculture 15 00596 g009
Figure 10. Comparison of prediction results.
Figure 10. Comparison of prediction results.
Agriculture 15 00596 g010
Figure 11. Comparison error bar chart.
Figure 11. Comparison error bar chart.
Agriculture 15 00596 g011
Figure 12. Comparison bar chart of ablation errors.
Figure 12. Comparison bar chart of ablation errors.
Agriculture 15 00596 g012
Table 1. Key influences on ginger prices.
Table 1. Key influences on ginger prices.
Level 1 Impact FactorsSpecific Influencing Factors
Agricultural price factorsThe daily wholesale price of garlic
The daily wholesale price of scallions
Agricultural production factorsAverage daily temperature in the main ginger-producing areas
Area under crops
Production
Production volume index
Economic indicator factorsFresh Vegetables Consumer Price Index (CPI)
Broad money supply M2
Exchange rate (USD/CNY)
International market factorsGinger export amount
Ginger export volume
International crude oil prices
Market Opinion FactorsGinger public opinion
Table 2. AMP-PSO parameter selection.
Table 2. AMP-PSO parameter selection.
Model ParameterParameter Value
kan_units22
lstm_units50
learning_rate0.004
batch_size36.451
Table 3. Comparative experimental results.
Table 3. Comparative experimental results.
Evaluation MetricsAMP-PSO Optimised
STL-LSTM-ATT-KAN
RFSVMXGBoostCNNRNNLSTMGRU
MAE0.1110.1130.2240.1230.3980.2950.6430.707
MSE0.0210.0320.1430.04090.2680.17370.7821.195
RMSE0.1460.1810.3780.2020.5180.4160.8841.093
R20.9980.9960.9860.9960.9750.9840.9280.890
Table 4. Effect of the number of ATT-KANs on STL-LSTM performance.
Table 4. Effect of the number of ATT-KANs on STL-LSTM performance.
Evaluation MetricsSTL-LSTM-ATT-KANSTL-LSTM(20)-ATT-KANSTL-LSTM(75)-ATT-KANSTL-LSTM(100)-ATT-KAN
MAE0.1110.1290.1810.139
MSE0.0210.0260.0440.030
RMSE0.1460.1600.2110.174
R20.9980.9970.9950.997
Table 5. STL-LSTM ablation analysis.
Table 5. STL-LSTM ablation analysis.
Evaluation MetricsSTL-LSTM-ATT-KANSTL-LSTM-ATTSTL-LSTMLSTM
MAE0.1110.1130.1240.643
MSE0.0210.0190.0230.782
RMSE0.1460.1390.1510.884
R20.9980.9980.9970.928
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, F.; Meng, X.; Zhu, K.; Yan, J.; Liu, L.; Liu, P. Research on Ginger Price Prediction Model Based on Deep Learning. Agriculture 2025, 15, 596. https://doi.org/10.3390/agriculture15060596

AMA Style

Li F, Meng X, Zhu K, Yan J, Liu L, Liu P. Research on Ginger Price Prediction Model Based on Deep Learning. Agriculture. 2025; 15(6):596. https://doi.org/10.3390/agriculture15060596

Chicago/Turabian Style

Li, Fengyu, Xianyong Meng, Ke Zhu, Jun Yan, Lining Liu, and Pingzeng Liu. 2025. "Research on Ginger Price Prediction Model Based on Deep Learning" Agriculture 15, no. 6: 596. https://doi.org/10.3390/agriculture15060596

APA Style

Li, F., Meng, X., Zhu, K., Yan, J., Liu, L., & Liu, P. (2025). Research on Ginger Price Prediction Model Based on Deep Learning. Agriculture, 15(6), 596. https://doi.org/10.3390/agriculture15060596

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop