Transcript for:
AI for Everyone Lecture Notes

Hello, I'm Lawrence, the Director for AI Innovation in AI Singapore, and welcome to AI Singapore's most popular course, AI for Everyone. Before we start, let me share with you the background to AI for Everyone, or AI for E in short. AI Singapore was started in June of 2017. One of our core programs, the 100 Experiment, or 100E, was designed to co-create AI solutions and products for the industry. The biggest challenge we had in 2017 was to convince organizations, especially SMEs, to come on board. The managers in the SMEs had questions like, will AI replace me? We knew we needed to demystify AI if we were to meet our 100E objectives. We launched AI4E in Q2 of 2018. It was a 3-hour workshop conducted face-to-face, typically on a Friday afternoon or Saturday morning. Depending on the size of the auditorium that we had access to that weekend, it could be between 100 to 400 people in the audience. Fast forward to December 2019, we launched an online version of AI4E, hosted on our LearnAI platform. Following that, the Polytechnics and ITE came on board and adopted AI4E as a foundational AI module for all students. Infineon became the first company to offer AI4E to all their staff in December of 2020. An MOE onboarded AI4E into the student learning system in Q2 of 2021. The Singapore Civil Service College partnered with AI Singapore in the Q3 of 2021 to have all public offices go through AI4E. The Egyptian government also adopted AI4E under a G2G agreement to translate AI4E into Standard Arabic for their citizens. We are now in Q4 of 2021, and this is version 3 of AI4E, updated with Singapore-based examples and use cases. I hope you will enjoy AI4E. Let us start. In five modules, we will discuss what is AI? How it works? It is not magic, it is just maths. What AI can do today? We will also briefly discuss responsible use of AI. And finally, we will look at a very important topic of AI, jobs, and you. So let's start by understanding what is AI. We will define AI and explain in layman language how AI works. Programs that can send Reason, act and adapt. I like this definition of AI the best. Over the next few slides, we'll expand on this definition. All of us are already using AI today. Let me walk you through a typical workday routine. I say to my Google phone, Hey Google, wake me up at 6.30am tomorrow. Google AI is able to hear and understand the instructions I just gave. AI can hear. And while waiting for my son to get ready for school, I say to my phone, Hey Google, tell me a joke. And Google tells me a joke. AI can speak. When I get to my office, the cleaning robot is doing its rounds. moving autonomously, avoiding obstacles such as me or the walls. AI can move. During lunch, I may take a picture of the food. And since I like to have that bokeh effect, I turn on the portrait mode. And I get a nice sharp picture of the food, but the background is blurred. That is AI at work. The AI has been trained to identify what is a foot in the picture and what is considered the background and blur it accordingly. AI can see. When I get home, I turn on Netflix or Disney Plus, and they will show me the latest show which they think I will enjoy. AI has learned my preferences. As you can see, from the moment you wake up until you go to bed, you are already interacting with AI. So why is AI so hot now? Couple of reasons. Data. You, sitting there, is generating data by your very action of watching this video and interacting with the learning management system. Companies are generating data in every transaction with their customers. IoT systems such as the smart lamp post, traffic cameras, your smart fridge is generating data. Costs. The cost of computing has dropped over the last few decades. Together with cloud computing, you can build large, complex AI models at a fraction of the cost compared to a few years ago, where you had to buy these large supercomputers. Algorithms. Researchers are releasing new state-of-the-art algorithms nearly every week, and often for free and with the source code. People and easy access to AI materials. Many passionate professionals and students can go online and easily learn about AI. Many of these online materials are of very high quality and often free, released by well-known universities. There is no cost barrier to learning AI today. And finally, open source. Open source have democratized AI. Open source means the AI software is freely available. available with its secret source, the source code, for anyone to download and use. Many of today's big companies and AI startups use open source software to build their AI systems. AI is not new. The term artificial intelligence was coined in a famous conference in 1956. There are many branches of AI or school of thought. In the 1940s and 50s, rule-based systems or expert systems were popular, and the researchers believed the way a human mind works can be described by rules. Or, some preferred a more mathematical approach, using search-based methods to solve problems like Shorter's delivery route. And the connectionist researchers, the neural network folks who prefers to model the brain with artificial neurons. We'll cover more about neural networks in a later module. In the 1980s, with digitalizations and the personal computers, more and more data were collected in digital forms, which made data accessible. It gave rise to a new class of statistical learning or machine learning algorithms, like decision trees, regression algorithms, and many others. In the 2000s, Deep learning, a very big and complex neural network with many layers became popular, with cheap computing power and lots of readily available data to train. Today, deep learning is a de facto standard for doing analysis for natural languages, computer vision and voice. So, AI encompasses both machine learning and deep learning. And deep learning is a subset of the field of machine learning. Essentially, AI is made up of two ingredients. The right set of data and the right set of algorithms. Modern AI is about data and algorithms. Data is the information needed to solve the problem we have, and can come in many forms. Data can be presented as text or numbers. It can be in the form of audio files, images, and even videos. Algorithms are a series of mathematical equations and operations that the computer executes. Machine learning algorithms are used to understand your data. The model that has been built by the machine learning algorithm is a representation of the physical world. It could be used to describe the phenomenon you are observing, for example in a lab experiment. All of us are familiar with the equation of a straight line, y equals to mx plus c. Here, we assume the observed data points can be represented by a straight line, and if we can draw or compute that straight line, that is, build the model, we can then use it to predict. New and better algorithms are invented by researchers nearly every week. But what is important to know is that AI is nothing more than feeding lots of data to maths. There is no magic. Suffice to know that behind all AI algorithms are maths. Some of it simple, some of it more advanced. But fundamentally, how most of all these algorithms work is something you have already studied in secondary school. We will come back to this in module 2 of this course. You may ask, what is the difference between machine learning and traditional programming? In traditional programming, the algorithm to do a specific task or prediction is derived from working with a domain expert. The programmer will talk to the expert and work with the expert to develop that specific algorithm to best represent the physical phenomenon that they have observed or want to predict. For example, in this case, y equals to 5x1 plus 7x2 plus 0.1, something that the expert told the programmer that is the best equation to use. In machine learning, the AI engineer will discuss with the domain experts On what are the important datasets required and what columns in each table is important to best predict the physical phenomenon? The AI engineer will work with the domain experts to curate and label the datasets. For example, we have a spreadsheet of data with columns 1 to 10 representing data about a telco customer. For example, the start date of subscription, how long he has been a customer, his subscription plan, his add-ons, the number of call minutes and data consumed per month. And column 11 would indicate whether the customer renewed his contract or not. With these carefully curated and labeled datasets, the AI engineer can now train the AI model to predict if the customer will renew his contract. In this case, the AI model says the equation should be Y equals to 4.8x1 plus 7.2x2 plus 0.25. With the model built, it can then be deployed into the telcos IT system, and new operational data gets fed into the model daily, and at the end of the day, report may be generated to let the sales department know who are the at-risk customers and for them to take specific actions. There are many forms of machine learning, but the two most popular and common are supervised learning and unsupervised learning. Let's explain how they work. I'm sure most of you are familiar and probably have used Carousell to buy and sell things online. When I started using Carousell a few years ago, I uploaded pictures of the products I wanted to sell. I also had to indicate what category it belongs to. Then about one year ago, I noticed that Carousell automatically recommended the category to use. How were they able to do this? Well, we all helped them. Remember in the beginning, we had to indicate the category of the items we wanted to sell with the corresponding images? Carousell used the images and the labels you supplied to train the AI model. Classification is a specific form of supervised machine learning, where the task is to classify items into similar categories. For example, to classify whether a picture of a noodle is a bowl of laksa or fishball noodle, or if a person is COVID-19 positive or negative. In classification, labelled training data with matching input data and output categories are required to train the model. A child in the early years learns with supervised learning. You will show the child pictures of cats and dogs, or when you bring the kid out, you point out cats and dogs to him or her. After a while, the child will have learned what is a cat and what is a dog. Other classification applications include object detection used by autonomous vehicles and predicting stocks to buy, hold or sell. Regression is another form of supervised machine learning, and here the task is to predict a numerical value. For example, the price of HDB flats in 3 months time, or COE prices, or the daily number of COVID cases. While 4D and TOTO are numbers, regression models cannot realistically predict them. Let's walk through a simple example. Most of us grew up in HDB flats. And when we want to get married, we pop the question, shall we register for a HDB flat? Singaporean guys and ladies will understand this. So, one of the things you want to know is to predict the price of the HDB flat. To build a regression model, the input to the model could be, for example, the location of the flat, the size of the unit, which floor it is on, and if it is near an MRT or school. And the target output or label would be the price of that HDB flat. Once the model has been built, you can now input the specific features of the flat you are interested in and get the predicted price. The next common type of machine learning is unsupervised machine learning. Popular use cases of unsupervised learning include identifying fraud or fake news, or for customer segmentations by marketing departments. If you recall, supervised learning is like teaching a child how to identify a cat and a dog by showing the child pictures of cats and dogs. It is different for unsupervised learning. There is no right answer or right way of doing things. The AI will have to figure it out. An example of unsupervised machine learning is clustering. In clustering, we want to group similar data together, and there is no guidance or output labels provided to say which group the data point belongs to. Imagine you have some toys, and without providing further instructions, you ask a child to separate the toys into respective groups. The kid will play around and eventually find his own best way to group similar toys together. Let's do that. There is no right answer of grouping the toys together. It will depend on what the child thinks is the best way to group the toys. Sometimes the results may be unexpected. In this example, the child have grouped animals together, food items together and shapes into a bottle. Other ways the child could have grouped the toys could be by size or color. This is an example of clustering, a form of unsupervised machine learning. You will provide data to the algorithm and it will learn the best way to group the data together. We do not provide any information on how we want the items to be grouped. The algorithm will figure it out by itself. Therefore, the learning is unsupervised. So what other applications can unsupervised learning be used for? Recommendation engines used by Netflix or Disney Plus, for example, are often built with unsupervised machine learning. The modern spam engine make use of clustering to identify spam in your inbox. Now that you know about supervised and unsupervised machine learning, what is the end-to-end process of building an AI program? We Singaporeans like to eat, and some of us like to cook. And actually, the process of cooking is similar to how you will go about building an AI program. Firstly, we have to decide what we want to cook, and say today I am in the mood for Hokkien mee, a very popular Singaporean dish. Similarly, we need to identify the business problem we want to solve. Next, we need the ingredients. So I'll go to the market to buy the prawns, the squid, meat, the taugeh and the noodles. After getting the ingredients, we can't just throw all the ingredients into the wok straight away. We need to prepare the ingredients. such as deshelling the prawns, frying the shells to make the prawn stock, cut out the fat from the meat to make lard, boil the meat, slice it into strips, and so on. Similarly, we need to get the necessary data for the task. We will need to prepare the data for machine learning. We will need to clean and feature engineer the data. Feature engineering here is like how we change the meat into leaner meat, extract out the fat and convert it into lard. An example of a feature engineered data is your BMI, which is mass over height squared. It is a number which we can easily translate to whether a person is overweight, obese or normal. We also need to understand the data better using charts to visualize them. Once the preparation is done, we can then start cooking. So we may follow a recipe we found on YouTube, or you can experiment on your own and adjust and tweak to get it just right. Similarly, once the data is prepared, it is time to train the model. We can try different models, just like different recipes from YouTube, or experiment on your own. Just as like when you're cooking, you will also need to taste to see if it is salty or sweet enough. Similarly, you will test more model for accuracy, for example. Once we have the Hokkaimini the way we want it, we must plate the noodles and serve it, sometimes with sambal chili to complement it. Similarly, for the AI model, once we are happy with the accuracy of the model, we then deploy the model into production. The process, however, does not end there. The performance of the AI model has to be continuously monitored. And if the performance starts to drift, you may have to get new data and retrain the model again. Hence, I have shown the AI ML process as an incremental, circular and continuous process. Again, very much like how I had to continuously improve on my Hockenme techniques over the years. Now let's move on to a branch of machine learning known as neural networks, which are inspired by the human brain. This slide shows how a neuron looks like. The neuron is connected to other neurons by synapses. The human brain has between 86 to 100 billion neurons and 1 trillion synapses. A corresponding artificial neuron is shown. The artificial neuron has a set of weighted inputs which are often summed together. Researchers have found that the brain consists of layers of neurons which are interconnected, and these layers combine to process the information presented to them. For example, when a human sees a dog, one layer of neurons may process colours, another layer process shapes, and another layer process textures and so on. Combined, the brain can decipher the picture and conclude if the image seen is a cat or a dog. We will discuss more about neural networks in the next module. Recall earlier, our baby recognized cats by being shown pictures of cats. The baby probably only needed 10 to 20 pictures to be shown to learn what is a cat. In 2012, Google used a thousand computers and millions of images of cats contributed by people on the internet to train an AI model to recognize a cat. Today, while AI algorithms have gotten much better, we still need several thousands of pictures of each object we want to classify and lots of computing power. The human brain consumes about 12 watts compared to a typical computer of 500 watts. The human brain is a marvel, and if anyone tells you that AI is going to replace us humans, he is just sharing a very narrow view of the capabilities of AI today. It would be what I call misinformation or fake news. Let's recap what we have learned. AI are programs that can sense, reason, act and adapt. Modern AI systems today are typically built with machine learning algorithms such as deep learning for tasks in computer vision and natural language processing. These AI programs execute a series of mathematical operations to find patterns in the data provided, and to build a model to represent these patterns. The model is also often a representation of the physical world to predict some physical phenomenon. And the process to build an AI system consists of first defining the problem statement, Collect, clean and feature engineer the data. Train and test the model. Deploy the model. Monitor the performance of the model. And finally to retrain the model when required. With this, we conclude the first module of AI for Everyone. In the next module, we will show you that AI is just maths. And with a secondary school level of maths, you can appreciate the concept of AI and to get an intuitive idea of how AI works.