Unit 2 - Notes

CSE121

Unit 2: Artificial Intelligence & Machine Learning

1. Introduction to AI, ML, and Deep Learning

These three terms are often used interchangeably, but they represent a hierarchy of complexity and capability.

A. Artificial Intelligence (AI)

  • Definition: AI is the broad branch of computer science concerned with building smart machines capable of performing tasks that typically require human intelligence.
  • Goal: To simulate human cognitive functions such as learning, problem-solving, and decision-making.
  • Types of AI:
    1. Narrow AI (Weak AI): Designed for a specific task (e.g., Siri, Chess bots). This is the current state of AI.
    2. General AI (Strong AI): A theoretical form of AI where a machine would have an intelligence equal to humans; it could solve problems across various domains.
    3. Super AI: Theoretical intelligence that surpasses human intellect.

B. Machine Learning (ML)

  • Definition: A subset of AI that focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.
  • Mechanism: Instead of explicit programming (If-Then rules), ML algorithms find patterns in data to make predictions.
  • Key Types of ML:
    • Supervised Learning: The model learns from labeled training data (Input + Correct Output).
    • Unsupervised Learning: The model finds structure in unlabeled data (e.g., clustering customers).
    • Reinforcement Learning: The model learns through trial and error, receiving rewards or penalties (e.g., teaching a robot to walk).

C. Deep Learning (DL)

  • Definition: A subset of Machine Learning based on Artificial Neural Networks (ANNs) with three or more layers.
  • Mechanism: It attempts to simulate the behavior of the human brain—albeit far less rigorously—allowing it to "learn" from large amounts of data.
  • Architecture:
    • Input Layer: Receives data.
    • Hidden Layers: Perform mathematical transformations on inputs. Deep learning implies many hidden layers.
    • Output Layer: Delivers the prediction.

Hierarchy Visualization:

AI (Broadest) ML (Subset of AI) Deep Learning (Subset of ML).


2. Specialized Systems

A. Expert Systems

An expert system is a computer program that emulates the decision-making ability of a human expert.

  • Components:
    1. Knowledge Base: Contains domain-specific, high-quality knowledge (facts and rules).
    2. Inference Engine: Applies logical rules to the knowledge base to deduce new information.
    3. User Interface: Allows the non-expert user to query the system.
  • Characteristics: High performance, reliable, capable of explaining its reasoning.
  • Example: MYCIN (used for identifying bacteria causing severe infections).

B. Fuzzy Systems (Fuzzy Logic)

Conventional computing is based on Boolean logic (True/False, 1/0). Fuzzy logic deals with reasoning that is approximate rather than fixed and exact.

  • Concept: It handles the concept of "partial truth," where the truth value may range between completely true and completely false.
  • Applications:
    • Air Conditioners: Adjusting cooling based on "slightly hot" vs. "very hot."
    • Washing Machines: Determining wash cycles based on load weight and dirtiness.
    • Automotive Systems: ABS brakes and transmission control.

3. Augmented Reality (AR)

  • Definition: An interactive experience where real-world environments are enhanced by computer-generated perceptual information (visual, auditory, haptic).
  • Difference from VR (Virtual Reality):
    • VR: Completely replaces the real world with a simulated one.
    • AR: Overlays digital elements onto the actual real world.
  • Technologies Used: Computer vision, simultaneous localization and mapping (SLAM), and depth tracking.
  • Examples: Pokémon GO, Snapchat filters, IKEA Place app (visualizing furniture in a room).

4. Use of AI in Different Fields

A. Natural Language Processing (NLP)

NLP gives machines the ability to read, understand, and derive meaning from human languages.

  • Applications:
    • Sentiment Analysis: Determining if a customer review is positive or negative.
    • Chatbots: Automated customer support.
    • Text Summarization: Creating concise summaries of long articles.

B. Healthcare

  • Diagnostics: analyzing X-rays, CT scans, and MRIs to detect tumors or fractures faster than radiologists.
  • Drug Discovery: Predicting how molecules interact to speed up pharmaceutical development.
  • Personalized Medicine: Tailoring treatment plans based on a patient's genetic makeup and medical history.

C. Agriculture

  • Precision Farming: Using AI to determine the optimal amount of water, fertilizer, and pesticides.
  • Crop Monitoring: Drones equipped with computer vision to detect disease or pest infestations early.
  • Automated Harvesting: Robots capable of identifying ripe fruits and picking them without damage.

D. Social Media Monitoring

  • Content Moderation: Automatically detecting and removing hate speech, violence, or explicit content.
  • Recommendation Engines: Algorithms (e.g., TikTok, Instagram) that analyze user behavior to suggest content that keeps them engaged.
  • Ad Targeting: Analyzing user interests to serve highly relevant advertisements.

5. Case Studies: Prominent AI Implementations

A. Google Translator

  • Technology: Uses Neural Machine Translation (NMT).
  • Function: Instead of translating piece-by-piece, NMT considers the entire input sentence as a unit. It uses deep learning (Recurrent Neural Networks or Transformers) to predict the most likely sequence of words in the target language.

B. Driverless Cars (Autonomous Vehicles)

  • Key Technologies:
    • LiDAR & Radar: For distance sensing and 3D mapping.
    • Computer Vision: To "see" traffic lights, pedestrians, and lanes.
    • Sensor Fusion: Combining data from all sensors to make a decision.
  • Levels: Ranges from Level 0 (No automation) to Level 5 (Full automation, no steering wheel required). Companies involved include Waymo and Tesla.

C. Alexa and Siri (Virtual Assistants)

  • Workflow:
    1. Wake Word Detection: Listening for "Alexa" or "Hey Siri."
    2. Speech-to-Text (ASR): Converting audio waves into text.
    3. NLP/NLU: Understanding the intent of the text (e.g., "What's the weather?").
    4. Action/Response: Querying a database.
    5. Text-to-Speech (TTS): Synthesizing a human-like voice to respond.

D. ChatGPT (Generative Pre-trained Transformer)

  • Type: Large Language Model (LLM).
  • Architecture: Based on the Transformer architecture (specifically GPT-3.5/4).
  • Mechanism: Trained on massive datasets of text to predict the next word in a sequence. It uses Reinforcement Learning from Human Feedback (RLHF) to fine-tune responses to be helpful and safe.
  • Capability: Can generate code, essays, poetry, and converse in a human-like manner.

6. Tools and Techniques for Implementing AI

A. Programming Languages

  1. Python: The industry standard due to its simplicity and vast library ecosystem.
  2. R: Preferred for statistical analysis and data visualization.
  3. C++: Used for high-performance requirements (e.g., game AI, robotics).
  4. Java: Used in enterprise-level systems.

B. Libraries and Frameworks

  • TensorFlow (Google): End-to-end open-source platform for machine learning.
  • PyTorch (Facebook/Meta): Popular in research for its dynamic computation graph.
  • Scikit-learn: Good for classical ML algorithms (regression, clustering).
  • Keras: High-level neural networks API (runs on top of TensorFlow).
  • OpenCV: Library specifically for Computer Vision tasks.

C. Techniques

  • Neural Networks: Mimicking brain neurons.
  • Decision Trees: Tree-like models of decisions.
  • Support Vector Machines (SVM): For classification problems.
  • Regression Analysis: Predicting continuous values (e.g., house prices).

7. Current Trends and Opportunities

Current Trends

  1. Generative AI: Focus on creating new content (images, video, text) rather than just analyzing existing data (e.g., Midjourney, ChatGPT).
  2. Edge AI: Running AI algorithms locally on devices (phones, IoT) rather than in the cloud to improve privacy and latency.
  3. Explainable AI (XAI): Developing models where the decision-making process is transparent and understandable to humans (crucial for law and medicine).
  4. AI Ethics and Regulation: increased focus on bias, copyright, and safety in AI deployment.

Opportunities

  • Business Automation: Streamlining supply chains and customer service.
  • Creative Industries: AI-assisted art, music generation, and scriptwriting.
  • Cybersecurity: AI-driven threat detection and response systems.

8. Job Roles and Skillsets

A. Key Job Roles

  1. Machine Learning Engineer: Designs and builds ML systems; focuses on scaling and deployment.
  2. Data Scientist: Analyzes complex data to help organizations make decisions; builds prototypes.
  3. AI Research Scientist: Focuses on pushing the boundaries of AI technology (academic or R&D).
  4. NLP Engineer: Specializes in language-related AI tasks.
  5. Computer Vision Engineer: Specializes in image and video processing.
  6. AI Ethicist: Ensures AI systems are fair, transparent, and comply with regulations.

B. Required Skillset

  • Hard Skills:
    • Mathematics: Linear Algebra, Calculus, Probability, and Statistics.
    • Programming: Python, SQL, C++.
    • Data Handling: Data cleaning, preprocessing, and visualization (Pandas, Matplotlib).
    • Algorithms: Understanding of Neural Networks, Gradient Descent, etc.
  • Soft Skills:
    • Problem Solving: Converting business problems into mathematical models.
    • Domain Knowledge: Understanding the specific industry (e.g., finance or bio) to apply AI effectively.
    • Communication: Explaining complex technical concepts to non-technical stakeholders.