Comparative Mathematical Modeling of Coffee Shelf-Life Using Linear Regression and Ensemble Learning under Simulated Storage Conditions

  • Lingga Gita Dwikasari Universitas Mataram
  • Dilla Afriansyah Universitas Mataram
Keywords: Coffee shelf-life, mathematical modeling, multiple linear regression, random forest regression, gradient boosting regression

Abstract

management. However, comparative studies evaluating interpretable statistical models and ensemble learning algorithms for coffee shelf-life prediction remain limited, particularly using simulation-based datasets. This study compared the predictive performance of Multiple Linear Regression (MLR), Random Forest Regression (RFR), and Gradient Boosting Regression (GBR) using a simulation-based dataset of 400 observations representing realistic storage conditions. Model performance was evaluated using Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and the coefficient of determination (R²). MLR achieved the best performance with the lowest MAE (10.01 days), the lowest RMSE (12.55 days), and the highest R² (0.8649), outperforming both ensemble learning models. Feature importance analysis consistently identified storage temperature as the most influential predictor of coffee shelf-life. These findings demonstrate that increased model complexity does not necessarily improve predictive accuracy and support the use of simulation-based datasets for developing predictive models prior to validation with experimental data.

References

Alessandro Del Nobile, M., & Conte, A. (2023). Secondary Shelf Life of Foods: State of the Art and Future Perspective. Food Engineering Reviews, 15(4), 748–762. https://doi.org/10.1007/s12393-023-09360-4

Angeloni, S., Giacomini, J., Maponi, P., Perticarini, A., Vittori, S., Cognigni, L., & Fioretti, L. (2023). Computer Percolation Models for Espresso Coffee: State of the Art, Results and Future Perspectives. Applied Sciences, 13(4), 2688. https://doi.org/10.3390/app13042688

Aung Moon, S., Wongsakul, S., Kitazawa, H., Kittiwachana, S., & Saengrayap, R. (2024). Application of ATR-FTIR for Green Arabica Bean Shelf-Life Determination in Accelerated Storage. Foods, 13(15), 2331. https://doi.org/10.3390/foods13152331

Ayinde, A. S., Yu, H., & Wu, K. (2023). Sea level variability and modeling in the Gulf of Guinea using supervised machine learning. Scientific Reports, 13(1), 21318. https://doi.org/10.1038/s41598-023-48624-1

Bahamón-Monje, A. F., Collazos-Escobar, G. A., & Gutiérrez-Guzmán, N. (2026). Data-driven modeling of water adsorption isotherms in cocoa beans: Dataset and Python-based Machine Learning tools for multivariate analysis and storage management. Data in Brief, 65, 112616. https://doi.org/10.1016/j.dib.2026.112616

Camur, M. C., Ravi, S. K., & Saleh, S. (2024). Enhancing supply chain resilience: A machine learning approach for predicting product availability dates under disruption. Expert Systems with Applications, 247, 123226. https://doi.org/10.1016/j.eswa.2024.123226

Che, C., Hu, H., Zhao, X., Li, S., & Lin, Q. (2023). Advancing Cancer Document Classification with R andom Forest. Academic Journal of Science and Technology, 8(1), 278–280. https://doi.org/10.54097/ajst.v8i1.14333

Collazos-Escobar, G. A., Gutiérrez-Guzmán, N., Váquiro, H. A., García-Pérez, J. V., & Cárcel, J. A. (2025). Analysis of Machine Learning Algorithms for the Computer Simulation of Moisture Sorption Isotherms of Coffee Beans. Food and Bioprocess Technology, 18(6), 5419–5430. https://doi.org/10.1007/s11947-025-03785-x

Collazos-Escobar, G. A., Hurtado-Cortés, V., Bahamón-Monje, A. F., & Gutiérrez-Guzmán, N. (2025). Mathematical modeling of water sorption isotherms in specialty coffee beans processed by wet and semidry postharvest methods. Scientific Reports, 15(1), 3898. https://doi.org/10.1038/s41598-024-83702-y

Crowell, H. L., Morillo Leonardo, S. X., Soneson, C., & Robinson, M. D. (2023). The shaky foundations of simulating single-cell RNA sequencing data. Genome Biology, 24(1), 62. https://doi.org/10.1186/s13059-023-02904-1

Cueva Ríos, M. A., Fernández Rosillo, F., Quiñones Huatangari, L., & Milagros Cabrejos Barrios, E. (2023). Estimation of coffee shelf life under accelerated storage conditions using mathematical models - Systematic review. Czech Journal of Food Sciences, 41(2), 92–102. https://doi.org/10.17221/163/2022-CJFS

Cui, F., Zheng, S., Wang, D., Tan, X., Li, Q., Li, J., & Li, T. (2023). Recent advances in shelf life prediction models for monitoring food quality. Comprehensive Reviews in Food Science and Food Safety, 22(2), 1257–1284. https://doi.org/10.1111/1541-4337.13110

Feitosa, R. M., Figueirêdo, R. M. F. de, Queiroz, A. J. de M., Silva, R. C. da, Oliveira, E. N. A. de, & Moreira, I. D. S. (2020). Evaluation of Lyophilized Myrtle Pulp Powder Stability During Storage. Journal of Agricultural Studies, 8(1), 138. https://doi.org/10.5296/jas.v8i1.15447

Guo, W., Sun, Z., Vilsen, S. B., Meng, J., & Stroe, D. I. (2022). Review of “grey box” lifetime modeling for lithium-ion battery: Combining physics and data-driven methods. Journal of Energy Storage, 56, 105992. https://doi.org/10.1016/j.est.2022.105992

Guo, X., Harbers, C. J., Heuer, H. E. J. M., Min, Q., Liu, Y., Woltering, E. J., Marcelis, L. F. M., & van der Sman, R. G. M. (2026). A generic scientific machine learning framework for fruit and vegetable quality prediction. Postharvest Biology and Technology, 234, 114103. https://doi.org/10.1016/j.postharvbio.2025.114103

Herron, C. B., Garner, L. J., Siddique, A., Huang, T.-S., Campbell, J. C., Rao, S., & Morey, A. (2022). Building “First Expire, First Out” models to predict food losses at retail due to cold chain disruption in the last mile. Frontiers in Sustainable Food Systems, 6. https://doi.org/10.3389/fsufs.2022.1018807

Ibrahim Garba, A. (2023). Food Preservation Packaging. In Food Processing and Packaging Technologies - Recent Advances. IntechOpen. https://doi.org/10.5772/intechopen.110043

Jain, K., Kaushik, K., Gupta, S. K., Mahajan, S., & Kadry, S. (2023). Machine learning-based predictive modelling for the enhancement of wine quality. Scientific Reports, 13(1), 17042. https://doi.org/10.1038/s41598-023-44111-9

Kalule, R., Abderrahmane, H. A., Alameri, W., & Sassi, M. (2023). Stacked ensemble machine learning for porosity and absolute permeability prediction of carbonate rock plugs. Scientific Reports, 13(1), 9855. https://doi.org/10.1038/s41598-023-36096-2

Kam, Y. F., Noor Hasnan, N. Z., Abd Ghani @ Hashim, N. H., Jahari, M., Mohd Basri, M. S., & Kamarudin, K. (2026). Analysis of Quality Loss in The Roasted Coffee Bean Storage and Improvement Based on Internet of Things (IoT). Advances in Agricultural and Food Research Journal, 7(1). https://doi.org/10.36877/aafrj.a0000547

Kurt, O. (2024). Model-based prediction of water levels for the Great Lakes: a comparative analysis. Earth Science Informatics, 17(4), 3333–3349. https://doi.org/10.1007/s12145-024-01341-3

Kutty, A. A., Wakjira, T. G., Kucukvar, M., Abdella, G. M., & Onat, N. C. (2022). Urban resilience and livability performance of European smart cities: A novel machine learning approach. Journal of Cleaner Production, 378, 134203. https://doi.org/10.1016/j.jclepro.2022.134203

Landschaft, A., Abdelmoity, L., Chafjiri, F. M. A., Puckett, M. A., Gettings, J., & Loddenkemper, T. (2025). Clinician-in-the-loop screening saturation: predicting annotation yield for efficient EHR review. BMC Medical Informatics and Decision Making, 25(1), 404. https://doi.org/10.1186/s12911-025-03241-y

Lin, Y., Ma, J., Wang, Q., & Sun, D.-W. (2023). Applications of machine learning techniques for enhancing nondestructive food quality and safety detection. Critical Reviews in Food Science and Nutrition, 63(12), 1649–1669. https://doi.org/10.1080/10408398.2022.2131725

Lopriore, M., Alongi, M., Valentino, M., Anese, M., & Nicoli, M. C. (2025). Impact of Environmental Humidity on Instant Coffee Stability: Defining Moisture Thresholds for Quality Degradation and Shelf Life Prediction. Foods, 14(10), 1826. https://doi.org/10.3390/foods14101826

Mandal, P. P., Rezaee, R., & Emelyanova, I. (2021). Ensemble Learning for Predicting TOC from Well-Logs of the Unconventional Goldwyer Shale. Energies, 15(1), 216. https://doi.org/10.3390/en15010216

Miller, A., Panneerselvam, J., & Liu, L. (2022). A review of regression and classification techniques for analysis of common and rare variants and gene-environmental factors. Neurocomputing, 489, 466–485. https://doi.org/10.1016/j.neucom.2021.08.150

Ngusie, H. S., Mengiste, S. A., Zemariam, A. B., Molla, B., Tesfa, G. A., Seboka, B. T., Alene, T. D., & Sun, J. (2024). Predicting adverse birth outcome among childbearing women in Sub-Saharan Africa: employing innovative machine learning techniques. BMC Public Health, 24(1), 2029. https://doi.org/10.1186/s12889-024-19566-8

Rosati, R., Romeo, L., Cecchini, G., Tonetto, F., Viti, P., Mancini, A., & Frontoni, E. (2023). From knowledge-based to big data analytic model: a novel IoT and machine learning based decision support system for predictive maintenance in Industry 4.0. Journal of Intelligent Manufacturing, 34(1), 107–121. https://doi.org/10.1007/s10845-022-01960-x

Rosillo, F. F., Ríos, M. A. C., Huatangari, L. Q., & Lalangui, C. G. S. (2023). Shelf-Life Prediction of Specialty Coffees using the Arrhenius Model. OnLine Journal of Biological Sciences, 23(1), 17–24. https://doi.org/10.3844/ojbsci.2023.17.24

Sachs, J. D., Cordes, K., Rising, J., Toledano, P., & Maennling, N. (2019). Ensuring Economic Viability and Sustainability of Coffee Production. SSRN Electronic Journal. https://doi.org/10.2139/ssrn.3660936

Smrke, S., Adam, J., Mühlemann, S., Lantz, I., & Yeretzian, C. (2022). Effects of different coffee storage methods on coffee freshness after opening of packages. Food Packaging and Shelf Life, 33, 100893. https://doi.org/10.1016/j.fpsl.2022.100893

Terven, J., Cordova-Esparza, D.-M., Romero-González, J.-A., Ramírez-Pedraza, A., & Chávez-Urbiola, E. A. (2025). A comprehensive survey of loss functions and metrics in deep learning. Artificial Intelligence Review, 58(7), 195. https://doi.org/10.1007/s10462-025-11198-7

Thelen, A., Huan, X., Paulson, N., Onori, S., Hu, Z., & Hu, C. (2024). Probabilistic machine learning for battery health diagnostics and prognostics—review and perspectives. Npj Materials Sustainability, 2(1), 14. https://doi.org/10.1038/s44296-024-00011-1

Wang, S., Takyi-Aninakwa, P., Jin, S., Yu, C., Fernandez, C., & Stroe, D.-I. (2022). An improved feedforward-long short-term memory modeling method for the whole-life-cycle state of charge prediction of lithium-ion batteries considering current-voltage-temperature variation. Energy, 254, 124224. https://doi.org/10.1016/j.energy.2022.124224

Wang, X., Bouzembrak, Y., Lansink, A. O., & van der Fels‐Klerx, H. J. (2022). Application of machine learning to the monitoring and prediction of food safety: A review. Comprehensive Reviews in Food Science and Food Safety, 21(1), 416–434. https://doi.org/10.1111/1541-4337.12868

Zhou, Z., Qiu, C., & Zhang, Y. (2023). A comparative analysis of linear regression, neural networks and random forest regression for predicting air ozone employing soft sensor models. Scientific Reports, 13(1), 22420. https://doi.org/10.1038/s41598-023-49899-0

Published
2026-06-29
Section
Articles