How a Bank Saved $500k a Month From ATMs Using a Time Series Model
Greetings 👋, this is Paradigm where we study real stories of how AI was used and fortunes were made!
In this story #2 we learn;
💡 How a time series model helped a bank save around $500k a month by predicting the optimum replenishment amounts at their ATMs
⚒️ How an unforeseen human behavior challenged the usage of the model
📢 Bonus - Advice from our guest on how beginners should start learning AI
On to the full story:
In this story, I’m in conversation with Sandupama Balasuriya, who is currently the Principal Data Scientist at ChiefDX. But the use case we discussed goes back to when she worked as a Data Engineer at KBSL Information Technologies.
She is someone with years of experience deploying AI solutions in a wide range of domains.
Hello Sandupama, tell us about this use case
Our client (the bank) at the time had the problem of not knowing the optimum amount of cash to be held in their ATMs.
They incurred losses due to keeping unnecessary amounts of money at some locations. As you know in finance, stagnant cash means losing cash. Also at times, some ATMs would run out of money, which again costs the bank more to replenish those on demand.
So they wanted a solution that would provide them with an optimum amount that should be held at each ATM location which is sufficient for daily withdrawals.
How did you first approach the project?
We knew from the beginning that this would require a time series model that captures patterns of historical withdrawal amounts at these ATMs.
What about the data?
Data handling easily took more than 50% of the effort in the entire project. The client had been collecting data about activities at these ATMs but the problem was that it was in raw text format. The data from each machine came in a long text document called a journal.
Did you have to do any data cleaning or enhancements?
Absolutely. First and foremost we had to write code to extract structured data from these text files. There was a considerable amount of noise in the data as well, so we had to double-check the figures, especially the daily withdrawal amounts.
Additionally, we performed some basic EDA and observed that there were seasonal patterns present in the data.
Take us through your experimentation phase up to the final deliverable
We started experimenting with LSTM-based time series forecasting and realized that it was a good fit for the solution. As we progressed, several fine-tuning and regularization techniques were also explored.
The most interesting part was the unforeseen challenge we faced when we first tested the initial model with the real-world application.
See, the model was trained to predict an amount for a day. This intrinsically assumes that, in practice, these ATM machines were filled at the beginning of the day, each day. This was not the case at all.
In reality, the replenishment agents would reach the ATM locations throughout the day. So the prediction from the model becomes useless for a mid-day replenishment.
We decided that there should be a second model, on top of the predictions given by the time series model, with the objective of producing an optimum schedule for replenishments. We used a genetic algorithm to achieve this.
So the final deliverable was a solution with both of these models.
Amazing! Tell us details about the tech stack and system design
Languages - Python
Frameworks - Keras (Tensorflow)
Computation - on-premise GPU
Serving - Airflow, Django
Versioning - Github
System design
We developed a Django app that provided a dashboard to monitor both actual and predicted information. The models ran as a separate service that could be accessed from the backend of the app. All of the routine tasks such as the data extraction from text files were orchestrated using Airflow.
How did you monitor the solution after deployment?
At the time we did some basic monitoring by comparing the predicted results with actual numbers.
How long did it take to build the whole thing?
It took us 1 year to have the solution with all the components I mentioned earlier. But the AI model was developed in 6 months.
What was the team structure for this project?
There were 3 roles - Senior Data Scientist, Data Engineer, and Software Engineer.
Maybe the most important question is, what was the impact made?
We actually did a separate analysis to see how much money was saved at each ATM location. Upon aggregation, it came roughly up to around $500k per month. I believe that was a very good impact.
🏁 At this stage I asked the guest a few more questions in general. Here we go.
What are the areas you’re excited about in the current frontier of AI?
Right now, with my current role, I am mainly excited about computer vision tasks, especially feature extraction from images/videos. I think there are great use cases for those.
Any ideas or solutions you will pursue if you have time?
All I can think of is something to do in the healthcare domain. Applications such as assisted disease diagnosis or managing hospital inventory for medical supplies will be interesting.
Finally, resource recommendations for learning AI?
I think the best place to start is Andrew Ng’s courses on Coursera. This was where I started. Those will help you get a good foundation in AI.
After that, you can wander into other resources available on Youtube and choose what you want to work on.
That's it for this one.
💬 Let’s discuss more AI application ideas and system design choices on the Paradigm Discord. Our guests are also there.
🔥 Our first reader review 🔥
Wow! 😂
See you in the next post!