Latest / Agentic Conversations (formally mlops.community) / Build a Culture of ML Testing and Model Quality // Mohamed Elgendy // MLOps Coffee Sessions #76
Transcript
- 0:00Welcome back to another and The Lofts Community podcast.
- 0:03This is a coffee session with no coffee.
- 0:05No. Adam.
- 0:06And I are here to talk to Mohammad today about testing
- 0:12Centric development, not test-driven development.
- 0:15Adam how was it for you, man? We just got done talking to him.
- 0:19I thought it was awesome. I really appreciate his
- 0:20Viewpoint. Would you think?
- 0:23Yeah, really good. Like I'd said to him off line
- 0:25there. There's lots of stuff about the
- 0:28kind of workflow that I've been thinking about recently and it's
- 0:32it's probably actually speaks volumes that even I'd missed
- 0:35some of the real subtle stuff that he's talking about the
- 0:37holistic view thing was really, really cool.
- 0:39I really like that. Yeah, yeah.
- 0:41So for those of you that do not know who Muhammad is and it's
- 0:45probably hard to know who Muhammad is.
- 0:47If I'm not saying his last name, it's Mohamed El gandi.
- 0:51Hopefully I'm pronouncing that correctly.
- 0:52Actually I didn't ask him how his name was pronounced, but he
- 0:56is X Amazon extra Leo. He's done some really cool
- 1:00stuff. I mean he gives talks at
- 1:02Amazon's Devcon Google I/O. He's got he passed toxic
- 1:08O'Reilly's. AI conference.
- 1:10The guy's pretty notable in the space and he's also written a
- 1:12book with Manning called Deep learning for vision systems if
- 1:16you want to. If you're really enjoying this
- 1:19conversation, then we'll leave a link below.
- 1:22So for where you can pick up that book but currently he went
- 1:26off and he did. What most people have been doing
- 1:29recently is starting their own companies and he's got this
- 1:34company around testing and the company is called quote.
- 1:39Wait, let me get this straight, it's kalenna.
- 1:41I was about to say koala, but it is kalenna.
- 1:45And and so it's all around testing and I think this idea of
- 1:51testing It's not the first time we've talked about it.
- 1:54It is very important though. We're starting to see it more
- 1:58and more, you're starting to see things like he mentioned in the
- 2:01talk, like the evaluation store and you're starting to see
- 2:05monitoring companies, start to shift and pivot a little bit.
- 2:10I saw just the other day a monitoring company come out with
- 2:14a testing framework and open source testing framework,
- 2:17because it's almost like it goes hand in hand.
- 2:21Yeah, for me again, coming into the tool.
- 2:24I was very much primed to think of things like, yeah, software
- 2:29testing, unit testing and things like also data quality reports
- 2:33and the tools out there. But this year this is different
- 2:36and the holistic kind of end-to-end view, I think is
- 2:40really important. The other big takeaway for me is
- 2:42to start thinking about maybe Co defying thoughts, run failure
- 2:46modes of stuff like that. That was a really cool point.
- 2:48So, well worth getting into the talk.
- 2:50Yeah. And so for me, I think I really
- 2:53enjoyed when you're looking at the documentation that is
- 2:58inherent with testing, like the more you test, the more that is
- 3:02just a side effect that you have a paper trail or you have these
- 3:05artifacts which can become documentation in a way.
- 3:09And so how that can help with this, what do they call it?
- 3:12Like, the bus problem that if somebody at your company gets
- 3:15hit by a bus, then all of that information.
- 3:17Hopefully is not in their head. It is Demented somewhere.
- 3:22And also, as I mentioned in the conversation, how that can help
- 3:28for people who are having to jump through the Hoops of
- 3:31Regulation, as we both know, because you're in, you're in the
- 3:38the UK but it doesn't officially fall under the EU regulations.
- 3:42It doesn't anymore, does it? No one will but we seem to have
- 3:46a strong. But yeah, we Center this this
- 3:50practice of Emily regulations. Anyway.
- 3:52So that's a sore subject. We don't talk about that.
- 3:55She just yeah, you do a GitHub. Pull request, huh.
- 3:58And or you do it? No.
- 4:00Sorry. You do a clone.
- 4:02You do a GitHub clone and then you take the regulations.
- 4:06Exactly said it's. So yeah.
- 4:08This is our conversation with Mo and I'm Demetrius Brinkman.
- 4:12I'm here with Adam stroke of whose name apparently means
- 4:17fried prawn in Swedish as he told us last Last time he
- 4:21guest-hosted. I knew it was something
- 4:26something around there. So anyway, thanks again, Adam
- 4:31for coming on and joining me for this one.
- 4:33It's always a pleasure to have you.
- 4:34I love the way that you ask questions and your mind thinks
- 4:37for everyone else out there, I hope you enjoy.
- 4:43All right guys we're here. We're ready to talk.
- 4:47I'm super stoked to talk with you Mo.
- 4:49I know that this has been Long time coming.
- 4:51We chatted what like months ago and we wanted to go over testing
- 4:56and testing has become something a bit of important topic that is
- 5:03getting the light that it deserves shown on it.
- 5:07And so today I want to dive into it with you.
- 5:10I know you're doing cool stuff with your company around testing
- 5:14and so maybe you can start with what you're doing at your
- 5:18company and then we'll dive into more testing questions as we go
- 5:22on. Yeah, absolutely.
- 5:26I think it would make much sense to try to take one step back
- 5:29into why we're doing ml testing. Well the story will give her a
- 5:35lot of context on what we're doing.
- 5:38So my background has been in the ml side before and I'm currently
- 5:42the CEO and co-founder of Corona is more of a business side, kind
- 5:45of role. But my role has been always on
- 5:47the engineering side of my career.
- 5:50I've been building and managing ml teams in different
- 5:53Environments. And one of the places that we
- 5:56worked for who worked for a a early start early stage startup
- 6:01in the CV space building algorithms to detect defects in
- 6:05x-ray. Machines, we're selling products
- 6:06to the security and defense face the deal deities.
- 6:09All the kind of like another customers at this level, we went
- 6:13into it there where we're thinking about, okay?
- 6:15Let's let's do a build a model, a second detector.
- 6:19And we say 98% and whatever kind of metric the we're We're
- 6:23producing on realize that this doesn't doesn't fit the bill for
- 6:27these kind of applications similar to a lot of mission
- 6:31critical applications. You can't go on like there's 99
- 6:34percent chance that we're going to take the gun but one percent
- 6:37chance. There's a gun going up there on
- 6:39the plane. So we at this time we start
- 6:42thinking about how the product and the the entire goal of the
- 6:46company is affected by my the testing problem.
- 6:49So we would push by the market and by our customers to think
- 6:53about the Process and think about our current model training
- 6:57process and how we can stratify their our work our data into
- 7:04real scenarios, real product objective scenarios that we can
- 7:08go to customers and tell them. If it's a gun, we detect a gun
- 7:11in these scenarios with this kind of confidence and other
- 7:15levels and so on. So we can have iterative
- 7:17improvements so on. So at this point we did well
- 7:21with that tell time and then we either become You got Acquired
- 7:24and then I was writing the, my book and computer vision, it's
- 7:28called Deep learning for vision systems, it was published by
- 7:31Manning and I start thinking about how do we actually solve
- 7:34this pain that I've always been lacking in that like a manager
- 7:38of the team or leading the remote teams in Margaret
- 7:41organizations? And then I've always been asked
- 7:43all these hard questions like a Muhammad why did we fail in this
- 7:47scenario or are ready to deploy? Are we ready for a demo?
- 7:50And we always do our best in the statistical.
- 7:53Methods that we have today to have some confidence in our
- 7:56products but in my heart it's always been, I hope so.
- 8:00Right. And we work with my team's, I
- 8:02can't build a systematic process around that, so that was a pain
- 8:06in my career and we started thinking about when I was
- 8:09writing the book I felt like let's dedicate a chapter
- 8:13research it. And write something about this
- 8:15topic. I worked with a, with a few
- 8:17researchers who are working with me on the book, and then we came
- 8:20up with a rigorous systematic and mold testing framework.
- 8:24And then we are likely you realize that it will never be
- 8:26used. It's just very tedious and
- 8:28time-consuming to be done without proper tooling.
- 8:31So this is what led to our current company.
- 8:35Now Kelowna, we started working on, we quit our jobs, on the
- 8:39start working on, including a full time, so the back to your
- 8:43questions. What are we doing here?
- 8:45We're building a machine learning testing and validation
- 8:48platform and the goal is goes beyond the kasinga's as we
- 8:52realized as Working with our customers and our personal
- 8:55experience, we found that that actually the entire lifecycle of
- 9:00the model development revolves around training.
- 9:03But we defined that, if you shift that into the test Centric
- 9:08development things, get much better.
- 9:10Every Upstream process is much more efficient in the terms of
- 9:14data training and experimentation and the
- 9:16downstream processing production is like much much less
- 9:20production problems. So we realize is that the vision
- 9:23here? It grew from just testing into
- 9:25building a culture of ml quality in the organization.
- 9:28It's not a one-time heroic effort.
- 9:30It's more of a team culture to guarantee that's kind of quality
- 9:36level improves my time and being able to measure it and
- 9:39communicate it with everybody. The site is really interesting
- 9:45and it brings me to a point that I think many people might ask
- 9:49you actually, if you go through this journey and you've probably
- 9:52got the other four but you use. All right, ml testing and
- 9:56obviously the big there's a big difference in unit testing
- 9:58integration testing all that, my mind immediately goes to data
- 10:02quality and thing and for tooling, so immediately go to
- 10:06toiling, like TD, a DQ great expectations, so could you
- 10:11elaborate a little bit? And why they're different to
- 10:14what you're doing. Yeah.
- 10:16I mean we can we can look at the testing node in the workflow as
- 10:22a node or we can look at it as a work flow on its own and build
- 10:26that training development on top of it which what we did.
- 10:29If you look at testing let's actually not.
- 10:31Look at testing, let's look at model quality model, quality is
- 10:34a function of the model and the test data and then we all our
- 10:39work is focused on the model. This is getting much easier with
- 10:42a lot of tools, making the model piece and the training piece
- 10:44much easier. And then, Jessica is usually an
- 10:48afterthought or less managed, basically, Benchmark data set
- 10:52that you keep adding to and then that doesn't end that dislike.
- 10:55If you want to build a kicking theory, yes, the the testing
- 10:59peace can be a tool or two. But if you if you want to look
- 11:03at the testing piece as managing the test case manager and then
- 11:07running the emphasis getting reports comparing models
- 11:11compelling and you have an eval store that says all these
- 11:14results and being able to To build analytics and services on
- 11:17top of it and Reporting Services becomes an entire whole new
- 11:21game, then we thought about it about, okay?
- 11:23How do we start testing, how do you start solving the testing
- 11:25problem. We thought about.
- 11:27Okay, let's build that test case manager.
- 11:29But again, how you're going to deal with the results and then
- 11:31the test case manager is is a whole.
- 11:33I keep looking at that test data.
- 11:35Especially in the vision problem is much much harder.
- 11:38If you want to start a fire, your data into scenarios, What
- 11:41other option do we have? Now?
- 11:42Oven labeling is right? And that is very expensive and
- 11:46time-consuming. Now you're the reason he was,
- 11:49like, you have, let's say, hundreds of thousands of images
- 11:51in your benchmark data set, you label them as the way, the
- 11:54understand your domain now and you learn more about your
- 11:57domain. You go ahead and relabel all of
- 11:59this and it doesn't end. So we realize that we have to
- 12:02fix the problem from here. So we built a test case, Studio
- 12:05allows you to study file, you create new scenarios within
- 12:08minutes as opposed to weeks. And so on, then we thought,
- 12:11okay. The end of it now but we need to
- 12:13manage these test cases and version them and be able be able
- 12:16to. We don't make sure that because
- 12:18soon enough when this is the process is easy which what we
- 12:21want your test data grows from 200 to a million to 10 million,
- 12:25to 30 million and your test cases grow from tens to hundreds
- 12:28and thousands. It becomes really hard to manage
- 12:31with our you know and it development environment
- 12:34notebooks and so on. So we found no other way other
- 12:37than building a full platform to manage this whole thing just to
- 12:40make sure that the End-to-end process finishes in minutes as
- 12:44opposed to weeks. If you have to put in different
- 12:46tunics, I can serve just a short answer to your question, Adam.
- 12:49I can say, yeah, we can put around some to links and some
- 12:53like, see GOI actually does something like this software
- 12:56development side and the testing side we can put in around some
- 13:00tools, which what we did in into coming into this process.
- 13:03But the end of the day, if you want to build model development
- 13:07testing, it has to be a full platform to take the process.
- 13:10And to end is like you said, Before this call Engineers hate,
- 13:13to be told that's more. They feel like it's always funny
- 13:16but we have to deal with the whole thing to make sure that
- 13:20it's Engineers like it. So if I'm understanding this
- 13:24correctly it's really trying to take more of a holistic view at
- 13:29testing and was recognized from a layer above almost that we
- 13:36need to bring testing into every piece of what we're doing.
- 13:42Absolutely. And on top of that is you can
- 13:45build a process. On paper, I worked a lot in
- 13:49change management process, change management and you can
- 13:51put a process in paper but having a knowledge base and
- 13:56organization that builds on top of it is the actual the gold
- 14:00mine here. That that make sure that the
- 14:02process that product improves month after month year after
- 14:05year, if you have a new engineer joining the team today, they
- 14:09will ask, you have to ask a lot of questions as if you're
- 14:11building a contractor. How is our models?
- 14:13Are our what other? What are we what?
- 14:16That's how we do? Your tents, all these kind of
- 14:18things. Whereas, if you go into the
- 14:21classroom and just look at the list of test cases, I look at
- 14:23the history of test. This is so even when you're
- 14:25looking at your manager you cannot film your team's
- 14:29performance. Nothing here about development.
- 14:31You just looking at the team and your product.
- 14:33So instead of looking at the team as we have a model went
- 14:36from 1991 and so on, we want you to look at, we have features to
- 14:41detect a car, a train and it has improved this way and regress,
- 14:45this way, we have a feature that is Zach's a car.
- 14:47Our with certain level of occlusion.
- 14:50So under strain on top view and side view.
- 14:51So you have all these history on the knowledge base that's built
- 14:54here with them for five months, you have a lot of informations
- 14:58on a lot of analytics on how to identify failure modes,
- 15:02automatically and how to improve the model as an.
- 15:06Except what to do, is it adding more data at tuning more?
- 15:09All the stuff happens when you have this knowledge base, Yeah,
- 15:13so let's double click on that, for a minute because I know that
- 15:16we had spoke about the idea of testing as basically bolstering
- 15:23the documentation. And it feels like, that's what
- 15:25you're talking about here is like, because you have testing
- 15:29and because you're making sure that this knowledge is not
- 15:33siloed in one or two Engineers Minds, then you can have
- 15:38something that is more robust and anyone In come in and get up
- 15:44to speed much quicker than if you didn't have this yet.
- 15:48So yeah. Can you go into that a little
- 15:50bit more? Because I'm not sure, I'm fully
- 15:52understanding it. Yeah, absolutely.
- 15:55So let's go again with the simple example, like a car
- 15:58detector. First, you go ahead.
- 16:01And you say, I want to build a car collector and then you, if
- 16:04you take this case approach, you say, okay, I'm going to break my
- 16:08test data into easy medium hard basic thing.
- 16:12And then cause, you know, I don't know the problem yet.
- 16:14And then you go easy, medium hard.
- 16:16And then you push the production, you see problems
- 16:18come back and then you say, you know what, I need to look at
- 16:21different kind of evaluation. So I want to see different
- 16:24orientation of the car, different to crucial level
- 16:27camera conditions and weather conditions.
- 16:28These are basically trying to do like 10 to 15 test cases and
- 16:32then you learn more about you. You go ahead and the more you
- 16:34working on the improving the product and then you come back,
- 16:37you see, bugs, you start breaking these down into more
- 16:40test cases, more fine-grained more.
- 16:42Resolution test cases. Now, that's the year end.
- 16:45You start with 3 ends of the 1020 hundreds of those and then
- 16:50an engineer joins in a year. Now, they have been working on
- 16:54cars vectors. So you understand exactly what
- 16:56we're looking for. We, we always as, you know, data
- 16:59scientist, we look at the end when you evaluate the model or
- 17:01on, when you change your look at the data, one by one, don't have
- 17:04a sense of what this is like, you look at a car.
- 17:07You're not, you don't know what you're looking at, you know,
- 17:08it's a car. You don't know.
- 17:10It's like you care about recruiting you care about
- 17:12Weather conditions are so on and then the deployment environment
- 17:16is different for each customer. If you of, it's like a robotics
- 17:20kind of application indoors, you don't need some kind of weather
- 17:23conditions, for example, others, you need up.
- 17:25So to understand the product specifications understand that
- 17:29there are deployment environment.
- 17:30The customer environment, understand what the team has
- 17:32been working on it. All happens in that knowledge
- 17:36base knowledge base starts from just looking at the list of test
- 17:39cases and looking at the history of how things happened.
- 17:43Being able to, I didn't understand within the first
- 17:45couple weeks. This is what these are the
- 17:48customers that I am building for, and these are the specs
- 17:51that we care about So the one thing that comes to mind when
- 17:57you're talking about like tens and hundreds test cases and
- 18:00things like that and I can see that y z value we need but do
- 18:04you or have you experienced any issues with actually the
- 18:07computational cost of running? So many tests and things like
- 18:10that? And like building all the cost
- 18:12of building data sets for the purposes of testing and things
- 18:15like that because I can imagine that you're adding loads of
- 18:17robustness and scalability, right?
- 18:19But what significant computational cost I guess.
- 18:23No. Absolutely.
- 18:24And actually, we are pushing for more testing.
- 18:27I were pushing for much much larger test data which could be
- 18:30intuitively increased the the computer production cost, and
- 18:35storage and, and effort into, on the way we solve this problem is
- 18:40this Avast or I know you guys talked several times in your
- 18:43podcast about the dollar store and we are fans of their of the
- 18:46concept. When you're testing on, let's
- 18:49say, hundreds of thousands of images and you run the model and
- 18:52then 50,000 more images. And then the positive thing
- 18:58about having a platform to do that is you do you need to run
- 19:02less emphasis because the model has been tested on the other
- 19:05image before. So you look at the nucleus item
- 19:09in this in this process is the image or an object with its.
- 19:13Would you frame or something? You look at the image on your
- 19:16create, we create a history of this image.
- 19:18So at the end of the day, when you look at an image, you see
- 19:20that this image has been tested on these 10.
- 19:23Models. And this has been, the history
- 19:24has been promising. So so now the when you're
- 19:27testing and you re testing then if this version of the model has
- 19:30been tested on this version of the image or the data sample, if
- 19:33it's different than if it's infinity or other side, then you
- 19:37test less. So you are testing more but you
- 19:40are running a much, much less computation and comes here.
- 19:44They're reporting these most of the testing happens not because
- 19:48not because the engineers are validating their product, it's
- 19:51answering questions and being able to Compare models that
- 19:54happens once. So we saw is actually very
- 19:58practical team spends. Like if you're running emphasis
- 20:01on millions of images, you get like spent a couple of hours on
- 20:04that and then it's up there and then every time you run, you add
- 20:08more data. You run anything on the model.
- 20:10It just runs the addition they do this.
- 20:13So we saw the 5x of the 10x. Even love.
- 20:17Our current customers is 10x that the size of the data and
- 20:21the number of test runs that they're running with much lower
- 20:24competition costs, then before, And so you talk because it goes
- 20:30back to the exact question, Adam.
- 20:32You were asking of whether it's a tool on a platform because
- 20:37testing is not liked, and it's always an afterthought and to
- 20:40tell people you guys, who just think we found that it has to
- 20:43be, you have to solve the whole thing.
- 20:44We cannot solve one piece at a time.
- 20:48Let's riff off of that really fast because I think it's a
- 20:52theme and everyone knows it. The testing is not liked and
- 20:56nobody wants to hear that they need to do more tests.
- 20:59Do you have silver bullets for someone like let's say, Adam
- 21:03goes tomorrow and he says, listen everybody on his team, we
- 21:08got a test. Like, we're I just had this
- 21:10podcast yesterday with Moe and I realized that we're not testing
- 21:14enough. What do you do to get by in how
- 21:17do you, convince people to go along this journey with you?
- 21:22Yeah. We've been, I've been doing this
- 21:24myself in my career and then I'm doing it every day today.
- 21:28Alright thank you for giving your number one is the product
- 21:31we see now that most of quality initiatives start from person in
- 21:38the team, technical leader a manager.
- 21:40Some that is pushing this quality levels.
- 21:43That's number one, or you have been getting a lot of pain from
- 21:47production, from sorry, from customers.
- 21:50And then customers are pressing on business.
- 21:52This is passing on engineering, so we we try to look at the
- 21:56team. We, this is, are the two main
- 21:58things we focus on. I tell Engineers or they are
- 22:01scientists. Hey, you, but you have have a
- 22:04slide on this specifically. This is first slide.
- 22:06We talk about all the time is if you test more or just right, if
- 22:11you have a systematic test process you will train this.
- 22:15You will do less data collection and data labeling.
- 22:18You will have to answer a lot less questions.
- 22:22It's from people because the answers already rather there are
- 22:26scientists usually like the are skeptical or Engineers Capital
- 22:29until the see the end to end of how we built it and they start
- 22:33seeing okay we see your point and then we do it like a pilot
- 22:37or something the see the numbers before like how many times he
- 22:39tested let's say before was once a week.
- 22:41Now, 10 times a week but the actual hours and testing are
- 22:44much less because they just like it, did they run a lot of tests?
- 22:47And the actual hours are spent on the training which is very
- 22:51painful process. Shooting in the dark kind of
- 22:54process. All this got gets myself, my
- 22:57pitch to data scientist is like a, you don't have to spend all
- 23:01this time. You'll spend less time on
- 23:03testing as well. And you will have a systematic
- 23:06process that everybody will agree on a product as well for
- 23:11our teams and business teams so I can certainly get that right?
- 23:16Yeah. Can see the actually the point
- 23:18about being a platform and how you then save or more runs And
- 23:22you save time, holistically makes a lot of sense.
- 23:25Actually, one thing that, so the next thing because I'm my brains
- 23:28working, right? But my, the next thing that
- 23:30comes to mind in is the so someone like me that came in
- 23:33today, science from a physics background getting started with
- 23:37testing. I've got these software
- 23:38Engineers, are my ears, like young data, scientist, getting
- 23:41started. It can seem quite alien and
- 23:43quite like I'm really get it EDD.
- 23:45How do I do that? And so, And actually, as you go
- 23:50further in your career, many people never get over that
- 23:51hurdle of, they just don't get it.
- 23:54And I've seen so many teams where they just, we don't do any
- 23:56testing a fight. Okay.
- 23:58So, because I'm aware of it, like you're testing, is only as
- 24:02good as your quad. You've asked a bit of a skill
- 24:04like testing. He's a bit of a skill.
- 24:06So do you have any recommended resources or like routes for
- 24:09people to get confident with this, or get good at testing?
- 24:13And like how should they be, what approaches should we be?
- 24:16Taking like does tdd work and stuff like that.
- 24:19I'd love to hear your thoughts. Absolutely, starting notice
- 24:22which we try to avoid the word TD having been very
- 24:26controversial. It is the he do.
- 24:28I mean, it is what it is. It's just, we called it
- 24:31eccentric development. And the reason tdd is is a
- 24:36little bit controversial in the software side because it's more
- 24:39of a deterministic. It's not a statistical process
- 24:42is basically compared to ml. It's really hard to infer.
- 24:48It's based on data sets or benchmarks.
- 24:51If you're looking at a human level performance, to give the
- 24:54human set of data, and they are accurate in 99% of the data, you
- 24:59can infer that. This one percent is the most
- 25:00adverse are case for a human level, but you cannot do the
- 25:04same thing for a data product. Like ml, you have to actually
- 25:10include every piece of it. Also, I forgot to question.
- 25:16Yeah. So that now that's the
- 25:17interesting in itself, the tdd kind of, because I've heard
- 25:20loads of mixed views on that. So the next part for me was,
- 25:24yes, but I don't want to get good at testing and how do I as,
- 25:27like, from a machine learning point of view, what things?
- 25:31Yeah. So for that we testing, is
- 25:34basically done now by every data scientist.
- 25:36Our actual that the mechanics of it, which is running emphasis
- 25:39and getting results. So that is not changed and What
- 25:43we are changing is the way you're managing your data, your
- 25:46test data, to things, test data has to be has to cover the
- 25:51entire span of what you're trying to achieve sounds
- 25:54impossible. But it's actually much much more
- 25:56manageable than trying to do that on the training data test
- 26:00data. If you're, if you're trying to
- 26:02build a product from steps, you have a say, I wanted to be able
- 26:06to take this class with these kind of sex.
- 26:09You go backwards and you create that play with your data, create
- 26:12these the test cases. Now, these test cases are the
- 26:16way they are crazy today, whether they are images or text,
- 26:18there are quite a lot of data wrangling.
- 26:21We built the studio for that. It's a UI that you're able to
- 26:24stratify your data search your data, based on any snotty that
- 26:28you're looking for without prior labeling.
- 26:31So this is our whole UI thing and then you're able to add some
- 26:35augmentations to test robustness and include some objects.
- 26:38So we created like an interesting intuitive.
- 26:43Video that we looked a lot about the u.s. piece of it.
- 26:47How to make these Engineers of their scientists coming from
- 26:51managing background. But the understand data, they
- 26:53understand how what, what to look for in the really
- 26:56understand what neural networks are.
- 26:58And then we start building UI on top of this.
- 27:01And then we also dealt the an SDK to make it Partners UK to
- 27:06make it so easy for them to integrate similar to what some
- 27:09biases. So to integrate into their
- 27:10current workflow. So that you experience is Is the
- 27:13biggest piece into making sure that this there's adoption into
- 27:17this new workflow, because we're building a bit of the day,
- 27:20building animal testing tool. It's what starting a new
- 27:23category of two Wings. We're told, we're not telling
- 27:25people how you've done and we're actually we found that we're
- 27:28changing the behavior and I believe that the workflow will
- 27:32change after. If that does Centric approach is
- 27:36created the way you're managing your test data will reflect into
- 27:39your whether you're managing your training data, your flex
- 27:41and everything up straight. Their scientists are already
- 27:46familiar with the pieces that we were working with and we cut off
- 27:49all the data wrangling approach that they have to reload process
- 27:53and understand the and even like the manual approach of having to
- 27:57look at the data one by one labeling.
- 27:59This approach, we cut all these hurdles because we not, we think
- 28:03a lot when we're working on testing with the about the
- 28:06statement that we started with the way wants to be told to test
- 28:09a lot, right? So we try to make sure that this
- 28:11is easy and where everything was Measuring.
- 28:13We're testing, how long it's taking you and how easy it is
- 28:16compared to current approaches. And so there's one side effect
- 28:23that I think we haven't touched on but it kind of gets me
- 28:27excited about the way that you're looking at the problem.
- 28:30And that is considering right now, both Adam and I are in the
- 28:34EU and there are proposed regulations that are coming out
- 28:40your machine learning and AI, is they Like to call it in the EU.
- 28:45And so, I feel like this, have you thought about like how this
- 28:49and how the idea of testing /, creating more of a knowledge Hub
- 28:55and better, documentation can play into the regulation aspect.
- 29:00Yeah. Actually just would have thought
- 29:04we have thought about it. We Disturb mode that we are at.
- 29:06Now at Kelowna, we are working with specific teams that are
- 29:11facing regulations and independent regulators and
- 29:15independent Auditors into the process.
- 29:18So we start with, if you look at any in domain now, it's getting
- 29:22clear regulated and then they are telling you, you'll see if
- 29:25you're working on a face album. First section problem, you have
- 29:29to show gender bias Race by Sage advice.
- 29:32These kind of metrics that you can just say like 90-something
- 29:36percent in detecting faces. So and let the same thing for
- 29:40safety applications and more mobile Mobility applications in
- 29:43TV and so on. Now this all starts from the way
- 29:47the regulators and we want heavily with this Regulators
- 29:49there. The way they and their great
- 29:51example of this is Nest, the gulf.
- 29:53If you guys are familiar with the it's a u.s. nonprofit
- 29:56organization. So basically they are the way.
- 29:59The, if you look at the process of Open Source, you look at the
- 30:01reports they care. A lot about these, what we call
- 30:04Stacks again. I look at regulation
- 30:06requirements as requirements aspects and then you look at
- 30:09these regulations D1 test biometric differences or any
- 30:14other, luckily they care about and then you start implementing
- 30:16that in your specs. This secret test cases, that's
- 30:19your model identified failure modes and then trained against
- 30:23only these specs. So we're trying to eliminate the
- 30:26shooting in the dark kind of process in the training.
- 30:28So it starts from there like these three of relations are
- 30:31requirements. Isn't he?
- 30:33After that of you're done this, it's so easy to create specific
- 30:36reports for them basil, you have already there the results.
- 30:39You create specific reports and custom Force for these
- 30:42organizations. It's a common problem that their
- 30:47regulations thing that gets we started with actually areas that
- 30:50are heavily regulated because the need hear their story.
- 30:54They are looking at testing to be able to answer these
- 30:56questions. There's that pain that you were
- 30:59talking about earlier and how you see ya the different it
- 31:03being reflected in the business. So I want to change gears a
- 31:08little bit. Well I mean it's not completely
- 31:10off topic but one thing that testing does and we spoke about
- 31:15before Is identifying failure modes, and yes.
- 31:19So I wanted to dive a little bit deeper into that.
- 31:22And how does testing identify these failure modes and get this
- 31:28granular understanding of the Model Behavior for each
- 31:32scenario? I'm sure this is a that's the
- 31:36core of what everything would promising is.
- 31:39At this point, you want to share some slides.
- 31:41I put couple slides to answer like to give a background of
- 31:44what this what failure modes are?
- 31:47Yeah, throw it on for sure. Yeah, this is actually they're
- 31:50like we start with this and that's a failure mode.
- 31:52Like, well, it's from our previous example, like I should
- 31:56we have, we were building a compact gun detector and we used
- 31:59the luckiest and months improving the statistical
- 32:01evaluation metrics that we have and then we can Up with like a
- 32:04model of 99% accurate, on the corner of F1 score and then we
- 32:10did not find like we put it in the demo and we that gun was
- 32:13that clear? And then we missed it in a very
- 32:15easy case. And that is a failure mode that
- 32:17was hidden but did not understand that this was a film.
- 32:21Would you just assume that 91% that's missing, is probably the
- 32:24rest of the most, a staircase and we didn't notice that.
- 32:29And then the problem here happens again, goes to the
- 32:32failure modes, you were not able to identify Five failure modes
- 32:34long as we're using the current evaluation processes, which
- 32:38basically if you look at it today, we have some Benchmark
- 32:42data sets. We keep making it larger include
- 32:44increasing into it. We run emphasis, and we spend
- 32:46days or even weeks in some applications trying to
- 32:51surrogate. Errors are gaps and evaluating
- 32:53the model. So yeah, we're currently at the
- 32:55current evaluation process. We Run emphasis on large,
- 33:01arbitrary created, Benchmark sets and then we spend days or
- 33:05even weeks staring at their charts, try to understand the
- 33:08model performance. And then that involves a lot of
- 33:11images like floral or data samples to look at the failures.
- 33:15If you have a million images in your test set and you feel 1%
- 33:18that's 10,000 images, right? So you can understand everything
- 33:22and write down notes and so on create reports and then you at
- 33:24the end you you just produce some magical Global metric,
- 33:28right. Then doesn't tell you exactly
- 33:30what's happening. So this is the world that we
- 33:32live in today and biscuits value in teams that want to evolve in
- 33:36the quality side. These just document this Summit
- 33:40somewhere and then try to manage that somewhere and then you see
- 33:43here, two main problems. These Frozen benchmarks and the
- 33:47global Matrix and this takes us to that problem.
- 33:50Beheading circulation problem, which goes directly to your
- 33:53point about failure modes. So these classes, this like you,
- 33:58Global metrics for the class. They don't like we said, we
- 34:02don't capture the full picture and then the hidden
- 34:04certification problem. Just basically says that these
- 34:06models, they exhibit highly valuable performance for some
- 34:10different subclasses within the class.
- 34:12And then the office of the of the Hidden stratification.
- 34:14People just share the other example from a different domain
- 34:17which is x-ray. Just x-ray images.
- 34:20They have been measuring this blue curve is the curve, which
- 34:23is the aggregate or the global metric, only to find out that
- 34:26they slice. The curb out of a slice of they
- 34:31care about is that green slices, which is noches doesn't vote
- 34:36suggestions. So that was failing silently and
- 34:39the same gun examples and this applies to every domain and demo
- 34:43site. So to your question, limiter is
- 34:45the problem in identifying failure modes happens and the
- 34:48way you are managing your data, we want to take a test case
- 34:54approach in managing the data. So I'm going to skip this but
- 34:57this is basically Lee what we're pushing for.
- 34:59We are pushing for a paradigm shift, from a world that we live
- 35:04in today or that involves a lot of large benchmarks arbitraries,
- 35:08like data into more of a fine-grained well-curated test
- 35:13cases. So in the gun example here,
- 35:14instead of throwing a lot of gum examples there, just stratify
- 35:17those in the six or seven of the start.
- 35:20You got here by say, hey, I'm building this product.
- 35:22I want to be able to identify a gun in empty bin like what we
- 35:24had and different views and you add to that.
- 35:28Front camera conditions and sensors because that affects
- 35:31family there in your natural performance, and then you have
- 35:35the what we like to say that high resolution test results and
- 35:38then you're able to compare models and in different runs
- 35:41based on these criteria that you care about.
- 35:44So if we are from looking at this Global metric, we had a
- 35:48model that had ninety six point. Eight percent that improve 299.
- 35:52We deployed the 1990s because that's all we know what.
- 35:55If you look here, we found out that we pushed We made a push
- 35:59when we are going from A to B to improve on the occlusion side
- 36:02and we have regressed an easy case out of the area.
- 36:06So that is what I meant by fit. Failure mode, the funding
- 36:09pass/fail criteria. We thought it's a hard thing to
- 36:11do. It's not that hard.
- 36:13It can be done and that is the only gate.
- 36:16So a fully automated workflow. We never deployed without.
- 36:20Yeah. Right for just a heads up for
- 36:24the people that are only listening.
- 36:25We've got two different columns here.
- 36:28And you see Model A which is actually a lower accuracy but it
- 36:32ticks the boxes more than model B which has this 99% accuracy
- 36:38but it's actually failing quite significantly on more of these
- 36:43boxes like the gun in the empty bin or in the the different
- 36:50except of you that you're testing for, right?
- 36:53Yeah, absolutely. So.
- 36:56And then with this, if you look at that approach, let's talk
- 36:59again about why this makes everything above and Upstream
- 37:02process less or it is training less.
- 37:05So on now as at the simplest form of it, if you have a fleet
- 37:08of models which we always have to have tons of models that
- 37:11we're sending and then don't just have them sit on their AWS
- 37:14bucket or gcp bucket. Now with the just run emphasis
- 37:18and store them on: and now you have a new scenario you have a
- 37:22new customer the same this and be clear about their environment
- 37:25has Types of sensors and these types of scenarios, then you run
- 37:29all your models on this scenario and then find the best to
- 37:33deploy. So you in many cases we've seen
- 37:35that, you don't even need to train a new model.
- 37:37The idea of having one General model that is great at
- 37:40everything, it's really painful. And then you find yourself
- 37:43playing like a whack-a-mole like you crush a bug and then you go
- 37:46ahead and pop comes up. So what we ended up doing is we
- 37:50said okay this model is great for demo.
- 37:52Demo is a controlled environment.
- 37:54Let's make let's give customers. Great.
- 37:56Deals first and now another mother's transferring was okay.
- 37:59This types of extreme issues of this model of this kind of
- 38:03sensors have this event. You don't have to build a model
- 38:05that is great for all sensors or great.
- 38:08For all scenarios. Have a few months and then on
- 38:10top of that, you can even end up being having an example of
- 38:13models, of our greater different things.
- 38:14So, the mindset of building Animal product completely
- 38:19changes from the mindset of what we have today is that lust, with
- 38:22more data. Let's make this model brilliant
- 38:25that every And then I want to show like this is nice thing
- 38:30here. Is that is what the workflow
- 38:31looks like we're looking at. This is what you call the test
- 38:35Centric, development or production, ml.
- 38:38We start with the, with this product specs, it has to be,
- 38:41what are you building for? Let's write the product specs
- 38:44and create these test cases. And then when you click this
- 38:47cases, test them, and then you start here, improving on it,
- 38:51like the symbol training data, and train, and test assembled,
- 38:54translate and train, and test. So it's all All like, this is
- 38:57the Target that you need to find the target before you take a
- 38:59swing, right? So we set the Target right here,
- 39:01and you keep taking swings until you're ready.
- 39:03And then when you observe a bug in production, go back to your
- 39:07test, create the test cases, like this mug again like the
- 39:10gun, somebody that we saw create a test case, that's your models.
- 39:13And then assemble because the solution, we what we end up
- 39:16doing today, is we have a problem, let's create more
- 39:20training data, more training data, and then to test.
- 39:23Whether the model is good at is not.
- 39:24You need tens of probably. Just like to train a model in
- 39:28snow, you need much much larger data, so and then the solution
- 39:31is not always, let's get more data.
- 39:33Could be tuning, could be augmentation could be different
- 39:35things. So training the the collecting
- 39:38data and labeling is a very expensive piece, very painful
- 39:43and it's always solved at the labeling peace and automating
- 39:46the level in peace. I believe that it can be heavily
- 39:49reduced by working backwards from the goal and going through
- 39:53the door with their life cycles. So for example, interesting and
- 39:57again I'll just for people that just listening to this.
- 40:00So presented here is like an animal Productions or
- 40:02development workflow. The steps through getting your
- 40:06business of Jason respects through to then create some
- 40:08tests and and then yet testing of almonds and shipping in so on
- 40:12and so on. But it has too much feedback
- 40:16modes. One is the one you, you
- 40:17typically see in these kinds of diagrams of, get your training
- 40:20data, trying to models, test the performance and feed that back
- 40:23into you here sort of threshold. And then but the other loop is
- 40:28probably unique to this diagram from my perspective.
- 40:30Anyways, the sort of once you've deployed a model to production,
- 40:33perhaps you look out for Boggs to identify and then go back to
- 40:37create tests to catch them and and so on and so forth, which I
- 40:40think the really interesting way to do this.
- 40:43But that one thing I wanted to ask and it kind of inspired by
- 40:46the the diagram with the test case is was this.
- 40:50I can see this working its kind of, after the fact a little bit
- 40:53though, is there a way to identify Defy scenario.
- 40:58I think I know the answer to this but I guess the only way to
- 41:00identify scenarios he's through. Some really vigorous
- 41:04brainstorming like up from or through experience and domain
- 41:08knowledge and expertise it, there's not another way doing
- 41:11that that's quite natural is that that's exactly what it is.
- 41:14And this is where the knowledge base comes in handy.
- 41:17You have to go through this, it's either personal experience,
- 41:20or like, for the product manager or they're the team that is
- 41:23unseen. Paul comes from iterating Over
- 41:25the product. Either way, after some time, you
- 41:28are learning more about your domain.
- 41:29Even if you are working the same domain, but different types of
- 41:32customers is completely, like, yo, you don't understand exactly
- 41:35what you're testing for. So we believe that everything
- 41:37starts here either. The product specs for the test
- 41:40cases, test cases of, when I have a new in new data
- 41:43scientist, joining the team. First thing is like look at the
- 41:46test cases that we have and look at the history of models.
- 41:48How we improve that we will always been good at these
- 41:51scenarios. We don't we can us, but we
- 41:53always been bad. And then you start managing, you
- 41:55know? The whole biggest problem I hear
- 41:58about ml is, how do you product manage it?
- 42:01How do you always ask them all team?
- 42:03And they tell you, it's an iterative process maybe in some
- 42:06time which the right food. So like this, it's a painful
- 42:09process, but we want to make sure that the cell is like a
- 42:12software engineering product. It can be product managed.
- 42:15You can say, we see our customers saying that, okay, in
- 42:18there are okay, are the next quarter will go where you need
- 42:21to improve on these five scenarios.
- 42:23Make sure I am not regretting what we have.
- 42:26When you're actually incrementally systematically
- 42:29improving. And every time is actually
- 42:31leading to real Improvement towards the target, which is the
- 42:36product or the customer I really love that is over because it
- 42:40again puts the end use of right at the very core of what, people
- 42:44perceive it to be a very techie process.
- 42:45But actually like that feedback from the expert, the end user
- 42:48insights becomes even more important.
- 42:51In addition to puts the customer the end user, which the product
- 42:56and business team heavily involved in the process, this is
- 43:00where we have to look to the. The point is, if it can't be
- 43:03just that Dev tool. We, if you want to build animal
- 43:05testing, we believe that everything starts from that from
- 43:08testing. So after building a UI for and
- 43:11some executive dashboard and manager dashboard to manage,
- 43:14even the team's performance of this is like a version of
- 43:18Deathstroke last year, I kind of think to be able to manage these
- 43:21test cases and all the kind of stuff that we jump through
- 43:24tools, as data scientist all the time and to go to teens and
- 43:28children change what you're doing.
- 43:30We have to make sure that southern hate everything in.
- 43:33There's as much easier than having to jump through different
- 43:35tools. It's so cool.
- 43:38I love seeing this. And so, there is one thing, I
- 43:41think we should probably highlight to.
- 43:44You've been talking a lot, about computer vision examples.
- 43:48How does this differ when it's on structured data?
- 43:53And of data like what, what are the big things that you see?
- 43:59It's easier just to turn my skin off.
- 44:03So it gets a little bit easier and in Text data table data, not
- 44:10obvious. But the problem the biggest
- 44:12hardest is why this what we're talking about is not
- 44:15implemented. We talked to hundreds of people
- 44:17of teams especially last year and for that the biggest pieces
- 44:21like how do you Mid this, paradigm shift from these data
- 44:25sets into scenarios because you, you can collect for these
- 44:29sliders. But usually, this is not the
- 44:31starting point, as you starting today.
- 44:33When we have millions of images in the test set, how do I
- 44:35stratify that? Now, what our solution for this,
- 44:38we not a image retrieval system or we like to look at it as More
- 44:43Of A recommender Plus image retriever system that you'll be
- 44:46able to search for scenarios. Like if the three of us are
- 44:50looking at our women were here, the recession chemistry.
- 44:52Data. Look at an adult with a beard.
- 44:55Probably the three of us will come up and then I'm going to be
- 44:57adding headphones. Only, I will come up, right?
- 45:00So basically, you're able now to search your data, for for the
- 45:04exact scenario is you're looking for and then there's a lot other
- 45:08piece of in that studio test case study, we had a whole piece
- 45:12for 40% of our product, is that this this studio, it's a secret
- 45:15as a creative space. You will go in there and then
- 45:18play with the images stratify augment at, you know.
- 45:22It kind of more scenarios, I'm doing create a test case for the
- 45:26minutes. Now that is much easier in text
- 45:29searching, text is much easier. Augmented text is much easier so
- 45:33creating these and even lower computational cost as well.
- 45:37So we started with vision because we believe that is the
- 45:40hardest problem. We are spent most workers in
- 45:42this area. We actually are building our NLP
- 45:45product will be out by March and it's we seeing as it's the test
- 45:51case. ER is the same being able to
- 45:54manage and version test cases and Pad mode and edit and so on.
- 45:57But being able to the studio is much easier than going with
- 46:01images. So the structured data like
- 46:03tables and Text data is easier to go through stratifying peace.
- 46:11Sweet. I can't let you leave here
- 46:14without you talking about your book because I think that's how
- 46:18I first started like following you and I found out about you
- 46:23can we go into that a little bit and just tell us like so the
- 46:26book is for anybody, that doesn't know.
- 46:28It's machine learning for vision systems.
- 46:30What what can we expect there besides?
- 46:34What is on the tin? Yeah.
- 46:37Yeah. So the book is called Deep
- 46:38learning for vision systems. And it starts after you have
- 46:42understood what the machine learning goals for workflow,
- 46:44looks like and the story of this happened like again, few steps
- 46:49before I was at Amazon and I was at the Kindle organization.
- 46:53I wanted to work on the ml side. I found a gap in the CV Gap and
- 47:00inside there was back 2014 2015. I found a gap here in be and
- 47:04having dark a CV Authority in the organization.
- 47:08So I built I found the car and organization CV think tank for
- 47:13four different teams and Amazon to start with that to start
- 47:17building a team. It's, you know, how hard it is
- 47:19to higher energies was much, much harder back then.
- 47:21So my Approach was. Okay, Amazon has a organization
- 47:25called mlu machine Learning University and it's for Amazon
- 47:29Engineers. So, I kicked off a course and
- 47:32the Seedy side and I we had like 30 engineers and room and then
- 47:36we started with 55 of those like, after a couple months and
- 47:39read that was Heat of the team. So the Project's initially
- 47:42started as that and then from creating the a lot of material
- 47:46for and I work with the dusty and creating a monell degree and
- 47:51and telling different organizations.
- 47:53So, from creating a lot of content, I realized that the
- 47:56have it's all told in from one angle which is same workload.
- 48:03They're trained test and deploy, but there's a lot of and then
- 48:07some other heavy on math summer are heavy on applications and my
- 48:12belief is math. My belief is like the you don't
- 48:16need. You need a little bit of math
- 48:17just to understand what's going on.
- 48:19So I don't like you. I don't want to admit it but you
- 48:22don't need to take a calculus course or some kind, of course,
- 48:25it's always starts with my pack plus 101 or linear algebra, 1 0
- 48:291. So, I inserted this math, it's
- 48:32very practical book and I wanted people to understand this map
- 48:36pieces for one goal to be able to It and Implement research
- 48:41papers. So all books are going through
- 48:44explaining Concepts. I was trying to train the
- 48:48readers to learn on their own. I have a full chapter after I
- 48:51explained these fundamentals I have a full chapter just going
- 48:55through maybe like seven or eight papers one by one, their
- 48:59second them and creating the coach for them just to after
- 49:02that because you understand that ml just evolving heavily the
- 49:06books, you get obsolete fucking a couple years and the goal
- 49:09here. It is not really to share
- 49:10information. It's more to teach people each
- 49:14Engineers, how to go ahead and learn on their own read papers
- 49:17and stay up to date with the confirmation.
- 49:19So hopefully to answer your question Demetrius.
- 49:21Hopefully after reading the book you'll be or others be able to
- 49:27go ahead and read any paper as much as they can and then being
- 49:32able to implement it understand what they're talking about and
- 49:34implementing code. So cool.
- 49:37So we'll leave a link to the book.
- 49:40If anyone wants to get their hands on it and mow, this has
- 49:43been amazing. I love talking to you about this
- 49:46new paradigm. The new idea of him.
- 49:50As you do not like to call it tdd.
- 49:53That is a bad word in your it's a four-letter word, I guess.
- 49:59Yes, test Centric, development. It's so cool to hear about all
- 50:04these different ways that people are.
- 50:06Talking the problems and how we're trying to evolve the space
- 50:10that we're in right now. It's obvious, that there is a
- 50:13lot of pain in this space and it's obvious that a lot of
- 50:17matured maturing needs to happen.
- 50:19So that's why I wanted to get you on here and talk to you
- 50:22about how you see this, maturing and evolution happening over the
- 50:28next two to five years and it's been great.
- 50:32You definitely tick the Box on that one ice I appreciate it and
- 50:37Adam, thank you for coming man. As always it's a pleasure.
- 50:40Having you here co-hosting with you?
- 50:42No, thanks very much and good night.
- 50:44I've kind of just read a lot of stuff about you're deploying a
- 50:46know, engineering guidelines, and I have to rip.
- 50:49So that up, I think and revisit some of this testing stuff.
- 50:53Oh, that's how, you know, it's good man.
- 50:55That's how you know, it's real good.
- 50:57So you made you think about it again.
- 50:59Sweet Muhammad. I appreciate it that we're gonna
- 51:02end it here. That's good conversation.