Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 Predictive Analysis of Raw Material Stock at Puri Food and Healthy, an SME. Using the Long ShortTerm Memory (LSTM) Method Palma Juanta. Pery Chandria Bangun. Muhammad Fachrul Nizam. Department of Information System. Faculty of Science and Technology. , . , . Universitas Prima Indonesia Medan. Indonesia palmajuanta@unprimdn. , ferybangun444@gmail. , fahrolnizam63@gmail. AbstractAi Micro. Small, and Medium Enterprises play a vital role in the Indonesian economy, yet face significant challenges in managing raw material inventories, particularly for perishable commodities such as coconut sap . This study applies and optimizes the Long Short-Term Memory (LSTM) method to predict raw material stock levels for coconut sap at Puri Food and Healthy, an SME, using five years of daily historical data (January 1, 2020AeDecember 31, 2024. 2,191 entrie. A descriptive and experimental quantitative approach was employed to develop a deep learning-based predictive model, with data obtained through inventory documentation and interviews with SME managers. The research process encompassed data preparation, collection, normalization. LSTM model construction using Python and TensorFlow in Google Colab, and evaluation using Root Mean Square Error (RMSE). Mean Absolute Error (MAE), and RA Score. Results show the model achieved an MAE of 5. 31 and an RMSE of 6. 94, indicating moderate prediction error. However, the RA value of 0. 0711 suggests very low explanatory power, potentially due to underfitting or data limitations. Notably, multistep forecasting was applied to generate projections for 2026Ae2027 despite having historical data only through 2024, with these extended forecasts intended as experimental. The model successfully learned seasonal patterns but requires further optimization to improve predictive accuracy. This study advances AI-based inventory management for SMEs, supporting operational efficiency, waste reduction, and risk mitigation in raw material supply chains. KeywordsAi Stock Prediction. SME. LSTM. Nira. Deep Learning INTRODUCTION Indonesia's economy is built upon micro, small, and medium-sized businesses, which employ over 97% of the labor force and account for more than 60% of the country's GDP . Despite their vital role. SMEs continue to struggle with supply chain and inventory management issues, including demand fluctuations, supply delays, insufficient storage space, and financial constraints . Inventory management is even more crucial for commodities like coconut sap . , which are prone to rapid deterioration in quality and economic value. Because it is seasonal, extremely perishable, and susceptible to storage conditions. Nira needs predictive methods that can respond to time-dependent trends . A stock management system that can anticipate changes in the demand for raw materials is necessary for Nira processing SME, such as Puri Food and Healthy. Because it still relies on manual inventory recording. Puri Food and Healthy, an SME that processes nira into palm sugar products, has a slow decision-making process . Digitizing inventory systems may improve operational efficiency and logistics . Predictive approaches, such as the LSTM model, are well-suited for these situations because they can learn temporal patterns from historical data . This approach has been used extensively across a variety of forecasting scenarios, including predicting the number of SMEs . , the prices of agricultural commodities . , the price of crude oil . , and the supply of food products like Sari Roti . Kusuma et al. 's study demonstrated that LSTM can forecast bread product inventories with an MAPE accuracy of less than 10% . Additionally. Susilo et al. found that LSTM performed well in logistics distribution, achieving a MAPE of This reinforces LSTM's status as an adaptable model for handling complex time-series data, such as raw material stock data. The adoption of AI in micro-scale SMEs remains low . , and traditional techniques such as decision tree algorithms struggle to detect complex patterns . As a result, the goal of this study is to develop and refine an LSTM-based model for predicting NIRA stock levels at Puri Food and Healthy, assess its performance using MAE. RMSE, and R2, and investigate its potential to enhance inventory management The purpose of this research is to apply and improve the model for predicting Nira raw material inventories at Puri Food and Healthy SME by evaluating it using a range of performance indicators, including Root Mean Square Error (RMSE). Mean Absolute Error (MAE), and R2 Score. Given its extreme perishability and seasonality. Nira needs a predictive strategy that can account for time-based dynamic trends . As a result, this study not only addresses the practical needs of SMEs but also advances the use of deep learning in the management of SME supply chains. p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2025 Submitted: July 2, 2025. Revised: August 5, 2025. Accepted: August 16, 2025. Published : October 15, 2025 Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 II. RESEARCH METHODOLOGY This study falls under the quantitative research category and employs both descriptive and experimental approaches. In Puri Food and Healthy SME, the current state of affairs about the management of nira raw material inventories is described using the descriptive method. Using the Long-Short Term Memory technique, the experimental approach is used to create and evaluate a prediction model for nira raw material inventories. Since the purpose of this sort of study is to identify viable remedies for the issue of controlling nira raw material inventories at Puri Food and Healthy SME, it is applicative. The study's population consists of Puri Food and Healthy SMEs, businesses in the food and beverage sector that use natural raw materials, particularly nira as their primary The study's sample was selected using the purposive sampling method, with specific criteria. The sample selection criteria include SME that uses nira as its primary raw material, produces food and drinks that are made with natural ingredients, keeps thorough historical records of its raw material inventories, and is prepared to take part in interviews and surveys. Because they satisfy all these requirements and have a stock recording system that can be analyzed using the LSTM technique. Puri Food and Healthy SME are used as the primary sample in this study. The study started by identifying and gathering historical information on Nira stocks, creating questionnaires, and making technical preparations. Quantitative data was collected through documentation, whereas qualitative data was collected through interviews and surveys with SME managers. The information was then processed and analyzed using the LSTM prediction model. A final report, which included analysis, results, and research recommendations, was then used to evaluate the predictive outcomes and determine the model's Data Preparation The first step in the research preparation phase is to identify issues and gather historical information pertaining to nira raw material stocks at Puri Food and Healthy SME in order to serve as a basis for analysis. The purpose of this stage is to determine the pattern of stock availability and any challenges that may arise in its management. Additionally, interview schedules were created to delve further into the stock recording and management process, and research tools, such as questionnaires, were developed to gather corroborating data from SME managers. Data Collection Quantitative data collection was conducted during the data collection phase, with historical records of Nira raw material inventories from Puri Food and Healthy SME serving as the primary basis for predictive analysis. Additionally, comprehensive interviews with SME managers and employees were conducted to collect qualitative data on operational practices, inventory management techniques, and issues Figure 1. Flowchart of Nira Raw Material Stock Prediction p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2025 Submitted: July 2, 2025. Revised: August 5, 2025. Accepted: August 16, 2025. Published : October 15, 2025 Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 TABLE 1. DATASET Date Stock 2020-01-01 2020-01-02 2020-01-03 2020-01-04 2020-01-05 2020-01-06 2020-01-07 2020-01-08 2020-01-09 2020-01-10 2020-01-11 2020-01-12 2020-01-13 2020-01-14 2020-01-15 2020-01-16 2020-01-17 2020-01-18 2020-01-19 2020-01-20 2020-01-21 a 2024-12-31 a A sample of historical daily stock data from January 1, 2020, to December 31, 2024, is shown in Table 1. The dataset consists of two columns: 'date', which shows the time the recording was made, and 'stock', which shows the amount of stock for that day. This information serves as the basis for analysis and predictive modeling in the LSTM method. The Dataset Description and Statistical Distribution utilized in this research are explained below. Data Type and Time Period A The data used is daily time series data on raw material stock at Puri Food and Healthy. A Observation period: January 1, 2020 Ae December 31, 2024 . otal of 2,191 entrie. A Available variables: A date . ate of recordin. A stock . tock quantity on that day, in units/piece. Stock Value Distribution per Year A 2020: Initial production fluctuations with seasonal trends following the harvest period. A 2021: Tended to be stable around the previous year's A 2022: The lowest stock quantity recorded, totaling 11,794 units. 2023: Highest stock level recorded, totaling 13,587 A 2024: Experienced a slight decrease compared to the previous year, totaling 13,364 units. Seasonal Pattern A A seasonal pattern is evident, where stock increases during specific periods . ikely the harvest seaso. and decreases during periods outside the harvest season. A These fluctuations are consistent every year, indicating the presence of periodic factors that influence stock levels. Daily Distribution and Data Dispersion A Daily stock values fall within a specific range . between 20Ae80 units per day when divided into incoming/outgoing stoc. A The distribution shows significant peak seasons and off-seasons. Data Quality A There are no missing values, so the data is suitable for modeling after normalization. A The date format is consistent . , and stock values are integers. Data Processing and Analysis To ensure data quality and readiness for computational analysis during the data processing and analysis phase, all acquired data undergo cleaning, normalization, and coding. After the historical data on prepared nira raw material stocks has been properly organized, a predictive model based on LSTM is created and trained. To produce accurate stock predictions and support sound inventory management in SMEs, this model analyzes seasonal trends and data patterns. Data Evaluation To assess the LSTM model's accuracy and capacity to predict NIRA raw material stocks, the evaluation phase includes a comprehensive examination of its predictions. Performance measures such as RMSE. MAE, and R2 Score are used to evaluate how well anticipated values and actual data match up. In addition, a comprehensive data analysis is performed at this stage, the main conclusions of the study findings are presented, and strategic recommendations are made that SMEs can use in data-based stock management. RESULTS AND DISCUSSION At this point, the findings of the data analysis are presented, along with a discussion of the research's conclusions. The outcomes presented here include the model training method, an evaluation of its predictive accuracy, and an interpretation of the analyzed data. The discussion aims to determine the accuracy of the LSTM model in predicting the quantity of sap raw materials and the implications of these predictions for inventory management at Puri Food and Healthy SME. Data Normalization Before inputting the data into the LSTM model, several preprocessing steps are performed. The initial step is data p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2025 Submitted: July 2, 2025. Revised: August 5, 2025. Accepted: August 16, 2025. Published : October 15, 2025 Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 cleaning, which involves eliminating missing values and correcting data replication. Figure 2. Data Normalization The figure above shows that the data is normalized using the MinMaxScaler method to ensure all values fall between 0 and 1, which helps speed up the training process and avoid the dominance of high values. Following this, the data is transformed into a windowed dataset, also known as a sliding This research employs a two-layer, sequential LSTM model With the parameter return_sequences=True, the first layer uses 64 memory units, allowing the output of the entire time step to be sent to the next layer. The second layer has 32 LSTM units without return sequences. The model is then finished with a single-neuron dense output layer that produces a single prediction. The model was constructed using the Mean Squared Error (MSE) loss function and Adam's optimizer. Model Training Data Sharing and Training For ease of data sharing, the historical raw material stock data is split into training data . raining dat. and testing data . esting dat. The purpose of this division is to train the prediction model on a subset of the data and then test its accuracy on previously unseen data. Figure 3. Data Sharing and Training The data is divided in this investigation with a ratio of 80% for training and 20% for testing, as shown in the diagram above. Since the data are a time series, the division procedure is performed without randomization . huffle=Fals. to preserve the data's chronological order. It's crucial to prevent data leakage and ensure the model learns from historical trends in a logical, time-ordered manner, as they occur in the real world. Model Architecture The LSTM model was built in Google Colab using Python. TensorFlow, and Keras. Figure 6. Model Training The model was trained for 30 epochs with a batch size of 16 using the model. fit() function using training data (X_train, y_trai. and validation data (X_test, y_tes. The loss . rror on the training dat. and val_loss . rror on the validation dat. were recorded at each epoch during training. The val_loss ranged from 0. 0051 to 0. 0054, while the loss values ranged 0033 to 0. 0043, according to the training results. The somewhat consistent loss and val_loss values demonstrate the model's ability to learn from the training data without becoming overly overfitted. Consequently, the model can anticipate outcomes and accurately understand data patterns. Figure 4. Import Library The Adam optimizer, which is frequently used for time series data due to its rapid convergence, and the Mean Squared Error (MSE) loss function were used to train the model and prevent overfitting. Additionally, a dropout layer with a dropout value of 0. 2 was included. Figure 5. Model Architecture p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2025 Submitted: July 2, 2025. Revised: August 5, 2025. Accepted: August 16, 2025. Published : October 15, 2025 Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 is of numeric type . Because there are no missing values, all data is thoroughly captured, making it appropriate for usage in the pre-processing and predictive modeling phases. Loss Training Model Figure 9. Displaying Data Per Year Figure 7. Loss Training Model The progression of the error values on the training and validation data throughout the training process can be observed by visualizing the loss graph. Based on the comparison between loss and val_loss, this graph shows that the model undergoes a steady learning process and helps identify possible over- or Load and Display Data Based on the results of the recapitulation of the total stock of nira raw materials at Puri Food and Healthy SME during the period 2020 to 2024, there are fluctuations in the amount of stock each year. The year 2023 recorded the highest total stock of 13,587 units, followed by 2024 with 13,364 units. Meanwhile, the lowest stock amount occurred in 2022 at 11,794 This annual variation may be related to dynamics in the production and distribution of raw materials, as suggested in previous studies . , which indicate that factors such as weather conditions, harvest patterns, and market demand often influence the availability of perishable commodities like nira. To make sound strategic decisions, particularly in future stock planning and supply chain management, it is essential to build on these findings. Model Evaluation Figure 10. Model Evaluation Figure 8. Displaying Data Per Day This analysis is based on a dataset of 2,191 records that capture daily information on the stock of Nira raw materials at Puri Food and Healthy SME from January 1, 2020, to December 31, 2024. There are two variables in this dataset: 'date,' which is of object data type . , and 'stock,' which The model is evaluated using three indicators: the Mean Absolute Error (MAE), the Root Mean Squared Error (RMSE), and the R-squared (R. The model's average prediction error against actual data is shown with an RMSE of 6. 94 and an MAE On the other hand, the model's R2 value of 0. indicates that it still has a limited ability to account for the variability in the target data. p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2025 Submitted: July 2, 2025. Revised: August 5, 2025. Accepted: August 16, 2025. Published : October 15, 2025 Jurnal SISFOKOM (Sistem Informasi dan Kompute. Volume 14. Nomor 04. PP 461-466 Visualization of Prediction Results Visualization is used to compare the model's predictions to the real data. The resulting graph shows that the LSTM model's predictions closely match the actual data trends. Seasonal trends, such an increase in inventory in certain months and a decline during times of reduced demand, were accurately predicted by the model. This further supports the model's capacity to both reflect historical trends and use them to forecast future values. Square Error (RMSE) of 6. 94 and a Mean Absolute Error (MAE) of 5. The model's relatively low R2 value of 0. however, indicates that it still cannot fully account for and explain the data's variation. This might be attributed to limited predictive features, the omission of external variables . uch as weather conditions, harvest cycles, and market deman. , potential underfitting of the model architecture, and the use of multi-step forecasting, which can exacerbate cumulative prediction errors. Additionally, implementing this forecasting model can support more efficient procurement planning, optimize inventory management, and help minimize financial losses from raw material waste, with the highest predicted stock in 2027 at 11,252 pcs and the lowest in 2026 at 9,211 pcs. REFERENCES