(Photo : Chick-Fil-A)

Chick-fil-A might not be the first company that you would expect to see Artificial Intelligence and machine learning in action, but the fast food franchise is using algorithms for food safety issues. They are using it at their 2,400 restaurants in 47 states. During a presentation at the ReWork Deep Learning Summit in Boston, Massachusetts, senior principal IT leader for food safety and product quality Davis Addy, talked about the custom system that Chick-fil-A uses in detail. The system, dubbed AWS Comprehend, is able to track health trends around its restaurants that could potentially be problematic. The fast-food chain plans to release the code on GitHub in the future.

"For us in this journey with analytics and food safety, we're going from a place of hindsight to insight ... and eventually foresight so we can be more proactive in helping our Restaurants better identify and address food safety risks," said Addy.

He noted that social media is the most common customer feedback platform for food safety-related incidents, but he stated that it's fraught with peril. Posts are inconsistent tonally and grammatically. Some users are more controversial and facetious than others. Isolated posts are difficult to correlate with real-world events.

Chick-fil-A's goal was to create an AI framework that could identify phrases, keywords, and customer sentiment from posts reliably to help spot emerging foodborne illness. Its AWS-hosted solution processes restaurant review data every 10 minutes from a range of social media platforms, which are then passed onto a Python routine that filters for over 500 keywords such as food poisoning, vomit, illness, throw up, nausea and barf, and AWS Comprehend, which checks the sentiments and determines if they are legitimate.

Spotting angry customer's tweets about food-poisoning is not easy as it's sound. The words sick or filthy can be associated with a positive connotation like "I love this place; they make a sick sandwich", which do not pose any concern or red flags.

Addy says that AWS Comprehend struggled to process out the sentiment of certain phrases that are food-related. After collaborating with Amazon to improve its function, the Chick-fil-A team has been able to achieve 78 percent accuracy.

The store managers get notifications via a customizable Chick-fil-A mobile app, which then highlights words that the algorithm identified and enables them to check the full posts. They then contact the customers directly, through the social media platform that they use. The data is transferred to a corporate dashboard where it is plotted over time to make trends easier to spot.

Food safety is not the only thing that Chick-fil-A thinks might benefit from machine learning. The restaurant chain is experimenting with computer visions systems that warn employees who have been handling raw chicken to wash their hands before they move to other areas of the kitchen, and a separate system that instructs them on how to rinse their hands properly. Addy noted that if the employees washed their hands properly, they can reduce the risk of foodborne illness by up to 80 percent.