L1 Terminology (AI) Part 1 - PDF
Document Details
Uploaded by RoomierMossAgate8588
Tags
Summary
This document details the fundamental concepts of Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL). It explains these concepts and outlines examples of how these technologies are used.
Full Transcript
1 L1 Terminology (AI) Part 1 2 Relationship Between AI, ML, and DL Artificial intelligence (AI) Machine learning (ML) Deep learning (DL) 3...
1 L1 Terminology (AI) Part 1 2 Relationship Between AI, ML, and DL Artificial intelligence (AI) Machine learning (ML) Deep learning (DL) 3 Artificial intelligence (AI) What is Artificial intelligence? Artificial intelligence is the branch of computer science that focuses on creating systems to perform tasks that need: learning, reasoning, problem solving … Purpose: AI helps humans accomplish tasks like: Solving problems Recognition (e.g., face, voice) Decision-making (sometimes more effectively than humans) 4 Artificial intelligence (AI) Example: Voice Assistants (e.g., Siri, Alexa, Google Assistant) How it Works: 1.Understanding the Question 2.Searching for an Answer 3.Providing a Response While this seems simple, it involves multiple layers of AI 5 Machine learning (ML) What is Machine Learning? In fact, Arthur Samuel, one of the pioneers of machine learning, defined machine learning as a ‘Field of study that gives computers the ability to learn without being explicitly programmed’. 6 Machine learning (ML) Machine learning can be defined as an approach to achieve artificial intelligence through systems or software models that can learn from experience to find patterns in a set of data. 7 Depp learning (DL) What is Deep Learning? Deep learning is a type of machine learning that uses neural networks to build complex patterns in data. Inspired by the human brain, neural networks consist of layers of nodes that process and learn from data. The more layers, the deeper the analysis, hence the term “deep”. 8 Deep learning (DL) Identifying a person from thousands of images of faces How Deep Learning Works Deep learning models are trained on millions of images to recognize unique features, allowing them to identify faces under different conditions (lighting, angle, facial expressions). Applications: Smartphones (Face ID for unlocking devices) Security (identification of individuals) 9 Relationship Between AI, ML, and DL AI gained popularity in 1950, ML in 1980, and DL in 2010. Deep learning is a subset of machine learning, which is a subset of artificial intelligence. Tools and Platforms for AI Implementation 11 Tools and Platforms for AI Implementation Machine Learning and Deep Learning involve complex computations and large datasets, which require high-performance hardware like advanced CPUs and GPUs. Indeed, personal computers have limited processing power and are often inadequate for demanding AI applications. Platforms like Google Cloud, AWS, and Microsoft Azure provide scalable and virtually unlimited computing resources. They enable researchers and developers to train models efficiently without investing in expensive hardware. 12 Why Use Cloud Computing for AI? No Need for Expensive Hardware Rent powerful computing resources instead of buying costly computers. High Performance Cloud uses advanced servers, offering much higher processing power than personal PCs. Affordable Subscriptions Cloud services are generally low-cost due to competition between providers (Google Cloud, AWS, Microsoft Azure). 13 Which Programming Language is Best for AI? Multiple Options: C, C++, Java, Python and others can be used for AI development. 14 What is Python? Python was created by Guido van Rossum, and released in 1991. It’s one of the most popular and most practical programming languages. It’s very useful for Rapid Application Development due to: its simple and easy syntax. its support and compatibility to modules and packages. Here are some of Python’s other features: High-level programming language Dynamically-typed Interpreted language Python 15 Python as an Interpreted Language Python is an interpreted Language. For code to be executable, or usable, it needs to be compiled or interpreted. 16 Python Installation with Anaconda There are several ways to install Python. Let's take a look at the most efficient way: Installing anaconda for windows, macOS & Linux. Note that Anaconda is a free and open-source distribution of Python. https://www.anaconda.com/download 17 Why Use Virtual Environments for Different Projects? False Utilization: Correct Utilization: One global environment for all projects Separate Environments for Each Project Library version 1.0 Library version 1.0 Library version 2.0 Library version 2.0 Project 1 Project 2 Project 1 Project 2 Environment Environment 1 Environment 2 Problem: Conflicts arise between library Benefit: No conflicts, easier management, and faster versions. development. 18 https://www.anaconda.com/download To install anaconda: Download Anaconda Launch the Installer Follow the Installation Steps 19 Conda channel Conda, a channel is a location where packages are stored and from which Conda installs those packages. Each channel can host various packages, and they can be managed and accessed when you use Conda commands. The default channel is the package repository that comes with the Anaconda distribution. Stability Simplicity Limited Packages 20 Conda-forge Conda-forge is a community-driven channel that provides a wide range of packages for Conda. Community Maintained Cross-platform Compatibility Better dependency resolution >> Anaconda prompt conda install numpy -c conda-forge 21 PyPI PyPI is the official repository for Python packages, where developers can publish and share their libraries. Vast Library of Packages Latest Versions >> Anaconda prompt pip install numpy 22 Introduction to Programming Basics Now that Python is installed with Anaconda, let’s explore the basics: Variables and Data Types Conditional Statements Loops Functions 23 What Are Variables and Data Types in Programming? What is a Variable? A variable is used to store a value. It acts as a container for data in any programming language. Common Data Types: int: For integers numbers (e.g., 2, 3, 5). float: For decimal numbers (e.g., 3.14, 7.5). str: For text (e.g., "hello", "AI"). bool: For binary values (True/False or 0/1). 24 Using Variables and Data Types: Example Example of variable initialization in python: Python is a dynamically-typed language, making it simpler and faster to write code. 25 What Are Conditions in Programming? Conditions are used to make decisions in code. A block of code is executed only if the condition is true. Example: Check a person’s age and display a message based on their age: Under Age Just Turned 18 Adult 26 Using Conditions: Example Example of using conditions : Step 1: Declare a Variable Step 2: Write Conditional Statements Output: Since Age = 18, Python will display: "You just turned 18, congratulations!" 27 What Are Loops in Programming? The for loop is a very practical tool for repeating an action several times without having to write the same code over and over again. Why Use Loops? Efficiently repeat actions. Avoid redundancy and save time. Common Use Cases: Iterating over lists. Managing number sequences. Analyzing text character by character. 28 Using Loops: Example Approach A: Using a Loop Approach B: Without a Loop Start of the loop (A) (B) (B) Problem: Repetitive and inefficient. Clearly, Approach A: It solves the problem in just two lines, making the code cleaner and scalable. 29 What Are Functions in Programming? A function is a block of code designed to perform a specific task. To Define a Function, we use the def keyword, followed by the function_name, arguments in parentheses, and a (:) def function_name(arguments): # Code to execute # Code to execute # Code to execute Steps When a Function is Called: Input: Python retrieves the function's arguments. Processing: The function performs operations the input data. Output: It returns a result or performs an action (e.g., prints a message). 30 Using Functions : Example Example of using functions: Create a function to display numbers from 1 to X, where X is provided by the user. Processing Result Calling my function (A) (B) 31 When Do We Use Libraries? Basic Python Complex or Specific Functions Functionality 32 What Are Libraries in Python? Libraries are a collection of modules (Python files) that provides specific functionality. Why Use Libraries? Sometimes, we need more complex or specific functionality. Instead of writing all the code from scratch, we use libraries that provide pre-built functions. 33 Popular Python Libraries Libraries Provide Pre-built Functions, these libraries give us ready- to-use functions to perform common tasks, saving time and effort. Examples of Common Python Libraries: Math, Random, Numpy: For mathematical calculations. Pandas: For data manipulation and analysis. Matplotlib: For data visualization (e.g., creating charts and graphs). Scikit-learn: For building machine learning and AI models. 34 Calculation Library : Math Using the math library, we can perform complex calculations easily. In this example, we used the sqrt() function to calculate the square root of a number. The result = 4 35 Calculation Library : Random Random library is used to generate random numbers. It’s useful in many situations, such as simulations or games. Result: 36 Calculation Library : Numpy NumPy library is used for numerical computations and working with arrays of data. It offers a large collection of high-level mathematical functions to operate on large and multi- dimensional arrays like matrices. 37 Data science Library : Pandas Pandas library is used for data manipulation and analysis, especially when data is organized in tabular form (like spreadsheets or CSV files). It offers high- performance, easy-to-use data structures and data analysis tools. 38 Plotting Library : Matplotlib Matplotlib is 2D plotting library that produce quality figures. We use it for data visualization. This library allows us to visualize data through various types of plots such as line chart, bar charts, and histograms. 39 Plotting Library : Matplotlib Example of using Matplotlib library to create a bar chart. Visualizing data makes it easier to spot trends, relationships, and patterns, which are crucial for data analysis and decision-making. 40 Machine Learning Library : Scikit-learn Scikit-learn is an advanced library primarily used for machine learning tasks such as classification, prediction, and data analysis. It offers various classification, regression and clustering algorithms. It is designed to handle both small and large datasets and can be used to create machine learning models for real-world applications. 41 Machine Learning Library : Scikit-learn Example: we want to classify fruits into two categories: apples and oranges, based on their weight and size. Machine Learning Google Utilizing AI Google Photos uses machine learning in smart search to display photos related to the keywords you searched for and animate similar photos from your albums into quick videos. Google Utilizing AI The Smart Compose and Smart Reply features of Gmail uses AI to suggest phrases and complete sentences when you draft an email or a reply. The spam filter uses artificial neural networks to analyze and flag spam messages. Google Utilizing AI Google Assistant has recently launched a new feature called Google Duplex that lets AI take over some real-world task such as booking a haircut appointment over phone. Google Utilizing AI The feature Talk to Books lets you make a statement or ask a question and surfaces relevant passages from the books using machine learning. 47 Machine Learning Process ML leverages on existing data, images, and videos to train algorithms and models. Numerous set of examples are fed into the system and are called training sets. The larger the training set, the more accurate the ML system would be. Each item in a training set is labeled either 0 or 1. 48 Machine Learning Process ML leverages on existing data, images, and videos to train algorithms and models. Numerous set of examples are fed into the system and are called training sets. The larger the training set, the more accurate the ML system would be. Each item in a training set is labeled either 0 or 1. 49 Machine Learning Process ML leverages on existing data, images, and videos to train algorithms and models. Numerous set of examples are fed into the system and are called training sets. The larger the training set, the more accurate the ML system would be. Each item in a training set is labeled either 0 or 1. 50 Find data : Collect the data ourselves Weather application Healthcare application measuring humidity or wind speed Recording of the electrical activity of the heart, and the brain 51 Find data: Datasets Sometimes it's not possible to collect the data ourselves. Why ? Cost issue Sensors such as LiDAR (Light Detection and Ranging) are very expensive LiDAR (Light Detection and Ranging) 52 Find data: Datasets Complex application Cancer detection data are difficult to obtain. Where to Download Datasets for AI Projects 53 Kaggle https://www.kaggle.com/ UCI Machine Learning Repository https://archive.ics.uci.edu/ Image-Net https://image-net.org/ TensorFlow https://knowyourdata.withgoogle.com/ 54 Datasets type Tabular datasets This is data organized in rows and columns, as in a CSV or Excel file. They are commonly used in tasks such as classification or regression. 55 Datasets type Image datasets, often stored in JPEG or PNG formats, are essential for computer vision. They enable tasks such as facial recognition or object detection. 56 Datasets type Text datasets Audio datasets.TXT WAV ou MP3