Lesson Introduction to Artificial Intelligence - Artificial Intelligence - ثالث ثانوي
Part 1
1. Basics of Artificial Intelligence
2. Artificial Intelligence Algorithms
3. Natural Language Processing (NPL)
Part 2
4. Image Recognition
5. Optimization & Decision-making Algorithms
1. Basics of Artificial Intelligence In this unit, you will learn about the history and the applications of Artificial Intelligence (AI). You will also learn more advanced data structures such as queues, stacks, linked lists, graphs and binary trees. These are the structures that you will use later to create Al projects. Ministry of Education 10 2024-1446 Learning Objectives In this unit, you will learn to: > List the milestones of Al history. > Cite examples of Al applications. > Describe the operations of the stack data structure. > Describe the operations of the queue data structure. > Determine the differences between the stack and the queue data structures. > Describe the main operations on the data in a linked list. > Explain the use of the tree data structure. > Determine the differences between the tree and the graph data structures. > Use Python programming language to explore complex data structures. Tools > Jupyter Notebook
Basics of Artificial Intelligence
Learning Objectives
Tools
Link to digital lesson Lesson 1 Introduction to Artificial Intelligence What is Artificial Intelligence (AI)? Al is the field of Computer Science that deals with the design and implementation of programs that are capable of imitating human cognitive abilities. These programs display characteristics that we usually attribute to human behavior, such as problem solving, learning, decision making, reasoning, planning, taking actions, etc. Al agents www.ien.edu.sa An Al agent is a software program that acts on a user's or system's behalf by perceiving its environment, making decisions, and taking actions based on those decisions. An agent can be simple or complex, autonomous or semiautonomous, and can operate in various environments, such as web- based, physical, or virtual. Deep Learning Natural Language Processing وزارة التعليم Ministry of Education 2024-1446 Al Agents Neural Networks Artificial Intelligence Computer Vision Machine Learning Robotics Neural networks Neural networks are a type of computer program that are designed to simulate the way the human brain works. They are made up of interconnected "neurons and layers" that can process and transmit information. Figure 1.1: Some Al fields 11
What is Artificial Intelligence (AI)?
AI agents
Neural networks
Al and Other Fields Al also has strong connections to multiple other fields including: Philosophy: Philosophy is the ancestor of modern science. Philosophy studied fundamental problems that are central to Al, such as the origin and representation of knowledge, logical and rule-based reasoning, goal-based analysis, and the connection between knowledge and action. Mathematics: Mathematics as a field serves as the core of Al and provides it with fundamental building blocks such as logic, computation, and probability theory. Decision Theory: Decision theory studies logical and mathematical properties of the decision-making process. It analyzes how decisions are made in a system where the decision environment is uncertain. Theoretical frameworks and methods from this field have been consistently applied to Al problems. Neuroscience: Neuroscience is defined as the scientific study of the human nervous system. The key neuroscience finding that a collection of simple cells can lead to complex outcomes such as thought, action, and consciousness has been a guiding principle for Al. In fact, artificial neural networks often emulate actual neural architectures found in the human brain. Cognitive Psychology: Cognitive Psychology is a branch of psychology which is dedicated to studying how people think. Advances in this field have consistently informed breakthroughs in Al, by providing insight that can help computers emulate human thinking. Computer Science and Engineering: The field of Computer Science and Engineering has provided Al with the necessary software and hardware platform it requires to go from theoretical concepts to practical applications. Advances in Al have been consistently supported by breakthroughs in operating systems, programming languages, storage, memory, and processing power. Cybernetics: Cybernetics is defined as the study of systems that achieve a desired state by receiving information from their environment and modifying their behavior accordingly. The key difference is that Cybernetics uses mathematics to model closed systems that can be fully described by specific variables, while Al uses logical inference and computation to overcome such limitations and study complex problems such as the comprehension and generation of language and visual information. Linguistics: Linguistics is the scientific study of human language. The comprehension and generation of human language have been a key application area for Al, leading to the creation of subfields like Natural Language Processing (NLP) and Computational Linguistics. Vision Science: Vision Science is defined as the scientific study of visual perception. Teaching computers how to understand and generate images, animations and videos is one of the most exciting applications of Al, specifically in the Deep Learning and Computer Vision subfields. وزارة التعليم Ministry of Education 12 2024 -1446 INFORMATION The term "Artificial Intelligence" was formally introduced in 1956, making Al one of the youngest disciplines.
AI and Other Fields
The term "Artificial Intelligence" was
Turing Test Perhaps the most famous method for defining Al, which was proposed in 1950 is the Turing Test: an experiment for determining whether a computer is intelligent or not. During the test, the computer has to answer some written questions provided by a human interrogator. The test is considered successful if the interrogator cannot tell whether the written response came from a person or from a computer. To successfully pass the test, the computer needs to have the capabilities shown in the following table: Turing Test Turing Test tests the ability of a machine to exhibit intelligent behavior equivalent to or indistinguishable from that of a human. Human interrogator Computer respondent Human respondent Respondent 1 Respondent 2 Figure 1.2; Representation of the Turing test Ministry of Education 2024-1446
Turing Test
Turing Test
Figure 1.2: Representation of Turing test
Table 1.1: Computer capabilities to pass the Turing test 1 Natural Language Processing to enable it to understand and answer questions. 2 Knowledge Representation to organize, store and retrieve information during test performance. 3 Automated reasoning to use the stored information to answer the questions. 4 Machine Learning to adapt to new language constructs (e.g. different syntax or vocabulary) that it has not seen before and is not in its stored information. 5 Computer Vision, so that the computer can respond to visual signals provided by the interrogator via image and video feed. 6 Robotics, so that the computer can receive and process objects passed by the interrogator via a hatch. The above capabilities cover a large part of the broad field of Artificial Intelligence. Let's define some of these capabilities. Natural Language Processing (NLP), is a branch of Al which gives computers the ability to understand human and natural language. Knowledge representation in Al refers to the process of encoding human knowledge into a machine-readable form that can be processed and used by Al based systems. This knowledge can take many forms, including facts, rules, concepts, relationships, and processes. Automated reasoning refers to the ability of an Al-based system to automatically deduce new knowledge and make logical inferences based on a set of given rules and premises. Computer vision is a field of Al that enables computers to interpret and understand visual information from the world, such as images and videos. Robotics is a branch of Al that deals with robot design, construction, and use. It involves the integration of various technologies, such as machine learning, computer vision, and control systems, to create intelligent machines that can perform tasks autonomously or with minimal human supervision. وزارة التعليم Ministry of Education 14 2024-1446
Table 1.1: Computer capabilities to pass the Turing test
The above capabilities cover a large part of the broad field of Intelligence.
Artificial Intelligence: 9 Decades of History Despite being less than 100 years old, Al has had a rich history spanning from the 1940s until today. Let's look at a timeline of the main Al milestones in each decade. 1940s Early days and the first artificial neurons 1943: The first model based on artificial neurons is proposed. Each neuron could be in an active ("on") or inactive ("off") state, depending on the stimulation that it received from other neighboring neurons that it was connected to. 1948: Elmer and Elsie, two autonomous robots, can navigate their way around obstacles using light and touch. 1950s The founding of Artificial Intelligence 1950: The Turing Test is introduced: a test of a machine's ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human. A plethora of key Al concepts is also introduced such as machine learning, genetic algorithms, and reinforcement learning. 1951: Stochastic Neural Analog Reinforcement Computer (SNARC), the first neural network computer, is built. 1958: Lisp is developed, a programming language designed specifically for Al. In the same year, a paper is published for a hypothetical Advice Taker, an Al system capable of learning from experience just like a human. 1960s & 1970s The First Al Winter 1964: ELIZA is the first NLP program and the ancestor of today's chatbots. 1974-1980: This period is referred to as the "First Al Winter". Funding for Al projects was reduced during this time, due to the lack of progress and impact in real-world applications. One major criticism was the inability of Al techniques to address the combinatorial explosion problem, which limited their applicability to only very small problems and datasets. 1980s & 1990s Expert Systems and the Second Al Winter 1980: The first successful commercial expert system designed to emulate the decision-making ability of a human expert is released. 1987-1993: This period is referred to as the "Second Al Winter". The rule-based nature of early Al systems limits their applicability and makes them unable to solve key real-life problems. 1997: The Deep Blue supercomputer beats world chess champion Gary Kasparov. The first win of an Al program over a world chess champion. 2000s Mainstream popularity, supported by hardware and software breakthroughs 2005: Stanford University creates STANLEY, a self-driving car that wins an autonomous vehicle challenge. The U.S. military begins investing in autonomous robots. 2009: Deep-learning neural networks were trained with graphics processing units (GPUs) for the first time. The use of this specialized hardware rapidly accelerated the training of complex networks on very large datasets, ushering in a new age for deep learning and Artificial Intelligence. 2010s & 2020s Golden Age 2011: The question-answering system Watson defeats the world's two greatest Jeopardy! players. Watson was able to understand and successfully answer the questions, marking a breakthrough in using artificial intelligence to understand natural language. 2012: An Al system instantaneously translates spoken English to spoken Chinese. 2021: A full self-driving system uses a neural network trained on the behavior of hundreds of thousands of drivers. 2022: ChatGPT (Generative Pre-trained Transformer) is a chatbot built on top of large language models. The models are fine-tuned with both supervised and reinforcement learning techniques to mimic a human conversation. وزارة التعليم Ministry of Education 2024-1446 15
Artificial Intelligence: 9 Decades of History
Applications of Al Al is a rapidly evolving technology that has the potential to transform a wide range of fields and industries. In this unit, you will explore the various applications of Al and how it is being used to lead to improvements and innovations in a wide range of domains and industries. Virtual Assistants One of the most popular applications of Al has been in the area of virtual assistants that can communicate with users through voice or text-based interactions. They are often accessed through devices such as smartphones, tablets, or smart speakers, and can be used for a wide range of tasks such as setting reminders, answering questions, playing music, and placing orders for products and services. One of the most well-known examples of an Al-powered virtual assistant is Apple's Siri. Other companies have also developed their own virtual assistants, including Amazon's Alexa, Google's Assistant, and Microsoft's Cortana. These assistants have become increasingly sophisticated over time, with the ability to understand and respond to a growing number of commands and queries. For example they can be used to control a wide range of smart home devices, such as thermostats, lights, and appliances. Virtual assistants also come in the form of specialized chatbots, typically designed to provide information and answer questions in a particular domain. An example of such a domain is customer service, where Al-powered chatbots are used to answer questions about products or services, troubleshoot issues, and provide information about orders and accounts. Chatbots can be accessed through a variety of channels, such as websites, messaging apps, and social media, and can provide assistance 24/7. You can see an example of a chatbot application in figure 1.3. Robotics What Can I Help You with? Figure 1.3: Conversation with chatbot Al has historically been linked to robotics. While a robot can be seen as the physical manifestation of an artificial being, Al represents the robot's software brain, providing it with the ability to sense its environment, make decisions, and adapt to changing conditions. Intelligent robots can then apply these abilities to perform a wide range of tasks without human intervention. These tasks can include manufacturing, exploration, search and rescue, and many others. In figure 1.4, you can see a robot assembly line in a car factory ولات التعليم Ministry of Education 16 2024-1446 Figure 1.4: Robot assembly line in a car factory
Applications of AI
Virtual Assistants
Robotics
One of the earliest examples of Al in robotics was the development of factory robots which were used to perform tasks like welding, painting, and assembly. Since then, the use of Al in robotics has become increasingly sophisticated, with the development of more advanced algorithms and the use of machine learning to improve robot performance. One milestone in the use of Al in robotics was the development of humanoid robots, like Honda's Advanced Step in Innovative Mobility (ASIMO), which was introduced in 2000 and was capable of walking and performing basic tasks. Humanlike Robots Pepper and Nao are humanoid robots developed by Aldebaran Robotics. Both robots are designed for human-robot interaction and are widely used in research, education, and entertainment. Pepper is a social robot designed to interact with people naturally, using its cameras, microphones, and touch sensors to perceive its environment and respond to people's actions and emotions. Pepper has many features that allow it to recognize faces, understand speech, and respond to gestures. You can see the Pepper robot in figure 1.5. Nao is a smaller, more compact robot designed for human interaction. Like Pepper, Nao has a range of sensors that allow it to perceive its environment, as well as cameras and microphones for speech and facial recognition. Nao is highly customizable and programmable, making it an attractive choice for researchers and educators who want to study and develop new applications for humanoid robots. Figure 1.5: Pepper robot In 2017 the robot Sophia was the first robot to receive Saudi citizenship and in 2023 Saudi Arabia's first interactive robot Sarah was introduced. Self-Driving Cars Another milestone was the development of self-driving cars (figure 1.6), which use Al to navigate roads and make decisions about how to safely interact with other vehicles and pedestrians. One of the key requirements of such applications is the ability to process and understand visual data, such as photos and videos, commonly referred to as "Computer Vision". Computer Vision Algorithms can be used to identify objects, people, and other features in images and videos, as well as to understand the context and meaning of the content. This has a wide range of applications beyond robotics, including facial recognition, content moderation, and media analysis. A key milestone in the use of Al in image and video analysis was the development of deep learning algorithms, which can analyze large amounts of data and identify complex pi patterns in images and videos. Ministry of Education 2024-1446 MODE 40 Figure 1.6: Self-driving car 17
One of the earliest examples of AI in robotics
Humanlike Robots
Self-Driving Cars
Industries Affected by Al Education Over the past few decades, there have been several key milestones in the use of Al in education. Early examples include the development of Al-powered tutoring systems, which used NLP to interact with students and provide feedback on their work. Then, adaptive learning platforms emerged, using machine learning algorithms to personalize learning for each student based on their strengths and weaknesses. Next, Al-powered grading systems were developed, which used NLP and machine learning algorithms to grade written assignments and provide feedback. More recently, virtual assistants and chatbots have been integrated into education to provide personalized support to students and answer their questions in real-time. Al can be used to analyze data about student performance, learning preferences, and other factors to create personalized learning plans and recommend materials or activities that are most likely to be effective for each student. Healthcare Al benefits in education • Time-saving for teachers/ professors. • Al tutors can assist students. . • Help teachers to become learning motivators • Al-driven functionality can give feedback to students. and educators Healthcare is another field that has consistently benefited from innovation due to advances in Al. The first innovations came in the form of Al-powered diagnostic systems and the use of Al in drug discovery. Next, Al was integrated into electronic health records to extract relevant information, and in the 2010s, Al-powered telemedicine systems were developed. Today, modern Al is used to create personalized treatment plans and power wearable devices that track a person's health. Al has played a significant role in the healthcare industry, enabling doctors and other healthcare professionals to analyze large amounts of data and make more informed decisions about patient care. Such data can come from diverse sources including medical records, lab tests, and even images such as X-rays and CT scans. Modern computer vision algorithms are nowadays routinely used to detect abnormalities and assist with diagnosis. وزارة التعليم Ministry of Education 18 2024-1446 Figure 1.7: Analyzing health data
Industries Affected by AI
AI benefits in education
Healthcare
Agriculture and Climate Modeling In agriculture, Al is used to optimize crop yields and improve the efficiency of farming practices. This is achieved by continuously analyzing data about soil conditions, weather patterns, and other factors to predict the best time to plant, irrigate, and harvest crops. Al can also be used to monitor crops in real time and identify problems, such as pests or diseases, allowing farmers to take corrective action before yields are significantly impacted. One of the earliest examples of Al in agriculture was the use of simple decision-making algorithms to optimize irrigation schedules. Another key milestone was the use of sensor networks to monitor crops and automatically calibrate the application of key treatments such as fertilizers and pesticides. More recently, the use of drones and satellite imagery has been used to analyze crops at a larger scale. In figure 1.8, you can see an autonomous drone fertilizing a field. Figure 1.8: Fertilizing with autonomous drone Another area that is closely related to agriculture and has also been significantly influenced by Al is climate modeling. Applications in this area started early, with the development of Al-powered weather forecasting systems. Later, Al was used to analyze large amounts of data on climate change and make predictions about future trends. Such data can come from various sources, including satellite imagery, weather station observations, and computer simulations. Today, Al is being used in a wide range of climate modeling applications, including predicting the impacts of climate change on specific regions, understanding the causes of extreme weather events, and identifying the most effective strategies for mitigating or adapting to climate change. وزارة التعليم Ministry of Education 2024-1446 19
Agriculture and Climate Modeling
Energy Al has had a significant impact on the energy industry, enabling companies to optimize energy use, reduce waste, and improve efficiency. One of the earliest examples was the use of machine learning algorithms to analyze data on energy use and identify ways to reduce waste and optimize consumption. In the 1990s, Al was used to predict the potential output of renewable energy sources and optimize their use. This was an important development as it allowed energy companies to better plan for the integration of renewable energy sources into their operations. Figure 1.9: Clean electrical energy from solar photovoltaic panels The 2000s saw the integration of Al into smart grids, which used machine learning algorithms to analyze data on energy use and adjust supply and demand in real-time. This helped to improve the efficiency of energy distribution and reduce waste. In the 2010s, Al was used to develop energy storage systems that could store excess energy and release it when needed. This was an important development as it allowed. energy companies to better manage the intermittent nature of renewable energy sources, such as solar and wind. Figure 1.9 shows solar photovoltaic panels. In recent years, Al has been used to increase energy efficiency by analyzing data on energy use and identifying ways to reduce waste. This has included the development of Al-powered systems that can optimize the energy use of buildings, factories, and other large energy consumers. Al has also been used in the oil and gas industry to analyze data on drilling and production and optimize operations. Law Enforcement In law enforcement, Al is actively used to help predict and prevent crimes. Specifically, Al can be used to analyze data from sources such as crime records, social media, and surveillance cameras to identify and predict patterns and trends in criminal activity. Early examples include the development and the use of Al in facial recognition (figure 1.10). Later, Al was integrated into police dispatch systems and used to monitor social media platforms for potential threats. More recently, Al has been used to develop drones for surveillance and to analyze footage from body-worn cameras worn by law enforcement officers. Al has played a significant role in law enforcement, •⚫enabling agencies to analyze large amounts of data, identify patterns and trends, and make more informed pil ill decisions about how to prevent and respond to crime. Ministry of Education 20 ZU24-1446 回 traordique of Figure 1.10: Face recognition and personal identification technologies
Energy AI has had a significant
Law Enforcement
Exercises 1 Read the sentences and tick ✓ True or False. True False 1. Mathematicians set the groundwork for understanding computation and reasoning about algorithms. 2. The Turing Test determines whether a computer has humanlike behavior. 3. Elmer and Elsie were the first robots to navigate obstacles using light and touch. 4. Al has only been used in the manufacturing industry for robots. 5. Al has not had any impact on the energy industry. 2 What is Artificial Intelligence (AI)? 3 Briefly explain some applications that Al is used for in real life. وزارة التعليم Ministry of Education 2024-1446 21
Read the sentences and tick True or False.
What is Artificial Intelligence (AI)?
Briefly explain some applications that AI is used for in real life.
4 5 6 Provide the key historical events that influenced the evolution of Al during the 1940s and 1950s. Outline how, in the 2010s, commercial applications of Al technologies were introduced. Summarize how Al applications can combat climate change through climate modelling and enhancements in the energy industry. وزارة التعليم Ministry of Education 22 2U24-1446