Trend recognition and forecasting for local food chain

Sathya Krishnan Suresh
8 min readDec 19, 2021

--

-Report by Sathya Krishnan Suresh

A modern food company is a tech company-Ooshma Garg, Founder of Gobble.

PROBLEM STATEMENT:

Identifying the trend in the sales report of a local food chain and predicting
the sales of the food chain. Why this field? A lot of food is being wasted all around the world and a section of the world population is dying of hunger. Many solutions are being suggested to solve this problem. AI is one among them and I strongly believe that AI can contribute a lot to this field. AI can not only solve problems in this field but it can also optimize the techniques that are being used for decades.

BUSINESS NEED ASSESSMENT:

• Many local food chains know that their sales follow a certain trend and know what sort of groceries they need to buy and store during which season. But they do not know it accurately and most of the times they miss one thing or the other.

• Analyzing their datasets and forecasting their sales will enable them to buy grocery, accordingly, prepare the types of dishes that their customers like during a particular time of the year.

• This analysis will cut down their costs and reduce the wastage of food.

• There are lot of food chains in every city. So this is a big market.

  • Properly done, the model can be extended to the whole food industry.

TARGET SPECIFICATIONS AND CHARACTERIZATIONS:

The target here is to develop a model that will forecast future sales, cut down costs and reduce food wastage.

The trend recognition has to be done by a data scientist who has some knowledge about the hotel industry. Employing someone who has no knowledge about the hotel industry is not a great idea as they will not be able to give the insights of someone who knows about this field.

The model should be able to handle large volumes of data, as in a hotel industry there will be a lot of features for the model to look at and the size of data depends on the sales of a particular month or week.

We should also know in advance whether the customers need our model to forecast the sales for a week or for a month.

EXTERNAL SEARCH (INFORMATION SOURCES/REFERENCES):

REFERENCES:

1.Machine Learning and AI in food industry.

https://spd.group/machine-learning/machine-learning-and-ai-in-food-industry/

2. 10 ways ML is revolutionizing supply chain management.

https://www.forbes.com/sites/louiscolumbus/2018/06/11/10-ways-machine-learning-is-revolutionizing-supply-chain-management/?sh=2b2d02153e37

DATASETS:

1.Small bakery sales dataset from Kaggle.

https://www.kaggle.com/akashdeepkuila/bakery

2.Medium bakery sales dataset from Kaggle.

This dataset will show that we will be able to predict what food item a customer will go for on a particular day of the week and for a particular time.

https://www.kaggle.com/hosubjeong/bakery-sales?select=Bakery+price.csv

BENCHMARKING ALTERNATE PRODUCTS:

Many big companies like KFC, McDonald’s have started implementing ML/AI in their outlets and while they are making new products as well. These companies have identified the use of ML and AI and are benefitting from it.
A lot of AI companies have also entered the market helping big corporations.
Here I will mention a few but there are many more.

  1. Spoonshot A major F&B industry trend of 2021 has been leveraging AI to understand the nuances of customer preference. Formerly Dishq, Spoonshot founded in 2015,offers recommendations, personalization, menu and product development, insights and other trends.
  2. US Local food chains Many local food chains in the US are using AI models to predict the orders that will be placed based on time, weather, food item that is famous at the time, etc. The above mentioned companies have reported that using AI has improved their profits and reduced their costs. They have also stated that the results predicted by the AI/ML model are only getting better and better. Of course, there is no guarantee that these results are 100% correct but for now they are doing a great job. While benchmarking these products we should not be blind to their disadvantages as AI in local food chain is still a nascent industry.

APPLICABLE PATENTS:

Real-time prediction and management of food product demand by Kerien W.Fitzpatrick, R. Craig Coulter and Henning M.Pangels was patented on 2005–1–11.

APPLICABLE REGULATIONS:

• Data protection and privacy rules.
• License for the open-source codes that might be used in the model implementation.
• Laws related to AI.

APPLICABLE CONSTRAINTS:

• Data collection from the customer.
• The customer should know about the time, money and scope of the project before it starts.
• Transparent use of the data obtained from the customer.

BUSINESS OPPORTUNITIES:

The target customers here are mainly local food chains and superstores who have a good number of customers.

Many local food chains might be stuck on the same level for some period of time without knowing what to do, to generate more revenue. The main goal while implementing an ML model for their business will be to reduce their cost by suggesting what sort of groceries to buy on a particular season. They are the primary business targets.

If the customer has a food delivery chain, we will be able to find the areas that require more deliveries and weed out areas that are not bringing in much profit.

The secondary business target is superstore. But for superstore we must consider a lot of additional factors like category-based supplies, etc.

If the model is successfully implemented for the previously mentioned targets, the model can be expanded for big food supply chains that are in multiple cities and for malls that have a lot of shops.

CONCEPT GENERATION:

Every city or town has a restaurant, superstore or a local food chain. And in cities, a lot of hotels have not integrated technology into their business yet. There is a lot that AI can do for this field and the opportunities are limitless here.
That’s what I thought as soon as I started writing this report. With the results produced by AI models constantly dazzling us, we cannot deny that AI can work its magic in this field too. In Chennai, there is a hotel that has implemented AI through chatbots.

But with the advent of cloud kitchens, the traditional hotel business is in a precarious position. To become the frontrunners again, AI could be the way to go as it is the future.

CONCEPT DEVELOPMENT:

We must first understand the environment before we start working on a model and the type of food, the people in that region like and what are the traditions there. After gaining sufficient knowledge about the environment we have to start collecting data. After collecting the data, we have to perform EDA which is used to identify patterns in the dataset and it will help us zone in on the areas that are leaking money. Visualization will help a lot here. Once we have found the trend and outliers, the next step is to use the basic regression models and time-series models , in which we will fit our training dataset and see what sort of results we will be getting. After analyzing various parameters like squared-error, etc we will know what type of model to use and what type of model our model should be based around. The models will be regression models and time-series models

CODE IMPLEMENTATION (SMALL SCALE):

GitHub link: https://github.com/SathyaKrishnan1211/notebook

FINAL PRODUCT PROTOTYPE:
The final product should be preferably a web app specially customized for the customer so that he/she could work with the model easily

This is a very small implementation of model.
This is the basic look of the final product.

I developed a basic website using Django and deployed an ML model.

I entered values similar to the first row in the dataset where the target value is 23200. The predicted sales of the model is 25517.5 which is pretty good considering the facts that I did not do any hyperparameter tuning and cross validation.

The final model should be fitted regularly on the incoming data and we should always be on the look out for new features that might be affecting the sales.

Back-end:

• This involves data collection, pre-processing and integrating the model with the web app.

• The data entered by the customer should also be collected and stored with the customer’s permission.

Front-end:

• Front-end plays a crucial role as it is the interface with which the customer will be working.

  • The web app could have 2 pages. This first page to login and the second page enter the data.
  • It should be highly user-friendly, otherwise they might enter some wrong data and the predicted sales will be totally wrong.

PRODUCT DETAILS:

• The model will be a web app in which the customer will be entering his/her predicted input features for the future (like 5–10 days) and the model will be forecasting the sales.

• The model requires data from the customer (as much as they can give) and we should first weed out the unnecessary features.

• EDA has to be done in a thorough manner and it should be done by a person with some knowledge about the industry.

• Next step is to use ML models. It can either be developed by us from the scratch or we could use the models available in the open-source libraries with a proper license.

• A web developer is needed to deploy our model and design the web app. The web app does not require a high level of designing, so it could also be done by a data scientist or someone else who has some knowledge about web development.

• Pandas, seaborn, scikit-learn, python and jupyter notebook are the tools needed for performing EDA and model development.

• HTML, CSS and JS are the frameworks that are required for the web app.

  • Two ML practitioners and a web developer should be enough to do the job.

CONCLUSION:

From the points that I have made above and the analysis that I had done with a somewhat real world dataset shows that there is indeed a lot of potential for AI/ML in the food chain industry. The uses of AI in this industry are limitless and it is only a matter of time for AI to fully come into this industry. Big companies have already started integrating AI with their business. The models implemented by the big companies has been a game-changer for them and AI has helped them, stay ahead of the curve. Implementing this sort of technology will not only profit them but it will also open a lot of areas where AI can be used. I can totally see the food industry using AI in a few years as AI has already penetrated into a lot of other fields.

--

--