A Data-Driven Approach Using Recurrent Neural Networks for Material Demand Forecasting in Manufacturing
Abstract
1. Introduction
2. Related Works
3. Theoretical Framework
3.1. Recurrent Neural Networks
3.2. Use of Artificial Neural Networks in Demand Forecasting
3.3. Justification
3.4. Hypothesis
4. Design Methodology
4.1. Data Concentration
- Pandas;
- Numpy;
- Sklearn.preprocessing;
- Tensorflow.
4.2. Mathematical Model of the Neural Network
- Input layer: This layer receives the temporary data streams.
- LSTM layer: The network’s main layer contains Long Short-Term Memory (LSTM) units. LSTM units can remember long-term information and are suitable for modeling temporal sequences.
- Output layer: This layer produces the network output, which in our case is the demand prediction.
- Let be the input vector at time step t, where .
- Let be the hidden state of the LSTM layer at time step t.
- Let be the output of the network at time step t.
- Let be the weight matrices for the input to hidden state, hidden state to hidden state, and hidden state to output connections, respectively.
- Let be the biases for the input layer, hidden layer, and output layer, respectively.
- Let be the weight matrices for the input to hidden state, hidden state to hidden state, and hidden state to output connections, respectively.
- Let be the biases for the input layer, hidden layer, and output layer, respectively.
- is the input gate;
- is the forgetting gate;
- is the output gate;
- is the vector of proposed memory cells at time step t;
- is the vector of memory cells at time step t;
- is the sigmoid function.
4.3. Model Construction
- model.fit(x, y, epochs=50, batch_size=32): This line of code trains the LSTM model using the input data x and the target values y. It specifies that training will be performed for 50 epochs (epochs) with a batch size of 32 (batch_size). During training, the model adjusts its weights and biases to minimize the loss between the predictions and the actual values.
- last_weeks = normalized_demand_data[-time_steps:]: This line selects the last time_steps weeks of the normalized demand data. It is assumed that normalized_demand_data contains the demand time-series.
Algorithm 1 Demand data preprocessing for the LSTM network |
|
- forecast = []: An empty list named forecast is initialized to store the predictions for the next 52 weeks.
- for i in range(52): This loop iterates 52 times, once each week in the upcoming year.
- i_input = np.reshape(last_weeks, (1, time_steps, 1)): Here, the variable last_weeks is reshaped to match the input shape required by the LSTM model. An additional dimension is added to represent the batch size (1) and the feature dimension (1), since the model expects a three-dimensional tensor with shape (batch size, time steps, features).
- prediction = model.predict(i_input)[0, 0]: The trained model is used to predict the demand for the next week using the input i_input. The prediction is extracted from the first element of the first batch of the output tensor.
- forecast.append(prediction): The predicted value is appended to the forecast list.
- last_weeks = np.append(last_weeks[1:], [[prediction]], axis=0): The variable last_weeks is updated by removing the first element and appending the new prediction at the end, simulating the forward movement of one week in the input sequence.
- model = Sequential(): This creates a sequential model in Keras, a linear stack of layers.
- model.add(LSTM(units=50, return_sequences=True, input_shape=(x.shape[1],1))): An LSTM layer with 50 units (or neurons) is added. The parameter return_sequences=True indicates that the layer will return the full sequence output. input_shape=(x.shape[1], 1) defines the expected shape of the input data, where x.shape[1] is the number of time steps and 1 is the number of features per step.
- model.add(LSTM(units=50)): A second LSTM layer is added without return_sequences, so it will output only the final state of the sequence.
- model.add(Dense(units=1)): A dense (fully connected) layer with one unit is added. This is the output layer that generates the prediction.
- model.compile(optimizer=’adam’, loss=’mean_squared_error’): The model is compiled using the Adam optimizer and mean squared error as the loss function. Adam is a widely used optimization algorithm in deep learning, and mean squared error is appropriate for regression tasks such as time-series forecasting.
5. Results
Limitations of Data Scope
6. Discussion
7. Practical Implications
7.1. Scalability for SMEs
7.2. Integration with ERP/MRP Systems
7.3. Tangible Operational Benefits
7.4. Scope Limitations
7.5. Implementation Guidelines
7.6. Limitations and Mitigations
8. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
ANNs | Artificial Neural Networks |
TecNM | Tecnológico Nacional de México |
INAOE | Instituto Nacional de Astrofísica, Óptica y Electrónica |
CIDIT | Centro de Investigación, Desarrollo e Innovación Tecnológica |
LSTM | Long Short-Term Memory |
GRU | Gated Recurrent Unit |
NLP | Natural Language Processing |
MRP | Material Requirements Planning |
CNN | Convolutional Neural Network |
RNN | Recurrent Neural Network |
DEA | Data Envelopment Analysis |
BWM | Best–Worst Method |
SARIMA | Seasonal Autoregressive Integrated Moving Average |
VAR | Vector Autoregressive Model |
LASSO | Least Absolute Shrinkage and Selection Operator |
STL | Seasonal-Trend Decomposition based on Loess |
SVR | Support Vector Regression |
RF | Random Forest |
DNN | Deep Neural Network |
EM | Expectation–Maximization |
ML | Machine Learning |
AI | Artificial Intelligence |
PMNN | Physics-informed Neural Network |
ISA | Instruction Set Architecture |
RISC-V | Reduced Instruction Set Computer—V |
References
- Ye, L.; Xie, N.; Shang, Z.; Boylan, J.E. Data-driven time-varying discrete grey model for demand forecasting. J. Oper. Res. Soc. 2025, 1–17. [Google Scholar] [CrossRef]
- Vijayapriya, R.; Arun, S.L.; Vengatesan, K.; Samee, S. Smart manufacturing supply chain process strategy using intelligent computation techniques. Int. J. Interact. Des. Manuf. (IJIDeM) 2024, 19, 681–694. [Google Scholar] [CrossRef]
- Fatima, S.S.W.; Rahimi, A. A review of time-series forecasting algorithms for industrial manufacturing systems. Machines 2024, 12, 380. [Google Scholar] [CrossRef]
- Kharfan, M.; Chan, V.W.K.; Efendigil, T.F. A data-driven forecasting approach for newly launched seasonal products by leveraging machine-learning approaches. Ann. Oper. Res. 2021, 303, 159–174. [Google Scholar] [CrossRef]
- Lu, R.; Bai, R.; Huang, Y.; Li, Y.; Jiang, J.; Ding, Y. Data-driven real-time price-based demand response for industrial facilities energy management. Appl. Energy 2021, 283, 116291. [Google Scholar] [CrossRef]
- Wei, B. Application of neural network based on multisource information fusion in production cost prediction. Wirel. Commun. Mob. Comput. 2022, 2022, 5170734. [Google Scholar] [CrossRef]
- Granell, P. Redes Neuronales Recurrentes: Una Aplicación para los Mercados Bursátiles. 2018. Available online: http://diposit.ub.edu/dspace/handle/2445/124249 (accessed on 10 February 2024).
- Matsumoto, M.; Komatsu, S. Demand forecasting for production planning in remanufacturing. Int. J. Adv. Manuf. Technol. 2015, 79, 161–175. [Google Scholar] [CrossRef]
- Beinabadi, H.Z.; Baradaran, V.; Komijan, A.R. Sustainable supply chain decision-making in the automotive industry: A data-driven approach. Socio-Econ. Plan. Sci. 2024, 95, 101908. [Google Scholar] [CrossRef]
- Chen, B.; Zhou, J.; Fang, H.; Xu, R.; Qu, W. Forecast of Tobacco Raw Material Demand Based on Combination Prediction Model. Scalable Comput. Pract. Exp. 2025, 26, 540–551. [Google Scholar] [CrossRef]
- Yazdanbakhsh, A. Forecasting trend changes of cement demand in the United States: An exploratory study. Results Eng. 2025, 25, 103859. [Google Scholar] [CrossRef]
- Sousa, M.S.; Loureiro, A.L.D.; Miguéis, V.L. Predicting demand for new products in fashion retailing using censored data. Expert Syst. Appl. 2025, 259, 125313. [Google Scholar] [CrossRef]
- Wang, H.; Zhao, H.; Zhan, Z.; Chen, H.; Li, M. Prediction model of material dynamic mechanical properties embedded with physical mechanism neural network. JOM 2025, 77, 39–49. [Google Scholar] [CrossRef]
- Ghorbani, A.; Nassir, N.; Lavieri, P.S.; Beeramoole, P.B.; Paz, A. Enhanced utility estimation algorithm for discrete choice models in travel demand forecasting. Transportation 2025, 1–28. [Google Scholar] [CrossRef]
- Rivera, F. Arquitectura de Dominio Especifico Para Redes Neuronales Recurrentes Utilizando la isa de risc-v. 2022. Available online: https://repositorio.uchile.cl/bitstream/handle/2250/184830/Arquitectura-de-dominio-especifico-para-redes-neuronales-recurrentes-utilizando-la-ISA-de-RISC-V.pdf?sequence=1&isAllowed=y (accessed on 5 June 2024).
- IBM. ¿Qué Son las Redes Neuronales? 2021. Available online: https://www.ibm.com/mx-es/topics/neural-networks (accessed on 10 June 2024).
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. Available online: https://arxiv.org/pdf/1810.04805.pdf (accessed on 23 September 2024).
- Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I. Language Models are Unsupervised Multitask Learners. 2019. Available online: https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf (accessed on 11 March 2025).
- Redes Neuronales Recurrentes: Explicación Detallada|Codificando Bits. Codificando Bits. 2019. Available online: https://www.codificandobits.com/blog/redes-neuronales-recurrentes-explicacion-detallada/ (accessed on 1 October 2024).
- Lao-León, Y.O.; Rivas-Méndez, A.; Pérez-Pravia, M.C.; Marrero-Delgado, F. Procedimiento para el pronóstico de la demanda mediante redesneuronales artificiales. Cienc. Holguín 2017, 23, 43–59. [Google Scholar]
- Terán-Villanueva, J.D.; Ibarra-Martínez, S.; Laria-Menchaca, J.; Castán-Rocha, J.A.; Treviño-Berrones, M.G.; García-Ruiz, A.H.; Martínez-Infante, J.E. Estudio de redes neuronales para el pronóstico de la demanda de asignaturas. Rev. Fac. De Ing. 2019, 28, 34–43. [Google Scholar] [CrossRef]
- McKinsey Global Institute. Beyond Automation: How Gen AI is Reshaping Supply Chains. 2025. Available online: https://www.mckinsey.com/capabilities/operations/our-insights/beyond-automation-how-gen-ai-is-reshaping-supply-chains (accessed on 20 November 2024).
- Machine Learning Para la Prevision de la Demanda. (S. F.). Available online: https://imperiascm.com/es-es/blog/machine-learning-para-la-prevision-de-la-demanda (accessed on 3 November 2024).
- Bagnato, J.I. Aprende Machine Learning en español (Teoria, Practica); DW Books: Coopell, TX, USA, 2020; ISBN 978-84-09-25816-1. [Google Scholar]
- Hinojosa Gutierrez, A.P. El Lenguaje de Programacion Python, de Principio a Fin; Independently Published: Coopell, TX, USA, 2022; ISBN 9798-8405-6208-6. [Google Scholar]
- Martin del Brio, B.; Sanz, M.A. Redes Neuronales y Sistemas Borrosos, 3rd. ed.; AlfaOmega/RAMA: Madrid, Spain, 2007; ISBN 978-970-15-1258-0. [Google Scholar]
- Raschka, S.; Mirjalili, V. Python Machine Learning; AlfaOmega/Marcombo: Madrid, Spain, 2019; ISBN -978-64-267-2720-6. [Google Scholar]
- Jesús. ¿Por qué usar Python para Machine Learning? Tutoriales Dongee. 2023. Available online: https://www.dongee.com/tutoriales/por-que-usar-python-para-machine-learning/ (accessed on 7 April 2025).
Aspect | Description |
---|---|
Nonlinear modeling | ANNs can capture nonlinear relationships between input and output variables, which is crucial for modeling complex demand dynamics [18]. |
Multivariable input handling | ANNs can process multiple input variables simultaneously, enabling the inclusion of diverse demand-influencing factors such as price, promotions, and economic indicators [16]. |
Adaptability to changing patterns | ANNs can adapt to evolving data patterns over time, accommodating changes due to seasonality, shifting market trends, or consumer behavior [19]. |
Robustness to noise and missing data | ANNs can tolerate noisy and incomplete datasets, maintaining reliable performance even in the presence of real-world data imperfections [20]. |
Temporal dependency modeling | ANNs can learn from time-dependent structures, capturing how past observations influence future demand, which is fundamental for accurate forecasting [21]. |
Sales Per Week | |||
---|---|---|---|
Year | Week Number | Week | Total |
2021 | 1 | Week 1 | 1119 |
2021 | 2 | Week 2 | 1105 |
2021 | 3 | Week 3 | 1020 |
2021 | 4 | Week 4 | 889 |
2021 | 5 | Week 5 | 918 |
Comparative Table of Actual Sales vs. RNA Forecast | |||||
---|---|---|---|---|---|
Week | 2022 | 2023 | Forecast | Diff 2022 | Diff 2023 |
1 | 1100 | 1200 | 1070.63 | 29.37 | 129.37 |
2 | 866 | 972 | 1054.11 | −188.11 | −82.11 |
3 | 946 | 1051 | 1061.75 | −115.75 | −10.75 |
4 | 1222 | 994 | 1061.91 | 160.09 | −67.91 |
5 | 927 | 1107 | 1064.29 | −137.29 | 42.71 |
6 | 1039 | 1058 | 1055.08 | −16.08 | 2.92 |
7 | 1066 | 952 | 1053.30 | 12.70 | −101.30 |
8 | 879 | 988 | 1062.73 | −183.73 | −74.73 |
9 | 964 | 1116 | 1065.73 | −101.73 | 50.27 |
10 | 1211 | 1078 | 1058.22 | 152.78 | 19.78 |
11 | 919 | 939 | 1051.58 | −132.58 | −112.58 |
12 | 1063 | 1045 | 1063.44 | −0.44 | −18.44 |
13 | 1080 | 1011 | 1063.68 | 16.32 | −52.68 |
14 | 989 | 1137 | 1068.76 | −79.76 | 68.24 |
15 | 1141 | 1020 | 1063.00 | 77.99 | −43.00 |
16 | 995 | 1062 | 1069.61 | −74.61 | −7.61 |
17 | 938 | 1100 | 1076.14 | −138.14 | 23.86 |
18 | 945 | 1121 | 1078.74 | −133.74 | 42.26 |
19 | 1187 | 1178 | 1075.58 | 111.42 | 102.42 |
20 | 1055 | 1113 | 1063.94 | −8.94 | 49.06 |
21 | 1175 | 1008 | 1058.46 | 116.54 | −50.46 |
22 | 1033 | 1008 | 1060.43 | −27.43 | −52.43 |
23 | 1034 | 1094 | 1069.08 | −35.08 | 24.92 |
24 | 992 | 1010 | 1065.61 | −73.61 | −55.61 |
25 | 1139 | 1179 | 1073.62 | 65.38 | 105.38 |
26 | 1120 | 1007 | 1059.71 | 60.29 | −52.71 |
27 | 1065 | 1119 | 1065.11 | −0.11 | 53.89 |
28 | 1117 | 955 | 1056.40 | 60.60 | −101.40 |
29 | 1045 | 1108 | 1066.34 | −21.34 | 41.66 |
30 | 1109 | 1000 | 1057.61 | 51.39 | −57.61 |
31 | 1131 | 1093 | 1060.60 | 70.40 | 32.40 |
32 | 969 | 957 | 1055.57 | −86.57 | −98.57 |
33 | 1053 | 1045 | 1067.57 | −14.57 | −22.57 |
34 | 982 | 1073 | 1068.17 | −86.17 | 4.83 |
35 | 1163 | 1147 | 1070.06 | 92.94 | 76.94 |
36 | 1147 | 987 | 1061.50 | 85.50 | −74.50 |
37 | 1251 | 1126 | 1068.63 | 182.37 | 57.37 |
38 | 1011 | 1033 | 1060.05 | −49.05 | −27.05 |
39 | 1091 | 1062 | 1061.00 | 30.00 | 1.00 |
40 | 1090 | 996 | 1062.00 | 27.99 | −66.00 |
41 | 873 | 1061 | 1068.74 | −195.74 | −7.74 |
42 | 1141 | 1128 | 1066.59 | 74.41 | 61.41 |
43 | 996 | 1057 | 1056.34 | −60.34 | 0.66 |
44 | 1049 | 968 | 1046.12 | 2.88 | −78.12 |
45 | 1051 | 997 | 1054.33 | −3.33 | −57.33 |
46 | 1204 | 887 | 1058.07 | 145.93 | −171.07 |
47 | 1146 | 1204 | 1073.70 | 72.30 | 130.30 |
48 | 1042 | 1041 | 1057.76 | −15.76 | −16.76 |
49 | 941 | 1015 | 1050.19 | −109.19 | −35.19 |
Total positive difference | 1699.59 | 1121.66 | |||
Total negative difference | −2089.18 | −1596.25 |
Industry | Acceptable Deviation | Cost of Excess | Renueve Loss Risk |
---|---|---|---|
Automotive | <25% | 15–20% | 30–35% |
Electronics | <30% | 10–18% | 25–40% |
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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Torres, J.A.O.; Santiago, A.M.; García-Martínez, J.R.; López-Zapata, B.Y.; Mijangos López, J.A.; Rincón Zapata, O.J.; Avitia López, J.A. A Data-Driven Approach Using Recurrent Neural Networks for Material Demand Forecasting in Manufacturing. Logistics 2025, 9, 130. https://doi.org/10.3390/logistics9030130
Torres JAO, Santiago AM, García-Martínez JR, López-Zapata BY, Mijangos López JA, Rincón Zapata OJ, Avitia López JA. A Data-Driven Approach Using Recurrent Neural Networks for Material Demand Forecasting in Manufacturing. Logistics. 2025; 9(3):130. https://doi.org/10.3390/logistics9030130
Chicago/Turabian StyleTorres, Jorge Antonio Orozco, Alejandro Medina Santiago, José R. García-Martínez, Betty Yolanda López-Zapata, Jorge Antonio Mijangos López, Oscar Javier Rincón Zapata, and Jesús Alejandro Avitia López. 2025. "A Data-Driven Approach Using Recurrent Neural Networks for Material Demand Forecasting in Manufacturing" Logistics 9, no. 3: 130. https://doi.org/10.3390/logistics9030130
APA StyleTorres, J. A. O., Santiago, A. M., García-Martínez, J. R., López-Zapata, B. Y., Mijangos López, J. A., Rincón Zapata, O. J., & Avitia López, J. A. (2025). A Data-Driven Approach Using Recurrent Neural Networks for Material Demand Forecasting in Manufacturing. Logistics, 9(3), 130. https://doi.org/10.3390/logistics9030130