LSTM AND GRU IN RICE PREDICTION FOR FOOD SECURITY IN INDONESIA
Abstract
Hunger in Indonesia remains a serious challenge, especially in the face of food price instability, particularly rice as the main staple food. In order to achieve SDG 2 “Zero Hunger” by 2030, policies that support price stability and more effective food distribution are needed. This study aims to assess the predictive power of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) models for Indonesian rice prices. The dataset, consisting of 1,424 observations from early 2021 to late 2024, was collected from official sources and preprocessed using normalization techniques. The data was then divided into training, validation, and testing sets. Each model was trained and evaluated using Root Mean Square Error (RMSE) and Mean Absolute Percentage Error (MAPE) metrics. LSTM, a type of Recurrent Neural Network (RNN), uses three gates and cell memory to identify long-term patterns in time series data. GRU, with a simpler structure involving only two gates, is more efficient in modeling temporal relationships. The results show that the LSTM model achieved MAPE 3.49%, while the GRU model outperformed it with MAPE 1.08%. Overall, the GRU model demonstrated higher accuracy in forecasting rice prices.
Downloads
References
Wulan Arifin, Ilma Sarimustaqyma Rianse, and Hadi Sudarmo, “ANALISIS FLUKTUASI HARGA BERAS DI TINGKAT PETANI, PEDAGANG, DAN PENGECER DI KOTA KENDARI,” Gabbah: Jurnal Pertanian Dan Perternakan, vol. 2, no. 1, pp. 36–48, Oct. 2024, doi: https://doi.org/10.62017/gabbah.v2i1.2094.
T. Ulussever, H. M. Ertuğrul, S. Kılıç Depren, M. T. Kartal, and Ö. Depren, “ESTIMATION OF IMPACTS OF GLOBAL FACTORS ON WORLD FOOD PRICES: A COMPARISON OF MACHINE LEARNING ALGORITHMS AND TIME SERIES ECONOMETRIC MODELS,” Foods, vol. 12, no. 4, p. 873, Feb. 2023, doi: https://doi.org/10.3390/foods12040873.
C. C. Anderson, M. Denich, A. Warchold, J. P. Kropp, and P. Pradhan, “A SYSTEMS MODEL OF SDG TARGET INFLUENCE ON THE 2030 AGENDA FOR SUSTAINABLE DEVELOPMENT,” Sustain Sci, vol. 17, no. 4, pp. 1459–1472, Jul. 2022, doi: https://doi.org/10.1007/s11625-021-01040-8.
P. Atukunda, W. B. Eide, K. R. Kardel, P. O. Iversen, and A. C. Westerberg, “UNLOCKING THE POTENTIAL FOR ACHIEVEMENT OF THE UN SUSTAINABLE DEVELOPMENT GOAL 2 – ‘ZERO HUNGER’ – IN AFRICA: TARGETS, STRATEGIES, SYNERGIES AND CHALLENGES,” Food Nutr Res, vol. 65, May 2021, doi: https://doi.org/10.29219/fnr.v65.7686.
A. W. Putra, J. Supriatna, R. H. Koestoer, and T. E. B. Soesilo, “DIFFERENCES IN LOCAL RICE PRICE VOLATILITY, CLIMATE, AND MACROECONOMIC DETERMINANTS IN THE INDONESIAN MARKET,” Sustainability, vol. 13, no. 8, p. 4465, Apr. 2021, doi: https://doi.org/10.3390/su13084465.
Rahmat Hidayat and Irawan Wibisonya, “RICE PRICE PREDICTION WITH LONG SHORT-TERM MEMORY (LSTM) NEURAL NETWORK,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 8, no. 5, pp. 658–664, Oct. 2024, doi: https://doi.org/10.29207/resti.v8i5.6041.
A. Hanafiah, Y. Arta, H. O. Nasution, and Y. D. Lestari, “PENERAPAN METODE RECURRENT NEURAL NETWORK DENGAN PENDEKATAN LONG SHORT-TERM MEMORY (LSTM) UNTUK PREDIKSI HARGA SAHAM,” Bulletin of Computer Science Research, vol. 4, no. 1, pp. 27–33, Dec. 2023, doi: https://doi.org/10.47065/bulletincsr.v4i1.321.
M. Abumohsen, A. Y. Owda, and M. Owda, “ELECTRICAL LOAD FORECASTING USING LSTM, GRU, AND RNN ALGORITHMS,” Energies (Basel), vol. 16, no. 5, p. 2283, Feb. 2023, doi: https://doi.org/10.3390/en16052283.
Y. Gao, R. Wang, and E. Zhou, “STOCK PREDICTION BASED ON OPTIMIZED LSTM AND GRU MODELS,” Sci Program, vol. 2021, pp. 1–8, Sep. 2021, doi: https://doi.org/10.1155/2021/4055281.
A. Hanafiah, Y. Arta, H. O. Nasution, and Y. D. Lestari, “PENERAPAN METODE RECURRENT NEURAL NETWORK DENGAN PENDEKATAN LONG SHORT-TERM MEMORY (LSTM) UNTUK PREDIKSI HARGA SAHAM,” Bulletin of Computer Science Research, vol. 4, no. 1, pp. 27–33, Dec. 2023, doi: https://doi.org/10.47065/bulletincsr.v4i1.321.
S. J. Pipin, R. Purba, and H. Kurniawan, “PREDIKSI SAHAM MENGGUNAKAN RECURRENT NEURAL NETWORK (RNN-LSTM) DENGAN OPTIMASI ADAPTIVE MOMENT ESTIMATION,” Journal of Computer System and Informatics (JoSYC), vol. 4, no. 4, pp. 806–815, Aug. 2023, doi: https://doi.org/10.47065/josyc.v4i4.4014.
A. Hanifa, S. A. Fauzan, M. Hikal, and M. B. Ashfiya, “PERBANDINGAN METODE LSTM DAN GRU (RNN) UNTUK KLASIFIKASI BERITA PALSU BERBAHASA INDONESIA,” Dinamika Rekayasa, vol. 17, no. 1, p. 33, Jan. 2021, doi: https://doi.org/10.20884/1.dr.2021.17.1.436.
M. Yang and J. Wang, “ADAPTABILITY OF FINANCIAL TIME SERIES PREDICTION BASED ON BILSTM,” Procedia Comput Sci, vol. 199, pp. 18–25, 2022, doi: https://doi.org/10.1016/j.procs.2022.01.003.
D. I. Puteri, “IMPLEMENTASI LONG SHORT TERM MEMORY (LSTM) DAN BIDIRECTIONAL LONG SHORT TERM MEMORY (BILSTM) DALAM PREDIKSI HARGA SAHAM SYARIAH,” Euler : Jurnal Ilmiah Matematika, Sains dan Teknologi, vol. 11, no. 1, pp. 35–43, May 2023, doi: https://doi.org/10.34312/euler.v11i1.19791.
F. Aksan, Y. Li, V. Suresh, and P. Janik, “CNN-LSTM VS. LSTM-CNN TO PREDICT POWER FLOW DIRECTION: A CASE STUDY OF THE HIGH-VOLTAGE SUBNET OF NORTHEAST GERMANY,” Sensors, vol. 23, no. 2, p. 901, Jan. 2023, doi: https://doi.org/10.3390/s23020901.
D. I. Mulyana, YkhSanur, FikriYadi, Sahroni, and A. S. Sumarsono, “PENERAPAN METODE NEURAL NETWORK DENGAN STRUKTUR BACKPROPAGATION UNTUK MEMPREDIKSI KEBUTUHAN STOK PADA TOKO UMKM PERLENGKAPAN BAYI BABYQU,” Jurnal Indonesia : Manajemen Informatika dan Komunikasi, vol. 4, no. 1, pp. 121–128, Jan. 2023, doi: https://doi.org/10.35870/jimik.v4i1.131.
S. A. Jofipasi, Admi Salma, Dodi Vionanda, and Dina Fitria, “PREDICTION OF BOGOR CITY RAINFALL PARAMETERS USING LONG SHORT TERM MEMORY (LSTM),” UNP Journal of Statistics and Data Science, vol. 1, no. 5, pp. 434–440, Nov. 2023, doi: https://doi.org/10.24036/ujsds/vol1-iss5/110.
J. Cahyani, S. Mujahidin, and T. P. Fiqar, “IMPLEMENTASI METODE LONG SHORT TERM MEMORY (LSTM) UNTUK MEMPREDIKSI HARGA BAHAN POKOK NASIONAL,” Jurnal Sistem dan Teknologi Informasi (JustIN), vol. 11, no. 2, p. 346, Jul. 2023, doi: https://doi.org/10.26418/justin.v11i2.57395.
E. Supriyadi, “PREDIKSI PARAMETER CUACA MENGGUNAKAN DEEP LEARNING LONG-SHOOT TERM MEMORY(LSTM),” Jurnal Meteorologi dan Geofisika, vol. 21, no. 2, p. 55, Jan. 2021, doi: https://doi.org/10.31172/jmg.v21i2.619.
M. D. A. Carnegie and C. Chairani, “PERBANDINGAN LONG SHORT TERM MEMORY (LSTM) DAN GATED RECURRENT UNIT (GRU) UNTUK MEMPREDIKSI CURAH HUJAN,” JURNAL MEDIA INFORMATIKA BUDIDARMA, vol. 7, no. 3, p. 1022, Jul. 2023, doi: https://doi.org/10.30865/mib.v7i3.6213.
Y. Karyadi, “PREDIKSI KUALITAS UDARA DENGAN METODA LSTM, BIDIRECTIONAL LSTM, DAN GRU,” JATISI (Jurnal Teknik Informatika dan Sistem Informasi), vol. 9, no. 1, pp. 671–684, Mar. 2022, doi: https://doi.org/10.35957/jatisi.v9i1.1588.
S. N. Haliza and M. A. Rosid, “DEEP LEARNING STACK ENSEMBLE TO DETECT SARCASM IN NEWS HEADLINE DATASET,” Apr. 06, 2023. doi: https://doi.org/10.21070/ups.689.
J. Chung, C. Gulcehre, K. Cho, and Y. Bengio, “EMPIRICAL EVALUATION OF GATED RECURRENT NEURAL NETWORKS ON SEQUENCE MODELING,” Dec. 2014.
K. Cho et al., “LEARNING PHRASE REPRESENTATIONS USING RNN ENCODER-DECODER FOR STATISTICAL MACHINE TRANSLATION,” Jun. 2014.doi: https://doi.org/10.3115/v1/D14-1179
X. J. Luo et al., “GENETIC ALGORITHM-DETERMINED DEEP FEEDFORWARD NEURAL NETWORK ARCHITECTURE FOR PREDICTING ELECTRICITY CONSUMPTION IN REAL BUILDINGS,” Energy and AI, vol. 2, p. 100015, Nov. 2020, doi: https://doi.org/10.1016/j.egyai.2020.100015.
R. Bakri, S. Inayati, Y. Yuliana, and A. Hanafiah, “PREDIKSI JUMLAH PESERTA BPJS PENERIMA BANTUAN IURAN (PBI) APBN MENGGUNAKAN FUZZY TIME SERIES,” Barekeng: Jurnal Ilmu Matematika dan Terapan, vol. 15, no. 2, pp. 373–384, Jun. 2021, doi: https://doi.org/10.30598/barekengvol15iss2pp373-384.
Copyright (c) 2025 Triyani Hendrawati, Kennedy Marthendra, Brian Riski Jayama Simanjuntak, Anindya Aprilianti Pravitasari

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this Journal agree to the following terms:
- Author retain copyright and grant the journal right of first publication with the work simultaneously licensed under a creative commons attribution license that allow others to share the work within an acknowledgement of the work’s authorship and initial publication of this journal.
- Authors are able to enter into separate, additional contractual arrangement for the non-exclusive distribution of the journal’s published version of the work (e.g. acknowledgement of its initial publication in this journal).
- Authors are permitted and encouraged to post their work online (e.g. in institutional repositories or on their websites) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published works.




1.gif)


