说明
主要学习内容
- Learn about the history of machine learning
- Learn how to use machine learning in building design and construction
- Learn how to use Dynamo as a machine-learning platform
- Learn how to code up your first machine-learning algorithm in Dynamo
讲师
- Mehdi NourbakhshMehdi is a Research Lead at Autodesk Research. Being part of the AEC Industry futures team, he is passionate about working with leading AEC companies to bring future technologies to the hands of Autodesk customers. Currently, he leads an AI studio in San Francisco, focusing on the future of AI and machine learning in AEC. He holds a Ph.D. in Design Computing, and a master's in computer science. For several years, he worked as a structural engineer and a construction manager in various AEC projects.
MEHDI NOURBAKHSH: Let's get started. How many of you have used machine learning before this class? Raise your hands. Only one and half. That's strange. All right, how many of you have trained in machine learning model before? Again, one person. Let's stop here.
First of all, thanks for coming. The goal of this class, really, is at the end of this class, you will be able to train in the machine learning model on a piece of paper. How cool is that. And hopefully when I ask the same question, everybody will be like, yeah, I have trained in the machinery learning model.
I'm Mehdi Nourbakhsh. I'm a research scientist at the office of the CTO at Autodesk. If you want to reach me, it's my first name dot last name at autodesk dot com with all your difficult machine learning questions.
Let's get started. So what do we do at the office of the CTO? What is all of this research doing? Basically, we have different teams inside the office of the CTO. And these teams are working on different research topics, from AR/VR, to machine learning, to simulation and a lot of other cool topics.
When we want to do a project we really have a tag team. We put our teams together to be able to do some of our complicated projects. So this is a little bit about the office of the CTO.
What I've been doing in the office of the CTO in the past three years-- we came up with the idea of generative design. And our mission in the office of the CTO is that? We need to go beyond what is available today and think about how designers, engineers, and? professionals all design their things in the future. And we try to build prototypes and test out those prototypes.
People are like, oh I really like your job. Coming up with new ideas is great, but actually doing it is really hard. This is what we do. So generative design, we started it four years ago, and now it's becoming part of Autodesk offering.
So this is kind of a workflow if you don't know. You come up with the high level goals and constraints. We thought in the future, designers will not extrude an object or do some low level operations. They define their goals and constraints.
AI machine learning will generate lots of solutions for them. They can explore and manufacture. This is a simplified workflow.
I was also working on the Hack Rod project. If you were at AU last year, this was the car that was coming out of Dreamcatcher. I was working on the algorithm behind this car. It's a generative algorithm that can generate geometries like this.
Anyway, so why do I do this class? Some people are like, Mehdi are you crazy? Well, it really goes back to where I'm coming from.
A little bit about my background, I did a bachelor in structural engineering, then I started working. I got bored. Who does structural engineering with calculators? And then I moved to construction management for my master's. And I worked three years as a construction manager.
And I got bored. And everything was manual. And I didn't like it. And then for my PhD I went to Georgia Tech, doing a PhD in building construction. And at the same time, I did a master's in computer science.
That was the time that I felt, oh now I know how to make stuff, digitally. And this is where I got introduced to machine learning. And what I see these days is that people have a fear of machine learning. When you don't understand something,
[SIDE CONVERSATION]
You might be afraid of, oh machine learning comes and takes our job. And my goal today is really to send this message that machine learning has been here for a long time. It's not going to take everybody's job. It's very understandable.
It's not magic. It's not scary. And hopefully at the end of the class, we all have the same understanding. This actually is a very interactive class.
So I've been in the education business for a long time, and I have a theory that if the speaker talks more than his students, that's not a good class. The students should always talk more than speakers. And we're going to practice this here. That's what all of you have a paper.
One piece of good news, the machine learning library that we wanted to use in this class, they installed it and it doesn't work. But I predicted that, so don't worry about it. I got this. So this is the content. This is what we're all going to learn today together.
A little bit about a machine learning history, application of machine learning, some terminologies, and different types of machine learning, machine learning process, algorithms, which we cover-- We're going to cover decision tree and neural network, depending on how much time do we have. And we're going to wrap it up. OK, somebody in the class please define machine learning. What is machine learning that is taking over? All right.
AUDIENCE: Letting the technology advance on its own behavior.
MEHDI NOURBAKHSH: Letting technology to advance on its own behavior. Great, what else?
AUDIENCE: An algorithm that is able to learn by itself.
MEHDI NOURBAKHSH: Say that again please.
AUDIENCE: Should be an algorithm that is able to learn by itself.
MEHDI NOURBAKHSH: Algorithm that wants to learn by itself. So first of all, there is not a single definition of what machine learning is. There are many definitions. Some people think, OK machine learning is learning by example, so you provide lots of examples. And this algorithm will learn based on the examples.
One of the kind of formal definition, back in 1959, that I wrote here, is a field of the study that gives computers the ability to learn without explicitly being programmed. So this is Arthur Samuel back in 1959. Can you believe this? It's been around forever.
But there is a diagram here I want you to be aware of. And that is, when you think about the universe of machine learning and AI-- so AI is kind of a super set of everything. There are generating algorithms. There are different algorithms in the context of AI. The machine learning is a subset of that.
Some people say interchangeably use AI and machine learning. And that's not quite right. And deep learning is a subset of machine learning, one of the techniques in machine learning. All right, this is a little bit of history. I really don't want to spend too much time on the history.
It goes way back. In 1951, Marvin Minsky built the first machine learning neural net calculator back then. '56, AI was introduced. '64, there was a natural language processing computer program. There were some AI winters when nobody was working on this stuff, machine learning, except in Canada. Pretty persistent people.
Rule based expert system back in the 80s. In 1997, Deep Blue beat Kasparov in chess. Wasn't really in machine learning, but brute force, basically the power of machines. And Watson wins Jeopardy back in 2011. Deep learning became trainable in 2012.
And since then there are a lot of more researching in this area. So I asked you whether or not you use any machine learning algorithm or platform. And this is actually the topic of this slide.
So I promise you that this is going to be interactive class. And we intended you for get to know people, so introduce yourself to your partner. And discuss how you use machine learning in your day-to-day basis. OK, you have one minute. Write it down on your paper. I want to see that now.
Is this seat available? We have a seat available here. Do you want to sit?
One seat here. There's another seat there if you want to sit.
All right, all right, one minute is over. All right. Excellent. Excellent. Great. All right, so some answers from that corner. Answer?
AUDIENCE: Voice recognition on your cellphone.
MEHDI NOURBAKHSH: Voice recognition on your cell phone. That corner.
AUDIENCE: Netflix.
MEHDI NOURBAKHSH: Netflix. This corner.
AUDIENCE: Amazon shopping.
MEHDI NOURBAKHSH: Amazon.
AUDIENCE: My Nest Thermostat.
MEHDI NOURBAKHSH: What? Nest thermostat, great. Center.
AUDIENCE: Facebook ads.
MEHDI NOURBAKHSH: Facebook ads.
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Do you guys have my slides?
[LAUGHTER]
All right, all right. So in face recognition. In evil that is on your phone now. In all of these apps. You Netflix recommendation system, Uber, Google Map, whatever, advertisement agents, spam.
But what about building construction? Isn't this why you're all here? All right, so let's hear from my dear colleague, Charis, about application of machine learning in AC. You can give him a round of applause.
CHARIS KASKIRIS: Hi, it works. Excellent. Oh, yes.
MEHDI NOURBAKHSH: So down goes next. This is reverse.
CHARIS KASKIRIS: So hello, my name is Charis Kaskiris. I am a principal data scientist in the BIN 360 IQ team. BIM 360 IQ is a team that effectively takes machine learning and applies it to data that is generated by construction processes. That means from pre-construction all the way to building operations and places in between. And what we try to do there is extract knowledge that can be leveraged by the different faces in construction to mitigate risk-- first of all, understand risk-- mitigate risk.
And then at the same time, we also try to use technology for assistive technology. We are building assistive technology that actually helps you capture better datum, cleaner datum, enable processes that can actually help you create more efficient construction processes themselves. Unlike the office of the CTO, the team that we have-- and we call ourselves data scientists-- we come from machine learning backgrounds and artificial intelligence. And also people that actually have mechanical engineering backgrounds and software engineering backgrounds.
So it's in our constitution of the team that we actually work with people who have topic expertise, like construction, civil engineering and so forth, and then people who actually have dealt with AI and machine learning in different industries before. And that's the areas we work on. Our horizon of thought is really different from Okto. Okto deals with a five year, 10 year time horizon. We try to solve problems now, for today, trying to leverage technologies that have been implemented through research.
So today I'm going to take you through some examples of different areas of application, we have used different types of machine learning, one of it is generative design, the other one is risk mitigation, examples in job site safety, and then also jump into project management, which is one of the newer areas that we're working on. So generative design, as Mehdi mentioned earlier, generative design is can we give, effectively machines, constraints of what we want or aspirations of what we want to achieve and just let them go and design different potential ways of getting there?
So one example of this was we are building a new office. We have the space. How do we structure the inside interior of the building of the project space, so that you can actually fulfill the requirements of the inhabitants of that building, which is the employees. And also, how do we optimize the space in a way that allows us to achieve things like collaborative spaces?
How much sunlight do we want to have in there? And how do we constrain-- to navigate it and so forth? So the idea there was take the model of the floor itself, give it effectively different types of requirements, what we desire to have, those in a sense are effectively objectives. And then pump it through generative design modeling that basically generates multiple models on how to actually design the space.
Now the way we have done this though is not just by how we collect these requirements. We talked to the actual people who are actually going to use this space. So we collected different information of what we want to be able to do, how much sunlight do we want to have, where do we want to create collaborative spaces. In a sense, a collection of requirements of what do we want this space to create.
And then running through the generative algorithms, and these are, in effect, a sample of the many configurations that came around on how do we configure this space so that it provides the objectives that we want to achieve. And ultimately from here, the humans come back into play and say, OK this looks like a good design. Make selections from this. And move to the next part of the actual design of the space.
And this was the actual implementation of- what has been achieved. It was predominantly-- how the information was collected along the way. You say, how do we work in the space? Yes, I already talked over it.
OK, so moving to another area of application, which is something that our team has built, is in risk mitigation. Construction-- these three critical things are always in play. This is a lot of subcontractors working on a particular construction site. I think I've been to a construction site that on the particular day they had 1,000 people on the premises working.
This creates along the way, multiple, open issues. This could be quality issues, safety issues, and so forth. And then the other part obviously with construction space is that you never step in the same construction site the next day because it already has changed. So your environment is constantly changing. Change is the way of construction.
So what ends up happening there is that there's thousands of issues that you have to deal with on a daily basis. And of course, not every issue is created equal. Some issues are more critical, or they are more severe, or they can have a lot more larger impact into the project being successful or not. And how do you actually make decisions. How do they prioritize the issues that they need to resolve on a daily basis.
So what we have done with this is we have actually built machine learning algorithms that sift through-- this is what happens, data has been collected into applications that are high quality, for example BIM 360 field. So we have all these issues in there. But nobody put in there and says, oh, this is a highly risky or a high severity issue. And nobody has gone in there to say, oh this issue is actually a water related issue that could potentially have a large impact on if it's not taken care of.
What we have to do with this and this part of data quality, is that well, we can take this, sift through the text, build algorithms that understand text, and from the text we can detect what type of issue it is. We can also detect if it's a water related risk issue, which means it doesn't need to tell us it's water, it can tell us that something that hasn't been sealed can potentially lead to water damage. So the models are broader in a sense. And in that way we can actually go through and categorize the different issues.
We can also detect how severe they are. And then bring that information out, first, part one. And then how do we take the timing of this event, the accumulation of these events, and understand risk in the construction site today, based on the number of issues that we have. And which issues are more severe that need to be addressed. So these categories that we actually determined, has always been in collaboration with humans, and more precisely, with expert humans, which are you.
So a lot of this work has to be done by having humans identify first, what these issues are, and then use machines to replicate that knowledge. In a sense, every single one of us can, in their life, see I don't know, 2,000 issues, 3,000, 4,000. We looked at 35 million. So in that sense, machine learning is betting on the knowledge of many people like you, which I thought I should put there.
So an example of what we have tried to do with this is that as we understand what issues are open and they are way open too long, or they are not addressed in a timely manner, create a risk for particular subcontractors and also create a risk for the project itself. Now, we use a type of technology, a type of approach that is called evidence-based, which basically means that when I built the machine learning model and I tell you, oh, there is high risk today.
And these are the guys that are creating the risk. I also drive you through and say well, this is the actual issues these guys are generating. That is telling me that these guys are the risky ones of them all. I skipped that part.
So it's basically-- I'd say, oh, [INAUDIBLE] concrete has high risk today and this is the reasons why it has higher risk, which as Mehdi will describe later, is features. He basically says all characteristics, if you're in the language of financial side. So they describe all this is why this subcontractor is risky.
But then you can drill through it and find the particular issues that pop up. And then you can actually address the issues themselves. But this way, you can effectively go to the subcontractor. Talk to them. Resolve these issues.
Also, at the same time, there is another aspect of machine learning which we call interactive machine learning. In effect, I should describe it as respect the expert. In a sense, machine learning and the expert, which is you, need to work collaboratively. In a sense, we want to build trust between you and the machine learning. And also we want the machine learning to trust you that you're not trying to game it either.
But in this particular case, the way we deal with it is, that if you disagree with what classifications the models have generated, you can go in and change the conclusions. And it would propagate through and change what the risk levels are. Now, you cannot change the risk level itself because otherwise you would be gaming the system.
And if you're a subcontractor, you could be gaming your own ratings. But we do allow the experts to go in and change what the machine has said. Now, the interesting part with that is that we take that knowledge, feed it back into the models, and we build a new model. Now this new model has more expert fusion of knowledge into it, which is provided to us-- people who work with the technology itself.
I'm switching gears. That was on the aspect of quality. On safety with did something very similar, where we actually sift through safety issues.
Everybody in construction knows that safety is very important. What we are trying to elucidate here is how can we understand safety behavior on a construction site. And by sifting again through the text of the different safety issues, what we have tried to do was elucidate the risks and the hazards.
In a sense, in the text, what kind of risk is it? Fatal four. We look at faults, caught in between, electrocution and stuck by. We put fire in there too because we actually observed there were a lot of fire related issues across the board. So we said just put that category in there. In a sense, if you housekeeping stipulate it like that, you leave a lot of combustible material and that can actually lead to fires.
So this information is not really provided in the applications themselves, but is extracted from the information that is in the text of the descriptions of the issues. And all of them are actually generated by safety programs that are instantiated in checklists. But this way we can actually show you that, hey, these subcontractors have a lot of fall risks.
Why is that? Who do you need to go talk to and say, hey, too much fall risk, what's going on? Or in a different sense, look into hazards. And then you can actually see that in your particular project there's different levels of hazards that you are experiencing. So then that can actually guide your safety program or your safety talks on that particular project.
Another area that machine learning can help with safety has to do with well, it's beyond just collecting issues because if you think about them-- to use a little bit of Latin-- is ex post facto-- It's like the event happens and then we record it. So in a sense, it's always looking backwards. So if I report the issue and I said this person got injured, it's not preventing it. It's basically helping us to prevent the next one.
But there are technologies that can be used to prevent the actual events, in a sense, in a reactive manner. And that's by collecting information that is live at the point of capture. There's a lot of information, and photos that can come-- effectively using photos-- they can come from security feeds, they can come from cameras, from scanners, from drones, and so forth.
I wanted to also mention some of the collaborations with companies like Smart Video that we have. Part of it is that as you take a picture or, in a sense, in a video stream, you can detect if there are humans. You can also detect where are they, where is their altitude, if they're on a ladder, or are they above a certain level, if that makes them a fall risk. They can also start detecting if they are touched or not. And then that can create alerts that can help you detect them at the point in time they're actually doing the activity they are in.
And then of course, that helps as you generate a bunch of pictures to be able to extract that information. Again, in the same way we track issues, we can track pictures. And we can pull the information up and say, you have a lot of fall risks, but the information could be coming from checklists or it could be coming from pictures we have collected. Now what can happen if we actually combine these things together.
So if we combine these tools together, effectively that allows you to have applications that in real time as you take pictures, they can classify what is going on and tell you, this is a risk, you need to take care of it now. But you can also propagate across to the rest of the team that basically says the subcontractors, at the site, they are doing this right now. Take care of it.
And the idea behind this was basically you have it on your phone. You can take a picture. The picture gets processed. That allows us to detect, hey there is a human is on the ladder, he's above the threat trestle. Then you can actually have a machine learning immediately go through and say, oh, I can actually create auto text that describes what is going on.
So you don't have to do input. And then basically what this allows you to do is take a process of data capture that was very manual and very tedious, that you didn't really enjoy doing, which means you are not doing it as often as you should, and flip it on its head. And say OK, can machine learning help us capture cleaner datum.
And very quick in the project management aspect-- so what we have started with is basically this-- project outcomes, we dealt with quality and safety, but ultimately what we want to be able to do is what do we learn on the construction sites that can go back into what's going on in project management and go all the way back to the design phase. And the linking point for us is RFIs and change orders. If you think about it, RFIs is like a complaint station.
Oh basically, here is a process-- what I'm going to build. I went to build it. Oh, I don't know what's going on. You didn't explain it. Oh, there's conflicts.
RFIs can guide us into building better documentation ahead of time so we have less documentation in the real environment when you're actually guilty. So that's the areas that we are dealing with. We have millions of RFIs that we're going through. And the idea again, there is, can we make the linkage between project outcomes, quality RFIs, and then guide us to what do we push back to the design phase so we can actually streamline and reduce risk across the board.
Oh, wrong button. If you want to hear more about this, our team is presenting tomorrow. There's two sessions. One of them is at 8:00 in the morning, I apologize. This panel and the AI one, there is discussions from clients that we work with on implementing and working on these projects that can give you a little bit more understanding of how do they actually utilize them in real environments.
MEHDI NOURBAKHSH: Great, thank you very much. All right. So these are some of the applications of machine learning that we actually are doing it right now. It's available in BIM IQ and you can utilize those. It's completely available.
So OK, this is what we're going to do. Hopefully at the end of this class, you will learn how to make your own machine learning application, all right. To do that, let's go over some of the glossaries or terminologies that we have.
So this set of four, right here, is hard for me to see, is data or sample, variables, attributes, or features, feature vector, and input and output. So what you see right here is-- let's say a construction company comes in, and he says this is the data they captured. They have outlook, temperature, humidity, and whether or not that day was windy. And then this is the last one, construction, is whether or not construction happened that day.
All right so in some days we had the construction going, but in day three, construction didn't happen because of the weather. So right now our task is sample or data. This is a table of the data that we have. So when I refer to sample, or sample data, or data, this is what I mean by that. And variables or attributes are the columns-- outlook, temperature, humidity.
These are our variables or our attributes. OK, everybody's with me? Yeah, all right. And feature vector, what does that mean?
OK, so feature vector is the vector of all these features or attributes. So in this case it's overcast, hot, high falls. This is a vector of the feature for that day one. And so these days are observations or objects. So this is observation that you make and you take a recording of that.
So what is the label? The construction site, which is our Y, it's called label. OK, so the inputs are variable one, variable two, variable three, and four. These are the input of our model. And we want to predict the label, which is the output of the model, OK.
All right, so this is what we wanted to do in the end. If a new data comes in, like I'm at day x, day 21, or whatever that is, and the weather forecast has this type of information, I want to look at my past data and figure out whether construction can predict whether construction will happen on that day or not. This is the goal.
So we want to train a model, a machine learning model, or predictive model, that give us this answer. All right, everybody cool? Great. So this is our model-- model black. And the left side is our inputs. And on the right side, this is our output.
And this is our feature vector. The model is actually a function. It's a mathematical function. We want to come up with a function that can give us the outputs, the answer. All right, exercise one, how cool is that?
So I have four observations, or four objects, and I label them, A1, A2, A3 and Y. And talk to your partner and identify what is the sample, what are the features, what's the input, and what's the output. One minute starting now!
OK when you discuss, write it down. Lock it down. Lock down your answers.
All right. Are you ready for a big reveal? So basically, somebody on my left side, what are the samples? Answer?
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Don't worry.
AUDIENCE: The rows?
MEHDI NOURBAKHSH: The rows or the lines are samples, the collection of them, so everything that we have. OK, or our data. This is a table-- the entire table. Features. What are the features?
AUDIENCE: Columns.
MEHDI NOURBAKHSH: Columns, yes, just shout it out, it's OK. What are the inputs?
AUDIENCE: A1, 2, 3.
MEHDI NOURBAKHSH: A1, A2, and A3. What's the outputs?
AUDIENCE: Y.
MEHDI NOURBAKHSH: Y, are we doing this? OK, so, next one. I'm in the back of the room, which is very strange.
So we have two types of machine learning. One is supervised learning and the other is unsupervised learning. What does that mean? So in supervised learning we have the knowledge of output. We know what's going on, construction, whether it happens or it doesn't happen.
But as in unsupervised learning, we have no idea. We have a bunch of data. There's tons of PDFs. And I want to figure out a pattern between them.
I don't know. I have no idea what the pattern-- is there any pattern? I don't know. There's no pattern? I've no idea.
So in unsupervised learning, the data that we have, we don't have [INAUDIBLE]. We know what that is. But we don't know the relationship. And it's not labeled. What is the label?
AUDIENCE: The output.
MEHDI NOURBAKHSH: The output. Remember that. And we want to find the patterns between the data. In supervised learning, it's like we are training our model. We want to learn based on the input that we know and based on the output that we know.
So days of construction, whether it's windy, these are the inputs. The output is construction happening or not. This is supervised learning.
We have two types of supervised learning, classification and regression. If the output is categorized into classes or categories, this is called classification. If it's a numerical output, this is regression. OK. If the output is 1.2, 1.5, we want to have a model that predicts that, we go regression. If there is a class, you go classification.
OK, clear? Next exercises coming. You better be prepared. So unsupervised learning, one of them is clustering.
So we want to cluster our building models. We want to cluster our PDFs. We want to see if there is a relationship between them or not. And based on the pattern, it will give us some recommendations.
OK. So example, talk to your partner-- by the way, this is the most ugliest slide that I've ever designed. I look at them and I'm like, why did I do this? Anyway, so talk to your partner. And give an example of each of these. All right. One minute, now.
Try to do it in building design and construction.
All right. So this is an example that I provide. So what you see under supervised learning on the left side. So we have some images. And the left image I know that this is a commercial building.
And the right image is I know that this is a residential building. And I have hundreds of these examples with these labels. And I want to train a model that, if I give it a new image, it tells me whether it's residential or commercial.
On the right side, I have lots of images but I have no idea what those are. There is no label. It's unlabeled. And I want to see if there is anything interesting there. OK.
Further down, classification problem, same example. The blue ones, let's say they are residentials, and the stars are commercial. And my model shows the boundary between these two, whereas, in regression, I put predicted cost versus actual cost of a construction project, let's say. And there is a model that is being trained to tell me that. So if I give this model the actual cost of a construction project or predicted cost of a project, it's going give me the actual cost of that.
And right side is clustering. It tries to figure out the boundaries between each class. OK. So exercise 1.5, talk in 30 seconds, is it a supervised or unsupervised learning problem. Whether or not it's a classification or regression problem. 30 seconds.
All right. So this site, is it supervised or unsupervised?
AUDIENCE: Supervised.
MEHDI NOURBAKHSH: That site, is it regression or classification?
AUDIENCE: Regression.
MEHDI NOURBAKHSH: Great, like you guys know all about it. All right, so exercise two, what? OK, there's a company that has 10,000 building models. And in their databases, maybe some of you, they've been working either on residential, office space or warehouses. All right they want to categorize their models. So is it a classification problem or regression problem?
AUDIENCE: Classification.
MEHDI NOURBAKHSH: Classification problem. And they seek your recommendation. So when you go back to your office, you will be the AI, or machinery learning, expert. They come to you. And they say OK, what should we do? Option number one, we can hire 20 people and wait for 10 months to categorize them. They should open all the models one by one. Or option number two, use machine learning to automatically-- which one do you recommend?
AUDIENCE: Machine learning.
MEHDI NOURBAKHSH: You guys are smart. But why does it take a month to do that? So in machine learning, it takes a while to train your model and have a model. But once you have it, you can use it forever.
And the most important part-- we're going to talk about it-- is all about data collection. So 80% of your time, you're going to spend on data collection. And the next 20%, or 30%, is more about training and refining and all that stuff. OK.
This is number two. You have one minute. As an expert in industry, advise this company that what should they capture, what are the inputs that they need to capture, or you need to capture, and what is the output of this model? 30 seconds, starting now.
The questions are getting harder.
We need to be fast. OK, what are the inputs? Inputs?
AUDIENCE: The area program.
MEHDI NOURBAKHSH: Area program. What else?
AUDIENCE: Room names.
MEHDI NOURBAKHSH: Names?
AUDIENCE: Room names.
MEHDI NOURBAKHSH: Room names. What else?
AUDIENCE: Frame.
MEHDI NOURBAKHSH: Frame.
AUDIENCE: Materials.
MEHDI NOURBAKHSH: Material.
AUDIENCE: Square footage per room.
MEHDI NOURBAKHSH: The square footage per room.
AUDIENCE: Furnitures.
MEHDI NOURBAKHSH: Furnitures.
AUDIENCE: Bathrooms.
MEHDI NOURBAKHSH: What?
AUDIENCE: Bathrooms.
MEHDI NOURBAKHSH: Bathrooms, great, we need that.
AUDIENCE: Openings.
MEHDI NOURBAKHSH: Openings. So basically your features are the things that you think, as expert, will differentiate these models. Number of rooms-- how many rooms a warehouse might have, whereas how many rooms a office building may have or how many rooms a residential building may have. So these are guesses.
But you as an expert have an idea. I think, maybe number of floors, in residential buildings. This will differentiate maybe residential, plus office space, to warehouse. Warehouses are one or two stories, maybe. The output is--
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Yeah all of these three categories. So now let's move on. This is a very simplified machine learning process.
So first off, you come up with your business question. What are you looking for? What are the assumptions? What do you want to hear?
And based on the question, you capture data. I'm looking for categorizing these models into three different classes. And for that, I need these features. I need to collect this data from each model.
And then you prepare your data. You create a model. You train and validate your model. And then you can reuse it forever.
Today we really focus on that the model training part, but there are other things that is beyond the scope of this class. And this is not a straightforward process.
You always go back. Do this. Go back. Train your model. It is not that good. Maybe we should capture more data or better data. There is always a back and forth between that.
Fun time, this is our break. So, partners, one of you stay, the other, please stand up and switch partners. In 10 seconds. Now. Don't get too comfortable.
Meet new people. If you don't have any partner, find one-- with someone else, with some other teams. Introduce yourself. AU is all about collaboration and connection. 10 more seconds.
OK, so let's move on. We're going to learn our first machine learning algorithm. How cool is that? So I picked one for you and that is decision tree.
Every day in our lives, we make decisions. And what if we can train our first neural network model that make decision for us? Well, you remember this dataset before. And our goal was if a new days come, we want to predict whether construction happens or not.
So how should we do this? OK, take a guess for the first one. In five seconds-- now take a guess inside your head-- does construction happen or not based on what you see?
AUDIENCE: No, it can't happen.
MEHDI NOURBAKHSH: Inside your head.
[LAUGHTER]
If you think it will happen, raise your right hand. And hold it up, up, up. If you think it doesn't happen, raise your left hand and hold it. I want to see how many-- OK, it won't happen. We're about to find out.
So this is algorithm. And you need to train your model on your paper. This is what you need to do. Divide this subsets into-- find all the yes's and no's.
And break down your dataset on yes's and no's. And then if the subset is pure, you're done. If it's not, you're not done. Break it more. Is this clear?
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Oh, yeah I know that. So this is all-- we have nine yes and four no's here. So you see all the reds are no. The blacks are yes.
So to give you more direction, I'm going to break this on outlook. What does that mean? Break on outlook? Hang on there. So outlook-- let's let me go back-- we have either-- on outlook, sunny, overcast, or rainy.
So outlook would be the top node. It has rainy-- sunny, overcast, and rainy. So this is how we break a node. And this is our top node.
Now, in sunny site, we have two yes's and two no's. Should we break it down further?
AUDIENCE: Yes.
MEHDI NOURBAKHSH: Yes. On overcast, we have four yes's and zero no's, should we break it down?
AUDIENCE: No.
MEHDI NOURBAKHSH: On rain, we have three yes's and two no's, should we break it down?
AUDIENCE: Yes.
MEHDI NOURBAKHSH: Yes. Now your job is to pick one of these features. And break it down based on the feature. Our goal is to come up with a feature that gives us the shallowest tree. We don't want to break down too much.
So think about a feature that gives you the shallowest tree, meaning that if I break this down based on this feature or that feature, I'm done. I don't need to further break it down. One minute. On your paper. Discuss.
You guys are doing great. Keep working. Keep working. Unfortunately, we don't have too much time. I wish the class was like five hours.
So on my left side, you're responsible for the sunny. Which node should I break?
AUDIENCE: Humidity.
MEHDI NOURBAKHSH: Humidity. Right side you're responsible for rainy.
AUDIENCE: Windy.
MEHDI NOURBAKHSH: Windy. I'm responsible for overcast. No break. Humidity, windy, this is our tree. Do we need to further break it down?
AUDIENCE: No.
MEHDI NOURBAKHSH: No. So as you can see here, in humidity we have two yes's, zero no's. High, zero, two. So they're all pure. Windy, zero yes, two no's and three yes's and zero no's. We're done.
So now this is our tree. And we wanted to predict the outcome. In 10 seconds, think inside your head, inside, and when I said what the answer is, then everybody will say it at the same time. It's all right. We all make mistakes.
But be loud. All right, ready? 1, 2, 3.
AUDIENCE: No.
MEHDI NOURBAKHSH: No, yes that's the answer. I should show you in-- Let me skip this for now because I'm afraid that I can't cover everything. And since our library doesn't work, I move on for now and then we'll get back to this.
Basically, this is Weka Library. It's an open source library for machine learning. It has all of these algorithm implemented. You don't need to even write a single code.
And you can import your dataset. You can run this classifier, which is J48, and it will give you the results in this text format. So it's very easy to use. Unfortunately, we couldn't make it work on your machines. Maybe next day.
So we're moving on here. Switch partners. This is the last partner switch. So those who moved will sit. And those who didn't move now will get up.
Don't get too comfortable here. You're having fun. OK, that's the goal. Switch partners. Introduce yourself. Ten seconds. "Way-ka", or "Wee-ka", or "Way-ka". So great. Artificial neural network.
This is it, guys. This is how most of these algorithms, these applications that we showed today, that you use in every day, this is how they work. And by the end of this class, hopefully if you have time, you will learn the basics of neural network. And we will train our first neural network model on a piece of paper. How cool is that?
The idea comes from neuroscience. And some people say, this is how our brain works, now we want to mimic that. I kind of disagree with that, but anyways, there are some marketing people. So this is, oh, exercise four.
We have a construction company. They have completed three projects. They have an estimated cost and they have actual costs. And now, the new project comes in. They have very bad estimators, by the way.
Like in project 1,2, and 3, they should definitely change the consultant or whatever-- fire the estimator, whatever that is. But project four comes in. Before starting the project, they want to know what is the actual cost of the construction project based on the history of the data that they have. Your job is to figure that out. All right, start.
30 seconds. 30 seconds.
So one way of doing this-- let me ask you, what was the answer? Any answer?
AUDIENCE: 512. 512.
MEHDI NOURBAKHSH: 512.
AUDIENCE: Seven.
MEHDI NOURBAKHSH: Seven. 521, all right. Five. So can you give me the model itself? This is what I'm looking for. What is the model? What is the function?
So let's start with a simple model. Let's say we have the input, x, and output. So input neuron, output neuron, and there's something happening in between, which is our multiplier, or our weight, we call it weight. One way of calculating it is you sum all the estimated ones. You sum all the actual ones, and then you divide it.
If you do that, what would be your answer? 1.3. So y is equal to 1.3x. Everybody clear? Got it? Is it good? Can we do better? How?
AUDIENCE: More data.
MEHDI NOURBAKHSH: More data, I like that. But they're like three projects. They are very naive.
So why not two? Why not 1.5? Why 1.3? So how should we know whether this is good or not?
Well, the measure of goodness, in this case, is having less error. So if I test out 1.3, y equals 1.3, what would be the errors in the end. The error is the difference between the actual cost and predicted cost. Calculate in 10 seconds. Write it down on your paper.
What are the errors?
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: All right, like that. Minus 35, minus 10, and 50. But in the words of errors, we don't really like negatives. So we get rid of them. Therefore, we use the absolute measure here.
So there is absolute-- can you guys see that at all? So there is an absolute difference between these two. And we really don't care about individual ones. Let's look at them. We do care, but let's look at them all.
We have a mean absolute error, which is the average of all of those errors. So a model that is good has less error basically. So what is the mean absolute error of this model?
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Inside your head. First, calculate inside your head. What is the mean absolute error of this model? Calculate 2.0 31.6. The answer.
So we average them all, the absolute values. OK, easy. Now let's move on. So I pick 1.3, 1.4, and 1.5 on top. And as you can see, I should decide which model is better, right? So the mean absolute error of the first model is 31, 182, and 47.
There are some mistakes over there that you can see, but anyway, it's a live demo. We picked this model, 1.3, because it has less error. Don't take picture of this one.
[LAUGHTER]
So now, we wanted to do better, right? Let's add another term, b, called bias. We all have biases in our lives, right? Same as neural network, just inside our head. That was a nerdy joke by the way.
[LAUGHTER]
So now we added bias. We have y equals wx plus b. So one way of coming up with different error measure is just print out everything that we can. So I have a table of all the w's on the left and all the b's on top.
These are a few examples. Like in the corner, in that intersection, you see y equals cause x minus 70. So we want to calculate all the mean absolute errors for all of these different models. You have 30 seconds. So this is the calculation. So based on this, in 10 seconds, tell me which one do you pick.
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: Inside your head. The goal is to pick the one that has the least amount of error. This is hard, great. The answer is-- close. So this is the answer, y equals 1.5x minus 50.
Now, write this model down because we are about to calculate the predicted value. y equals 1.5x minus 50. By the way, congratulations. You've trained your first known network model.
How cool is that? Inside your head. Given this 400, what is the answer? Don't use calculators.
AUDIENCE: 550.
MEHDI NOURBAKHSH: 550 is the answer.
OK, let's move on. Isn't this so simple, guys? Like, machine learning taking our world, this guy? All right, so now, let's make things a little bit more complicated. Now, let's say another thing comes in. So the estimated cost, we had that estimator guide. But there is a weather forecast that is coming. And we think that the actual construction cost depends on both of them.
So now, instead of one w, we have two W's, W1 and W2. And this will be your model. Our job is really finding out these W's and B's based on the data that we have. We don't want to do it, OK?
Now, I'd like to introduce another thing to this equation, and that is your activation function. So they say inside your brain, these neurons, they take in, you know, the signals. And they activate it, and something goes out. And this is kind of, you know, mimicking that.
So there's an activation function that adds non-linearity to these models. And we needed those. So what does that mean? Whatever that is the results that we come up with-- for instance, in our case, 512, right? What's 512 over 50? The answer-- we use the activation function to get the final answer.
What does that mean? So basically, this is one of the activation functions that has a threshold. If the result is less than 0, OK-- do you see all right? If this is less than 0, it's going to be 0. If this is more than 1, it's going to be 1, as simple as that.
So whatever your answer is-- for example, if it's 512, this is more than 0, right? Y would be 1. So activation function is another function that, you know-- that your output actually comes out of that.
Let's do an exercise here. We have X1.2, X2 point minus 2, and we have the W's and B. On your paper, calculate what is the output of this function with that activation function. Talk to our partner. We have, like, 30 seconds.
[INDISTINCT CHATTER]
OK, ready for results? Yes? No? OK, so this is the result. So the output of F is 0.05, which is positive. So on the activation function, the final result is 1, OK?
This is one activation function. We have more activation functions for different-- This is just a selected top four.
AUDIENCE: Was there an error on that thing we saw?
MEHDI NOURBAKHSH: Maybe.
[LAUGHTER]
We always have errors. OK, well, what is the error? Tell me.
AUDIENCE: Could it be x1 times W1, right?
MEHDI NOURBAKHSH: x1 times W--
AUDIENCE: [INAUDIBLE]
MEHDI NOURBAKHSH: No? No error? You're good? OK. We're all good. This is real life, people. People make mistakes, including me.
So we have different activation functions for different uses. And we move on to the next one. So most of the things that you-- like Netflix, Google, they're not using one neuron. This is, like, obvious. They're using a lot of-- they're using deep, you know, layers of neurons. And now, we want to go from a single neuron to a lot of neurons, or we call it multi-layer perceptual.
So if I-- with my representation, if I want to add lots of, them, this is what you get. We want to now simplify this a little bit so that it doesn't look messy. OK, to simplify this, I change this to this one. So I moved-- I combined T and T of F right there together. And I moved B down, OK? It's the same thing. I just replaced them, all right? Are we cool with this? OK.
We need to further take this down and to make it more simplified. And that is-- so these three, I have three arrows right here. And I call it n, as in neurons. We'll get to that. And then, I added another thing, a, x, subscript and superscript, which shows me the layer and the placement of this neuron in this layer, OK? All of this was adding-- you know, having multiple neurons right here, OK?
So in the first layer, I have a1, a1-1, a1-2. In the second one, a2-1, a2-2, a2-3. And the last one is a3-1, OK? Are we good?
Now let's connect them all together. Now we have three layers of neurons. The first layer is called the input layer. The middle one is the hidden layer. And the last one is the output, or output layer. We can have many hidden layers, as many as we want, OK? This is the deep neural network that I talked about in the beginning of the class, if we have more than four in there.
So let me add our weights and biases to this. I just randomly put in three of them. Our job, really, is to find out what are W's and what are the B's. This is the training, you know. When we say we are training a neural network, we are actually figuring out what is the best W and B that gives me the least amount of error in the end, as we practiced in the construction exam, OK?
So here, the output of the neural network is a3-1, right? And the real value is y. Can you tell me what the error of this network is? Mean absolute error of this? So a1-3 is the predicted value, and y is the actual value. Yes. So this is the error that, you know, we practiced a few minutes ago. So the difference between y and a3-1.
The goal here is-- so we start from back-- from the front, and we go back and try to figure out W's and B's so that this error becomes minimal. And this is a training process, OK? Everybody cool? OK, then we'll-- OK. Hold onto this one for now.
So we have Exercise 5. And that is, please distribute new sheets of paper. This is the last exercise. So everybody takes one this time. One for everybody. If you need more, let me know. OK. All right. So everybody has one, yes? Anybody who doesn't have one? OK.
So this is kind of a-- this is not really machine learning related to this course. But it's kind of related. And that is, I want you, right now, since we're all in this class, think about the-- you know, what are the repetitive tasks that you do in your work, and you think machine learning can be applied to automate that? So now, you learn about machine learning.
And I want you really to think about, you know, how can you apply that to your work? What are the tasks that you're doing every day at your job? And you don't need to talk to your partner. Just straight down, you know, write your answers on the paper. You can write down, you know, your job role, you know, you're a B manager, coordinator, whatever that is. And at the end of the class, I'm going to collect these samples so that we can have a better class for the next session.
OK, think about the things that you are doing every day that you really don't want to do, but you're doing it anyway. And you think machine learning can help you with that. We're going to spend, like, a minute on this.
I'm going to show you a demo of Weka at the end of the class. OK, if you're done with that question, or you can keep that in mind-- this is the last question. And that is, imagine that, five years from now, you have a personal assistant that sits next to you. And he's been working with you for a long time. He knows everything about you, your work style, you know, everything.
And he has a deep knowledge of, you know, industry. He knows construction knowledge-- he has construction knowledge, engineering knowledge-- he knows everything. And you know, he's willing to help you. He's right there for you, OK?
So if you have this personal assistant, what would you want him to do for you? That's the last question. His skills complement yours, so anything that you don't know, he knows, or she knows. It doesn't have to be practical. If you think, oh, this is a crazy idea, write that down.
All right. If you're done, pass the papers to the left and right side. Yep. So I'm going to quickly wrap up this session. And I'm going to show you the demo of Weka in the end. So if you don't have time, or you're going to run to other sessions, please feel free to do that.
So we learn about, you know, what is machine learning and NAI.
[LOUD VOICES]
So we-- OK. All right. Inside your head. We learned about the history of machine learning today. It was between 1951 till today, especially the neural network. We learned about the applications of machine learning.
So how many of you have used machine learning in the past? Raise your hand. So how many of you used any of these? OK, 20 percent of you, OK, all right. OK, OK.
So we learned about what is the input, what is the output, what is a model, what is a future vector. We learned about different machine learning types, clustering, you know, supervised learning, unsupervised clustering, regression, and classification. We learned about the machine learning process a little bit today. And we learned how to create a decision tree on a piece of paper. And also, we learned about neural network a little bit.
In the end, now, I'd like to-- so feel free to leave if you want to. But I'm going to show you how the thing that we learned today can be run on a machine. So this is the weather data that-- OK, can you guys see this?
All right, so this is the weather data that we have. This is text format. So this is "WEKA" or "WEEKA" or whatever you call it. You can download it online. It's available. It's open source.
But it has a-- so we click on Explorer. And here, you need to have your input file. The input file is actually very simple. It's text based and has this format. So first one is kind of relation, what is in this file? And then, you define your attributes. So now, you know what attribute is, right? All the columns.
So outlook could be any of these, sunny, overcast, rainy. Temperature, one of these three. And humidity, windy, and construction. Yes or no? And then, you have your data.
And you know, in your future vectors, you need to have all of these. You can have a missing one, but you know, we haven't really talked about that today. So you can leave some of these, too. So sunny, hot, high falls-- no. So it means that construction is nil here.
OK, now, in-- put it here, go to my data set, weather, open. So now-- make this bigger-- now, you can see all of these. And these are more information about your data. Humidity is either high or normal. This is the count, and construction, whether it's happening or not happening.
We go to the classification tab, right here, because we want to classify. And here, we choose-- uh oh-- trees, decision tree. And so there are lots of trees, based on different algorithms. If you hover over, you see-- you know, you can find more information here and there. And I pick J-48, and I accept-- it's one of the decision tree algorithms-- and I accept whatever default that is. And I click on Start. When I start, this is it. It happened.
This is your model, outlook, sunny. And underneath-- under outlook, we have humidity. Do you remember this? Then we have overcast, which is done, and rainy. Then we break on windy. This is your model, basically.
You can save this model. You can click on this. You can save the model. You can load previous models, if you want to. And there are some errors that you see-- you see, we covered today, mean absolute error. You remember that, the difference between actual and real one? But there are other measures of errors, too.
OK, this is decision tree. Quickly go over buildings. So let me show you first what the building dataset looks like. I wish we could have run this together, but-- run it together, but-- all right. This is the building dataset. Do you remember the classification problem, whether it is commercial, residential, or warehouse?
So I picked these attributes, number of stories, floor area, number of rooms, number of bathrooms, number of bedrooms, and tie. This is the output. So these are my inputs that I thought, you know, will be useful in the classification. And based on that, I went over all the models, and I created this. In a real world example, you need to normalize this and you need to scale it. But you know, we haven't really covered this in this class. But Weka does it for us.
OK, so now, I import this one. So this is my input. These are different-- you know, the type, we have three types. We have floor plans and other things. I go to classification this time. And this time, I go to Functions. And I pick multi-layer perceptron. It's kind of the last model that you saw in the example. So there are multiple layers of inputs, hidden layer, and output layer. And I click on this. I accept all the defaults, and hit Start.
So these are-- when you-- so it picked the Sigmoid function as default. And these are some of the values, the W's and the B's, for each line, or for each perceptron, going from one to another. But let me show you something. You can also-- here, you can also visualize it through the GUI. Click OK, and Start. And when you do this, you can see your beautiful neural network that is being trained for this model.
So number of stories-- these are the inputs. This is the hidden layer. We have four hidden layers. And these are the output.
And let's see what is the accuracy of this model. OK, let me start, accept-- OK. So this model actually-- so this model actually correctly classified 91 percent. So the accuracy of this model is 91 percent. And 8 percent, there's inaccuracy.
So remember, in machine learning, you know, workflow, you need to go back. Maybe you need to add more, you know, attributes to it. And in the end, you know, you're probably going to get a better accuracy-- or change your architecture.
OK, this is all. Thank you very much. I have some business cards here, if you want to. And thanks for joining.
Downloads
标记
产品 | |
行业 | |
主题 |