Counting Sand

AI Hot Sauce Brothers - Part 1

Episode Summary

AI Hot Sauce Brothers, Shekeib and Angelo, discuss their process of optimizing hot sauce using Bayesian optimization. Shekeib, the subject matter expert in hot sauce, shares that the process involved trying various iterations of their base sauce and adjusting the amounts of ingredients such as vinegar, peppers, salt and jalapeño based on their taste tests and ratings. The brothers also noted the limitations of human-led optimization as compared to AI-led optimization which takes into account the interaction of ingredients and converges faster. They conclude by appreciating the role of Bayesian optimization in simulating human expertise and intuition, hence speeding up the process of creating an optimized hot sauce. Check out their hot sauce here: https://www.bayesiansauce.com/

Episode Notes

Introduction

The Making of Counting Sauce

Journey through Different Versions of the Sauce

Optimization Process

Choice of Ingredients

Subjective Taste Testing

The Learning Curve of the AI

Strength of Bayesian Optimization

No Prior Experience in Hot Sauce Making

Power of Bayesian Optimization with Human Expertise

  1. Application Beyond Hot Sauce

Episode Transcription

AI Hot Sauce Brothers Part 1 Angelo: In this podcast, we talk a lot about artificial intelligence and that is because artificial intelligence is such an important part of computer science. Now, computer science and AI are also an important part of our everyday lives. It affects everything, the things that we drive, the way we work, the medical care we get, we talk about that a lot, but the food we eat too. And that is actually a growing part of what AI is starting to do. I'm really excited because we're joined today by two brothers, Shekeib and Shohaib Shaffiey. Shohaib is a data scientist and Shekeib is a consultant in organizational psychology and they took their abilities, brought them together, brought their experience, their lives as immigrants and something that they share very passionately. That is food, specifically hot sauce. And they used AI to come up with the hot sauce. So we'll talk with them today about, how did you do it, what took you there, especially during the pandemic when you founded this, and then how did your life as a first-generation American kind of influence this? So I'm really excited and I hope you'll love this episode. I'm your host, Angelo Kastroulis and this is Counting Sand. So, Shekeib why don't you tell us a little bit about yourself. Shekeib: Sounds good. My name is Shekeib Shaffiey. I have a business in consulting. I'm a business psychologist, which just means I'm like a sports psychologist, but for businesses and employees, just try to make them the most effective and happiest they can be to perform the best they can. I had my business for about four years now, engaged in consulting. But outside of that, me and my brother have always had a passion and work together ever since we were young. We've always been doing projects together. And our latest one is this, artificial intelligent hot sauce that we've been working on. Bayesian hot sauce and it's been a really fun endeavor so far. Angelo: Nice. Thank you. Shohaib, what about you? Shohaib: I'd always been interested in, math and engineering and, that's what led me to get an undergraduate degree in biological engineering. We have a full generation of doctors and I wanted to kind of pursue that, but I also had a mathematical mind and I'd always been passionate about math, so I kind of thought bioengineering would be a happy medium between the two. So I thought that would be a great choice. When I went into the program, I found that I like genetics quite a bit and so I found that bioinformatics at the time with the Human Genome Project seemed pretty interesting. So I went and pursued a master's after I finished my undergraduate degree. Also took a couple of classes in algorithms and data structures and that kind of led me towards the path of computer science. It was really, really interesting and I thought, you know, there's gotta be a little bit more to this. So I decided to enter in graduate work at Washington University, and I started doing machine learning, going into computer science, master's degree in computer science, I was able to be a TA and was able to teach a few classes and I just fell in love with machine learning. In machine learning and in neural networks, one of the things that you do is you optimize hyperparameters. That had always been pretty interesting. And there was a course about that that taught just about Bayesian optimization. I didn't know about the Bayesian side of machine learning and how that all worked. So I came into the class fairly blind and when I went into the class, I thought, well, this would be a great tool for just machine learning. But I found that with Bayesian optimization there's a lot of applications. Shekeib: That's just whenever I started thinking about the hot sauce, whenever you told me how few parameters you needed. So I thought, well, let's make a hot sauce if that's all you need. But that's when it kind of started. Shohaib: And that's one of the things that whenever I was in school, I felt like the machine learning wasn't very personal. There was a lot of huge data sets. You needed a lot of data to really optimize your results, but when I went into this Bayesian optimization class, I found that with this tool you don't necessarily need a lot of data and you can get wonderful results and you could use Bayesian optimization for a lot of optimization problems. Whereas, you know, what's the optimal amount of sleep that you would need a day or the amount of exercise that…it could be very, very personal. And I brought up the point during the class, well, could we do this for, you know, my mom makes Afghan dishes, could we use it to optimize Afghan dishes, you know, put that in the features, the amount of time it takes, the amount of ingredients we use. I brought this up to my brother during Thanksgiving during that semester and he thought well, this would be a great application and so basically the objective would be to maximize the taste. And so you would have all these different ingredients and optimize the amount to maximize the taste. Angelo: I want to go back just a little bit to something that you just kind of mentioned. I think it's important because I feel that people's history affects the way that they view the world and the things that they do and decisions they make, right the choices that we make. There were two things, one, when you guys came to the United States, you came young. Shekeib, I guess you were born here, right? Shekeib: I was born like right as soon as we landed. So you could say I was technically still a part of…but yeah, I was born right in San Diego, '89. Right when they, those first six months of them living in America. And yeah, the culture shock for them must have been huge, but food was always those things that brought us all together, you know, and that cultural impact and me learning how much that affects my personality. It's always been a big impact on the way we view life as we always have to keep our culture in perspective. Angelo: That's great. And Shohaib, you didn't speak English when you came here, right? Shohaib: Not at all. I was born in Iran and our parents left Iran because the situation was getting bad there. It was after the revolution. And we had moved to Belgium for about eight months. And then, we had our grandfather living here and he sponsored us to come to the United States after eight months. But I spoke French. I was about four or five years old. Shekeib actually was born here in America. We actually moved to California first and he was born in San Diego. Angelo: I mean, you're both, you're highly educated people and you've gone through a lot of very interesting things. Shohaib you have two master’s. You mentioned that you did one in bioinformatics at Johns Hopkins, I think. And then in there, and this is the other thing I really want to touch on, is this ‘aha’ moment you had where you're taking that and you said that there were a few classes that you took. And then just, I want to know, oh, that's what I want to do. I want to know that. Tell me just a little bit more about those classes. Like what was the moment that you said, actually maybe I want computer science. Shohaib: Oh yeah, that's a good point. There were a lot of things, I thought it was just generally a little bit more challenging in terms of the coursework itself. And I felt like, the algorithms that you produced were very personal to yourself, so it was very rewarding. And I thought that in bioinformatics, a lot of the gains that have been made were actually in the realm of computer science and machine learning. I care all about these neural networks and stuff. So I thought it was a natural progression and I felt that there was a heavy math emphasis, so it tied back to that. So I couldn't believe so it was programming and math together that really bought me into computer science and machine learning. That’s when I thought, you know, I really have to kind of go into this. Basically really learning about the perceptron and actually going back. I really like computer science, I thought, and that's why I sat in on that computational intelligence course because that was a computer science course. When I saw how the perception worked, I thought that was so amazing. And, you know, that's such a primitive technology. I mean, that was the 1950s. Angelo: Yeah, we talk about all that in season one. I have an episode on the perception and AI winter. It's true. It's so profound, you know? And I think that one thing that's like really critical here, this is one of the reasons I was so excited about this hot sauce, was that it is a metaphor. Something that you can put your hands on and you can taste and you can touch and you can smell, that helps you understand what machine learning actually does. Because a lot of times when we're talking about things like, oh, this is a risk factor for something else, or something like that, it's so abstract that you can't see exactly what is ML doing. You know, what is the AI in here? What, what is it actually doing? This makes total sense, right, where an AI can say a little of this and a little less of that, and then you taste it and you say, oh, that's better. That's exactly what AI is all about. And just for those of our listeners who might not know much about what Bayesian optimization is. If you think about machine learning as lots of different parameters, you know, variables, features, and then each of those have many possible combinations. And so you take all of those together and you have a big space. One way we can train a model is so we go over and over again and we just try different things and say we try every single possible combination. That's a grid search. Sometimes that can take forever if you have a lot of these combinations. So another way is maybe we can randomly start looking around the space and say, well, I'm hoping through randomization that I will just ignore a lot of the noise. And so you kind of hope a little bit, but it saves you time because you don't have all the time in the world to test every permutation. Bayesian's a little different. Bayesian is is an interesting concept. Mathematically, I say simple yet complex, but the idea is that what if our previous experience could influence the decision making process, like how we move to the next thing to test it? And I liked one thing that you said was that in your life you started applying Bayesian things to little things, like how can I sleep better? Right, a very small thing. You didn't have very giant neural networks doing this. Can you tell me a little bit more about those little things in your life that you started applying this stuff too? Shohaib: Well, yeah, I just felt that it was so easy because we're using say, the amount of hours of sleep, say, as one of your features. Say that search space as well, I want between four and ten, you know, where does that lead me? And so you just kind of want to see, well, do I feel better? So what we're doing in Bayesian optimization and even active learning is, we're adding, for active learning, the most informative point. Whatever would maximize the taste is basically what you're adding. It's just so simple and it doesn't need a lot of data. That's what really pulled me into it. And if it's only one dimensional, then it's only a few iterations. With our hot sauce, we would get very good results within 15. Shekeib: Yeah. And you know, I really like what you said Angelo earlier about how it gives something tangible to AI with the hot sauce that we're doing. That's the whole kind of reason I was interested in it because my brother, he's got so much knowledge about AI, but it just goes over my head all the time when he tries to explain it to me, right. Because I'm just not in that field but whenever we start talking about the hot sauce it made sense to me why AI could become so powerful because it's something, as a layman I can understand and I can see in front of me how it's getting better. Where most of the time when I read about AI online, it's like you said something about health and like my brother worked on degenerative eye diseases and helped predict what patients might have issues with their eyes in the future. And that's amazing, but for people just wanting to learn about AI and a basic idea. I think this hot sauce is why I really like making this hot sauce, too, is because I learn about it on a very basic level and I think that's what makes me most excited about this project is the education potential for people that necessarily aren't really interested in AI, but now they have a starting point. It's like, wow, you can make hot sauce with this. What else can you do? Angelo: Yeah, it makes total sense. And the interesting thing, you can apply them to your life like you did, you know, I sleep better and you're an athlete so you're trying to maximize something else that maybe someone like me who's a casual basketball player would not want to optimize necessarily. What's interesting about the hot sauce and you guys didn't just randomly decide what kind of food, right? You guys actually love hot sauce. Shekeib: Well, I mean that's another cultural thing. You know, my dad eating raw peppers every morning with every meal. And I always thought he had superhuman strength to be able to handle it and so, I couldn't handle that ao I'd try some Tabasco on my eggs in the morning when I was younger and slowly, you know, I now have like maybe one 10th of his spice tolerance even though I make hot sauce. But it's still, but yeah it’s just a cultural (thing). Angelo: So is that in your culture? I know in Greece, you know, I love hot sauce and I can take tremendous heat, but I'm an anti-type. In Greece, they don't do hot food, and so the tolerance is super low and I bring over hot sauce from the United States. I pack it with me when I go there and people are like, how can you eat this stuff? Is that something culturally, do you guys eat a lot of hot food or is it just something that was uniquely American? Shekeib: I think it's definitely something my parents and my family have done. I think it's a big part of Afghan culture as far as whenever we've gone to Afghan restaurants in the past, sometimes they will have, the way we say it is…which means fresh, raw pepper. And I've seen my dad ask for that at Afghan restaurants, even though they’re far and few between they come right back out with a Serrano pepper. It's usually always a Serrano. So I definitely think it's a cultural thing. And a lot of Middle Eastern cultures, like, whenever you have Indian food, you can get very spicy and it's always like an atomic bomb in your mouth. So, but yeah. And they take their tea scolding hot. I don't know how they do it. Angelo: I can't do things that hot, not temperature, hot. I'm a little bit weak in that area, but I will say I love that you guys are this great pair. You're also these two entrepreneurs and kind of coming together and do something you love and you know, one of you loves business and one of you loves mathematics and technology and you’re kind of putting 'em together. I think that's awesome. Shekeib: Yeah. The school I was at in Sedalia, it was a small town in Missouri, just didn't have that many opportunities but my brother lives right next to the university, which I would end up going to too, M.U., for a little while. And they actually had programming classes at that high school, which I actually took a little bit of C++ classes and it kind of started my interest and all that type of stuff. I still look back at that class as one of my most important educational experiences. Angelo: Do you think that helped you? I get asked this a lot. Do you think computer science helped you in your non-computer science, because you know, your business isn't necessarily computer science. Do you think it helped you in that? Shekeib: More than helped me. When I took those C++ classes, I even took a Java class. They weren't required because I was a psychology major. And I was going to drop them because they were so hard in the first couple of classes. But the professor, he actually said, please keep taking this class, it’s so cool that somebody that's non-computer science is taking it. And since he said that I stayed in and just learning how computer science, just even if-then statements. You can understand so much about the world with if-then statements. I mean, you could apply it to psychology, just that simple idea. And then you kind of learn how a computer thinks in a way. And it's so important nowadays to understand, I mean, we're all working on computers. It's just, it's made me appreciate the things that I do learn in psychology and how they can be applied. Having my brother as an expert I can always ask him and he can be like, that's possible or how it works. So I think computer science has probably been more important than a lot of my psychology classes for my psychology degree in a hundred percent honesty because they were the hardest, but I definitely learned the most. Angelo: Wow, what an awesome perspective. No, that really is so helpful because I haven't really thought about that. I always thought about it as computer science could help any industry because you would understand a domain, you might see new ways of thinking and application, but I never thought of it like the way that you just distilled it. That it helps you even understanding psychology concepts and psychology later or it helps you in doing all these other things. Also, the rigor and difficulty, like a computer will not let you off the hook and it'll let you know it's wrong. It won't let you kind of go, well, because some things are approximate. It doesn’t deal with that kind of stuff. So the hot sauce, first of all, I just want to thank you, this is like one of my favorites right here. We just caught this, like, I just saw this, maybe a week ago. Shekeib: I'm glad. Angelo: I said, hey, they labeled one of ours and I can't find this flavor in the batch. It says Counting Sauce for those that are listening on the audio. Shekeib: Yeah, I made those. That's kind of one of our new flavors because I was so excited to be on the podcast, so I just figured I'd make something special for you guys. But yeah, that's our base hot sauce with a little bit of pineapple and mango into it. But yeah, it's just something to show my appreciation for, you know, finding us. I thought it was a really cool story how you guys even found us in the first place. So I'm just blown away to even be on a podcast about something like this, so. Angelo: Yeah. Well, we're happy to have you. I think that, like I said, it's a great metaphor, but even just going through this, you know, I think we have version 19, 20, 21, and you just sent us 25. We haven't dug into it yet. We'll post this episode later, we haven't recorded it yet, but we're going to do a blind test with my partner and I and we're going to see, you know, can we tell the difference in versions, first of all, can we see the iterations? And then the second would be can we compare it to something else and see if we can tell which one is like AI and which one's not. Shekeib: Oh yeah. Yeah. Angelo: Okay. So let me ask you a bit about these. First of all, what would we optimize? Shohaib: So we're trying to optimize the amount of each ingredient and get a taste and then the optimization would give us the next five set of ingredients or the amount of the ingredients to check and then we would taste it. It's quite literally that easy whenever you put it into the database. But, you know, we have the Gaussian process regression, that's a surrogate model. We use an acquisition function, it's fairly common, it's called Expected Improvement. Shekeib: My brother asked me, what are the five basic ingredients you would want? And so I did say, of course there's vinegar in every hot sauce, usually there's obviously some type of pepper. So I did, as the subject matter expert in hot sauce, my brother asked me, what would be the five ingredients. So I've always liked and I think a lot of people would be able to handle a jalapeño and lime type hot sauce. So that's our base hot sauce but we've optimized those ingredients after those 25 iterations and it starts getting hard to tell the difference. I used to start needing a few hours before I tasted each version because it starts to get so similar in in taste because it's getting so tiny amount better. But yeah, that's the subjective part that might have been a little bit hard on the ratings, you know, and also, if you are going to be doing it in a row, you'll probably notice that the third one feels less hot than the first ones because your tolerance might…I’ve had that problem because I'll be eating hot sauces all day I'll be like, there's no pepper in this at all anymore. And then my wife will try it and then she'll immediately spit it out, like, what are you talking about? I'm like, oh, I guess that's what happens when you're eating peppers all day. And we would give it to family friends and we'd ask for their ratings and we'd ask for a one to 10 rating and eventually the ratings just kept going up. So, I mean, in the beginning its's funny the AI would try way too much salt or way little salt just to see where the kind of limits are. And there's one where it was so salty but for the success of the hot sauce I took a hit and ate some of it but since I gave it such a bad score, the AI was like, okay, never make it that salty or even close to that salty again. And it was a really good data point. Angelo: So this kind of shows the strength of Bayesian because if you had five ingredients over a search space of infinity almost. So if you're making it yourself, I can tell you it would not take 25 batches. It would take 250 batches to grid search this, right, or whatever it would take to try every single combination to say, oh, too salty, a little more, a little more. That's the strength of this is it's able to converge quicker. It's able to say, okay, I can learn from this other stuff mathematically and start applying it. Shekeib: And it would be hard for me because if I were to add more salt by myself, first of all, I wouldn't know how that would affect the other ingredients. I would keep the other ingredients the same. This Bayesian optimization, every time it sent me what I would put into it, it would be different amounts for each ingredient. You know, it wasn't just focusing on the salt like I would've done. I would've focused on one ingredient at a time to make it better. So yeah, it would've taken me a long time to make it as good as it is. I mean, I was surprised after the fifth or sixth try how good it was. I was like, wow. Angelo: Well, and you guys, you haven’t made hot sauce in the past, right? You don't come from like two generations of hot sauce makers so that you already knew a baseline of where to start. For it to find something decent in five iterations is actually shocking because the first thing the rest of us would do is Google and try to find someone else who has a recipe and use that as our basis for beginning, and then I'm going to look for a five star recipe and then I might not like something and tweak it. But if you took that recipe and tried to figure out, what is the lineage of it? How did it go? It's actually quite difficult to find that. So for it to find something decent in five iterations is actually kind of amazing. Shohaib: Yeah, I mean, I was completely blown away and surprised. Even after the five iterations, it would still search spots that would make it too salty. And so it could be that, you know, the fifth iteration actually tasted better than further iterations down the line, but, yeah, it's amazing how fast, I thought it's like, well, this is five dimensions. With Gaussian processes, I've worked with dimensions a lot smaller and I thought, well, this is going to take at least 30 iterations. And then this is kind of what Dr. Garnet, you know, my Bayesian optimization teacher said that, having someone else, having an expert in the loop, that Bayesian optimization loop, so, so powerful. Angelo: That's actually a great way to put it. I've heard Bayesian described that way as it's like a human expert, because that's what a human expert does, they would have intuition and they would say, okay, my intuition and experience tells me that none of this stuff's going to work. I need to include this. Except that we don't know that. And so that's what Bayesian does. It's trying to simulate what a human expert, or you know, who has all that history and knowledge and experience would bring into something like that. So that's a really interesting way to put it. I've heard it like that before. Shohaib: Right. And so bringing the human back into the loop, for instance, for drug discovery, it would be useful to have like a PhD in chemistry, be able to say, well, those starting reagents or however you want to, that’s probably not the best way to go. So we're kind of guiding it a little. So we're using the Bayesian optimization process but also throwing the human expert in the loop to kind of guide it even further so it's even faster. But Bayesian optimization itself gives you wonderful results. But that's what's so nice about my brother having kind of like a background in tasting hot sauces and just kind of being a hot sauce buff for a while, it’s really helped me as well. Shekeib: And I mean, he calls me the subject matter expert on the hot sauce but that's the great thing about the Bayesian optimization is I really did was limit it in saying, okay, maybe a quarter teaspoon is too little salt, but 10 tablespoons is too much. And that just gives the AI something to work with, just a little limiter, so I'm not much of an expert. And I think that goes to show how powerful the AI can be and it makes me want to figure out ways to use it because a lot of my regular job, my consulting consists of giving out surveys, asking people what they feel about their job, engagement surveys. And then if I can use Bayesian optimization on these survey data results, I'd be able to figure out a lot quicker where the problems are in a business and the hot sauce is what kind of taught me how this all works. So without stepping my toes in with the hot sauce I wouldn’t have learned all that. Angelo: That's awesome. I'm your host, Angelo Kastroulis and this has been Counting Sand. If you haven't already, please take a second to follow us and to connect with us on social media. You can follow us on Twitter, my company is @BallistaGroup or @AngeloKastr, me personally, or you can find us on LinkedIn @AngeloK1. And if you want to buy the hot sauce, we'll give you a link to that too. Thanks for listening.