iDairy Forecast : Smart Product Demand Forecasting using SARIMA Model

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

iDairy Forecast : Smart Product Demand Forecasting using SARIMA Model

Ridham Jasani1, Jasmit Bajaria2 , Vedant Deshmukh3, Dolas Keche4, Prof. Priyanka Bhilare5

1,2,3,4, Student, Computer Engineering, Rajiv Gandhi Institute of Technology, Maharashtra, India 5 Assistant professor, Computer Engineering, Rajiv Gandhi Institute of Technology, Maharashtra, India

Abstract - iDairy is an intelligent system developed to enhancetheefficiencyofdairyretailoperationsbyproviding precise demand predictions. It leverages sophisticated algorithms to examine past sales patterns and market dynamics, ensuring optimized inventory control while minimizingsurplus.Theplatformintegratesseamlesslywith GoogleSheetsforlivedata storage,where eachproductis assignedadedicatedsub-sheetforsystematictracking.To account for seasonal demand fluctuations, the Seasonal AutoregressiveIntegratedMovingAverage(SARIMA)model isimplementedforforecasting.iDairyequipsretailerswith valuableinsightstorefinestockmanagementandimprove overall operational effectiveness. This project emphasizes data-driven strategies for optimizing dairy supply chain management.

Key Words: Machine Learning, Demand Forecasting, InventoryManagement,SARIMAModel,DairyRetail,DataDriven Decision Making, Sales Analysis, Natural Language Processing

1.INTRODUCTION

The dairy sector encounters considerable challenges in effectivelymanaginginventoryduetounpredictabledemand fluctuations, seasonal shifts, and the perishable nature of dairy products. Conventional inventory management techniques frequently result in either surplus stock or shortage

s, leading to financial setbacks and inefficiencies in operations. To overcome these obstacles, iDairy has been developedasanAI-poweredsolutionthatemploysMachine Learning(ML)toenhancedemandforecastingandoptimize stockmanagement.

iDairyincorporatestheSeasonalAutoregressiveIntegrated MovingAverage(SARIMA)modeltoanalysepastsalesdata, detect emerging patterns, and provide highly accurate demand projections. This predictive approach empowers retailerstomakeinformed,data-drivendecisions,reducing product wastage while maintaining ideal inventory levels. ThesystemseamlesslyintegrateswithGoogleSheets,where each product is assigned an individual sub-sheet for realtime data storage and monitoring. This structured arrangementimprovesaccessibilityandenablesbusinesses totracksalestrendsefficiently.

ByleveragingAI-drivenanalytics,iDairyseekstoenhance supply chain operations, maximize profitability, and promotesustainabledairyretailpractices.Theprojectaims to revolutionize traditional dairy management by incorporating automation, allowing retailers to sustain balanced stock levels, reduce losses, and improve overall operationalproductivity.

1.1 PROPOSED SYSTEM

TheiDairysystemisdesignedtoimprovedemandforecasting and inventory management in dairy retail operations. The systemutilizeshistoricalsalesdatatopredictfuturedemand, helpingretailersoptimizestocklevelsandreducewastage. The Seasonal Autoregressive Integrated Moving Average (SARIMA) model is used for forecasting, as it captures seasonaltrendsandvariationsinsales.

Keyfeaturesoftheproposedsysteminclude:

 Data Collection & Storage: Sales history is systematicallyrecordedinGoogleSheets,facilitating seamlesstrackingandin-depthanalysis.

 DemandForecastingModel:ASARIMA-drivenmodel predicts upcoming sales trends based on past performanceandseasonaldemandvariations.

 Inventory Optimization: The predicted demand helps retailers maintain balanced stock levels, mitigating risks associated with overstocking and shortages.

ByintegratingiDairy,retailerscanstreamlinesupplychain operations, significantly reduce product wastage, and enhanceoverallefficiency.Thisultimatelyleadstoimproved profitabilityandbetterresourcemanagementindairyretail.

2. LITERATURE SURVEY

Demand forecasting has been extensively researched using both traditional statistical techniques and deep learning approaches. ARIMA (Auto Regressive Integrated Moving Average) is effective for predictions in stable environmentswithminimalfluctuations,makingitsuitable forstationarytime-seriesdata.However,itstruggleswhen dealing with datasets with strong seasonality or complex

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

variations. In contrast, Long Short-Term Memory (LSTM) networksexcelatcapturingnon-lineartrendsandseasonal dependencies, making them better suited for intricate forecastingtasks.Researchindicatesthattrainingmodelson monthlyratherthanweeklydataimprovesaccuracy.Future advancements may explore the integration of attention mechanismsandglobalmodelstofurtherrefineforecasting accuracyandenhanceinventorymanagement,particularlyin sectorslikedairyproduction[1].

TheapplicationofBusinessIntelligence(BI)andMachine Learning(ML)indemandforecastinghasgainedsignificant tractioninrecentyears.Variousapproaches,includingtime series analysis and rule-based models like Deep AR, have been investigated to achieve precise demand predictions. StudieshighlightthatDeepAR-basedforecastingmodelsoffer higheraccuracy,minimizelosses,optimizestocklevels,and enhance operational efficiency, especially as dataset size increases[2].

Recent research hasalso examined time series models, particularly Seasonal ARIMA (SARIMA), for forecasting commodityprices,particularlyessentialgoodslikefruitsand vegetables.Thesemodelsfactorinseasonalfluctuationsand external influences such as weather conditions, transportation expenses, and seed quality. Although these models may not always provide absolute precision, they serve as valuable tools for identifying price trends and formulatingstrategiestoensureaffordability[3].

Demandforecastingremainsacriticalareaofstudyforits role in optimizing inventory management, production planning,andmarketstrategies.Variousstatisticalmodels, especiallyARIMA,havebeenwidelyutilizedfortimeseries forecasting. Studies show that both seasonal and nonseasonalARIMAmodelseffectivelypredictfuturedemandby analyzing historical sales data. Researchers have explored model enhancements by integrating seasonality, external variables, and market trends to boost accuracy. ARIMA’s flexibilityacrossdifferentdatasetsandforecastingscenarios makes it a valuable tool for various industries, offering actionableinsightsfordata-drivendecision-making[4].

Another area where forecasting is heavily researched is stockpriceprediction,whichremainsachallengingtaskdue to market volatility and influencing factors like economic conditions,investorsentiment,andexternalevents.Several studieshaveutilizedARIMAforitssimplicityandefficiency in short-term forecasting. Research suggests that ARIMA deliversreasonableaccuracyforindividualstockslikeICICI Bank and Reliance Industries. However, its performance declinesoverlong-termpredictionsduetotheunpredictable nature of financial markets and the presence of multiple complexesinfluencingvariables[5].

3. SARIMA MODEL

The Seasonal Autoregressive Integrated Moving Average (SARIMA) model is an extension of the ARIMA model specifically designed to handle time-series data with seasonalpatterns.WhileARIMAisprimarilyusedfornonseasonaldata,SARIMAincorporatesseasonalcomponents, allowing it to effectively capture recurring patterns over fixedintervals.

ThegeneralrepresentationofaSARIMAmodelis:

SARIMA(p,d,q)(P,D,Q)s

Where:

p:Theorderofthenon-seasonalautoregressive(AR) component, determining how many past observationsinfluencethecurrentvalue.

d:Thenumberofnon-seasonaldifferencesrequired to make the time series stationary. Stationarity is achievedbysubtractingpreviousobservationsfrom thecurrentone,withdspecifyinghowmanytimes thisisperformed.

 q: The order of the non-seasonal moving average (MA) component, which models the dependency betweenanobservationandthepastforecasterrors.

SeasonalComponentsofSARIMA:

 P: The order of the seasonal autoregressive (SAR) component, capturing relationships between an observationanditspastseasonalvalues(e.g.,sales fromthesamemonthinpreviousyears).

 D: The number of seasonal differences needed to maketheseasonalpatternstationary,similartodbut appliedatseasonalintervals.

 Q:Theorderoftheseasonalmovingaverage(SMA) component, modelling dependencies between an observationandpastseasonalforecasterrors.

 s:Thelengthoftheseasonalcycle,representingthe numberoftimestepsinafullseasonalperiod(e.g.,s =12formonthlydatawithyearlyseasonality,ors=4 forquarterlydata).

KeyComponentsofSARIMA:

 Autoregressive (AR): Represented by p and P, it capturesrelationshipsbetweenanobservationand prior values. Seasonal AR terms use lags based on multiplesofs(e.g.,s=12meansusingdatafrom12 monthsago).

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

 Integrated (I): Represented by d and D, it ensures stationarity by differencing the data (removing trendsandseasonaleffects).

 Moving Average (MA): Represented by q and Q, it accounts for relationships between an observation andpastforecasterrors,eithernon-seasonal(q)or seasonal(Q).

By incorporating these elements, SARIMA becomes a powerful tool for time-series forecasting, especially in industrieslikedairyretail,wheredemandfluctuatesbased onseasonalpatterns.

Thegraphaboverepresentsmilksales(inLiters)overa specific period, showcasing historical sales trends. It highlightsfluctuationsinsales,withperiodicpeaksanddips thatcorrespondtoseasonalvariations,shiftsindemand,or external factors influencing consumption patterns. By analysingthevisualdata,onecanobservehighersalesduring specific months, such as festive seasons or summer, and lowersalesduringotherperiods.

This graphical representation plays a crucial role in identifyingunderlyingtrendsandseasonalityinmilksales. Recognizingthesepatternsisessentialforaccuratedemand forecasting, as it enables businesses to anticipate changes andoptimizeinventorylevels.ModelslikeSARIMAleverage such insights to enhance forecasting precision, ensuring efficientdairyretailmanagement.

Thegivengraphshowcasesmilksales(inlitres)afterthe removal of the underlying trend component. This transformationhelpsinisolatingseasonalfluctuationsand

short-term variations, making it easier to analyse sales patternsindependentoflong-termtrends.Byeliminatingthe trend, the graph highlights periodic changes in milk sales overtime,allowingforaclearerunderstandingofseasonal behaviourandcyclicaldemandshifts.

The trend component, which represents long-term growthordecline,wasremovedusingdifferencingorother de-trending techniques.As a result, the graph displays the residual or detrended data, emphasizing short-term deviationsinsales.Thesefluctuationsmaybeinfluencedby factorssuchasholidays,promotionalactivities,orweather conditions.

Thisdetrendedseriesisessentialforfurtherforecasting andanalysis,asitoffersamorepreciserepresentationoftrue seasonal patterns in milk sales, free from long-term influences. Studying this refined dataset is critical for developing models like SARIMA, which leverage seasonal trends and short-term variations to make accurate sales predictions.

Fig.3SARIMAModelPredictions

The graph above illustrates the forecasted milk sales (in litres)generatedbytheSARIMAmodeloveradefinedperiod. Thex-axisrepresentsthetimeintervals(e.g.,months),while the y-axis indicates the predicted sales volume. The graph primarilyconsistsoftwoelements:

 Historical Sales Data: The actual recorded sales, depicted as a continuous line connecting observed datapointsovertime.

 Forecasted Values: The predicted sales figures, represented by a separate line derived from the SARIMA model. This forecasted line is based on patterns identified inpastdata,incorporating both seasonalandnon-seasonalcomponents.

Thepredictedlineeffectivelymirrorstherecurringtrends andfluctuationsseeninhistoricalsales,demonstratingthe model’s ability to capture both short-term variations and long-term trends. The accuracy of these predictions is reflected in how closely the forecasted values align with actualsalesfigures,validatingthemodel’seffectivenessin recognizingseasonalpatterns.Anydiscrepanciesbetween observed and predicted values could point to forecasting

Fig.1MilkSales(Dataset)
Fig.2MilkSales(Afterremovingtrends)

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

errors or unforeseen factors such as shifts in consumer demand, supply chain disruptions, or external market influences.Thisgraphservesasacrucialtoolforevaluating theSARIMAmodel’sperformance,providinginsightsthataid ininventoryoptimization,demandforecasting,andstrategic businessplanningfordairyretailers.

Fig.5SARIMAXResults

TheresultssummaryfromtheSARIMAmodelprovideskey performance metrics that assess its accuracy, complexity, and suitability for forecasting. The Akaike Information Criterion (AIC) evaluates the model’s fit by balancing goodness-of-fitandcomplexity,withlowervaluesindicating a better model. The Bayesian Information Criterion (BIC) functionssimilarlybutpenalizesmorecomplexmodelsmore heavily to aid in optimal selection. The Hannan-Quinn Information Criterion (HQIC) serves as a middle ground betweenAICandBIC.TheProb(H)valuerepresentsthepvaluefortestingwhetherthemodel’sresidualsexhibitwhite noisebehavior,ensuringrandomnessinpredictionerrors. Theskewmetricevaluatestheasymmetryoftheresiduals’ distribution, indicating potential bias, while kurtosis measures the tailedness of the residual distribution, with highervaluessuggestingthepresenceofextremevariations. The Prob(JB) value, derived from the Jarque-Bera test, determines whether the residuals follow a normal distribution,whichiscrucialforreliableforecasting.These statistical indicators play a vital role in validating the SARIMA model, ensuring it effectively captures seasonal trendswhilemaintainingawell-distributederrorstructure.

3.1 ACF

The Autocorrelation Function (ACF) plot shown above depicts the correlation between milk sales data and its lagged values. It serves as a crucial tool in time series analysis, helping to determine the q parameter, which represents the number of lagged forecast errors in the movingaverage(MA)componentoftheSARIMAmodel.By analysingtheACFplot,patternsinthedata’sdependencies canbeidentified,aidingintheselectionofanappropriate modelforaccuratedemandforecasting.

Fig.6ACFPlot

IntheACFplot,thex-axisdenoteslagvalues,whilethey-axis representstheautocorrelationcoefficient.Significantspikes that extend beyond the confidence interval, usually highlighted by blue-shaded areas, indicate a correlation between the time series and its previous values. These prominentspikesassistinidentifyingtheoptimallagvalue forthemovingaveragecomponent,q.

FromtheACFplot,wecanobservethefollowing:

 Strong autocorrelation is evident in the initial lags, indicatingapatternthatreliesonpastvalues,whichisa typicalcharacteristicoftimeseriesdata.

 Asthelagincreases,thecorrelationgraduallyweakens, signifyingareducedinfluenceofpastvaluesonfuture ones, a pattern the moving average component is designedtocapture.

The observations derived from the ACF plot assist in determining the appropriate q parameter for the SARIMA model.Byanalysingtheplot,Iidentifiedtheoptimalqvalue thateffectivelycapturesthe time-dependentrelationships within the sales data, enhancing the model’s accuracy in predictingfuturemilksales.

3.2 PACF

The Partial Autocorrelation Function (PACF) plot helps identifythekeylagsinatimeseries,assistinginselectingthe autoregressive(AR)termforthemodel.InthePACFplot,the x-axisdenotesthelagvalues,whilethey-axisrepresentsthe partial autocorrelation at each lag. A notable spike at a specific lag signifies a strong correlation between the observations at that lag and the current value, after accountingfortheinfluenceofallprecedinglags.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

Fig.7PACFPlot

FormySARIMAmodel,thePACFplot(depictedintheimage) was examined to determine the suitable order of the autoregressive (AR) component. The point at which the partialautocorrelationvaluesdeclinesharplyservedasthe basisforselectingtheoptimalvalueforp(theautoregressive order). The number of prominent spikes in the PACF plot playedacrucialroleinidentifyingtheappropriatepvalue fortheSARIMAmodel.

ByanalyzingthePACF plot, weestablished the numberof past observations (lags) that have a direct impact on the currentvalue,ultimatelyenhancingthemodel'sprecisionin forecastingfuturemilksales.

3.3 MODEL EVALUATION

Modelevaluationplaysavitalroleinpredictivemodelling,as itallowsforassessingtheaccuracyandefficiencyofamodel. OneofthewidelyusedevaluationmetricsisMAPE(Mean AbsolutePercentageError),whichoffersastraightforward and interpretable measure of forecast accuracy in percentage terms. MAPE is computed by averaging the absolute percentage errors between predicted and actual values,thenmultiplyingby100toexpressitasapercentage. Itismathematicallyrepresentedbythefollowingformula:

Fig. 1. MAPEformula.

2. MAPEResults.

For our model evaluation, the Mean Absolute Percentage Error(MAPE)wascomputedtomeasuretheaccuracyofthe predictions.TheobtainedMAPEvalueof5.8392%signifies that, on average, the model’s forecasts deviate by roughly 5.84%fromtheactualvalues.Thisoutcomeindicatesstrong modelperformance,demonstratingahighlevelofprecision in predicting demand with minimal errors. Generally, a MAPE below 10% is regarded as an indicator of reliable forecasting, making this model well-suited for real-world applicationswhereaccuratedemandestimationisessential.

4. CONCLUSIONS

In summary, the SARIMA (Seasonal Auto Regressive Integrated Moving Average) model has proven to be an effective tool for forecasting milk sales by capturing both seasonalandnon-seasonal patternsinhistoricaldata.The model successfully identifies recurring trends and fluctuations,whichisespeciallycrucialinthedairyindustry, where demand exhibits strong seasonality. By integrating seasonaldifferencing,autoregressive,andmovingaverage components, SARIMA delivers more accurate predictions comparedtosimplerforecastingmethods.

Theforecastedvaluesgeneratedbythemodelcloselyalign with actual sales data, as shown in the visualization, demonstrating its ability to predict both short-term and long-term trends. This predictive capability is highly beneficial for businesses, enabling better inventory management by ensuring optimal stock levels. It helps prevent issues such as overstocking or stock shortages, reducing potential financial losses and improving operationalefficiency.

Despiteitseffectiveness,forecastingremainsacontinuous process.Asnewdatabecomesavailable,theSARIMAmodel should be updated and recalibrated to maintain accuracy and adapt to any evolving patterns or external factors. Additionally,themodel'sperformanceisinfluencedbythe qualityandconsistencyofthehistoricaldataitistrainedon. Regular updates and high-quality data can help minimize errorsandenhanceforecastingprecision.

Overall,theSARIMAmodelservesasavaluableforecasting tool that aids businesses in making data-driven decisions, optimizing inventory management, and improving overall efficiency. With continuous refinement and integration of additionaldata,itcanfurtherenhancestrategicplanningin

Fig.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 05 | April 2025 www.irjet.net p-ISSN: 2395-0072

the dairy sector and other industries requiring accurate demandforecasting.

ACKNOWLEDGEMENT

WeextendourheartfeltgratitudetoProf.PriyankaBhilare for her invaluable guidance, support, and encouragement throughoutthisresearch.Herexpertise,insightfulfeedback, and continuous motivation have played a crucial role in shaping this project. We sincerelyappreciate the timeand effort she dedicated to helping us refine and enhance our work.Hermentorshiphasbeenasourceofinspiration,and wearetrulygratefulforherunwaveringsupport

REFERENCES

[1] A.GanesanandA.Kannan,“StockPricePredictionusing ARIMA Model,” Dept. of Computer Science and Engineering, Sri Chandrasekharendra Saraswathi Viswa Mahavidyalaya, Enathur, Kanchipuram, India.

[2] C. Vithitsoontorn and P. Chongstitvatana, "Demand ForecastinginProductionPlanningforDairyProducts UsingMachineLearningandStatisticalMethod,"2022 InternationalElectricalEngineeringCongress(iEECON), Khon Kaen, Thailand, 2022, pp. 1-4, doi: 10.1109/iEECON53204.2022.9741683

[3] M.A.Khanetal.,"EffectiveDemandForecastingModel UsingBusinessIntelligenceEmpoweredWithMachine Learning," in IEEE Access, vol. 8, pp. 116013-116023, 2020,doi:10.1109/ACCESS.2020.3003790

[4] R. Dharavath and E. Khosla, "Seasonal ARIMA to ForecastFruitsandVegetableAgriculturalPrices,"2019 IEEE International Symposium on Smart Electronic Systems(iSES)(FormerlyiNiS),Rourkela,India,2019, pp.47-52,doi:10.1109/iSES47678.2019.00023

[5] N. Tarannum and S. V. M. S, “A Brief Introduction to Demand Forecasting using ARIMA models,” Dept. of ComputerScience&Engineering,RashtreeyaVidyalaya CollegeofEngineering,Karnataka,India.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.