Next

Introduction to Deep Learning

  • This lesson introduces deep learning concepts and explains how neural networks are used to solve complex AI problems.
  • Deep Learning Overview

    • Deep Learning (DL) uses artificial neural networks (ANNs) with many layers to learn hierarchical patterns in data.

    • Works exceptionally well for large datasets and complex patterns.

    • Can automatically extract features, reducing the need for manual feature engineering.

    Key Characteristics:

    • Multi-layered neural networks (Deep Neural Networks)

    • Learns non-linear relationships

    • Requires large datasets and high computational power


    History of Neural Networks

    Year

    Milestone

    1943

    McCulloch & Pitts – First artificial neuron model

    1958

    Perceptron by Frank Rosenblatt – Simple neural network

    1986

    Backpropagation – Algorithm to train multi-layer networks

    2006

    Deep Learning resurgence – Hinton & colleagues popularized deep networks

    2012

    AlexNet – Deep CNN wins ImageNet competition; Deep Learning becomes mainstream


    Machine Learning vs Deep Learning

    Feature

    Machine Learning

    Deep Learning

    Feature Engineering

    Manual

    Automatic

    Data Requirement

    Small to medium

    Large datasets

    Model Complexity

    Simple models (Decision Tree, SVM)

    Multi-layer Neural Networks

    Training Time

    Short

    Long (requires GPUs)

    Performance

    Good for structured data

    Excellent for unstructured data (images, audio, text)


    Applications of Deep Learning

    Domain

    Use Case

    Computer Vision

    Image recognition, object detection

    Natural Language Processing

    Chatbots, translation, sentiment analysis

    Healthcare

    Disease diagnosis from medical images

    Autonomous Vehicles

    Self-driving cars, traffic sign detection

    Speech Recognition

    Voice assistants, transcription

    Gaming & AI

    Reinforcement learning for strategy games


    AI → ML → DL Relationship

    • Artificial Intelligence (AI): Broad concept of machines mimicking human intelligence

    • Machine Learning (ML): Subset of AI, where machines learn from data

    • Deep Learning (DL): Subset of ML, uses deep neural networks to learn complex patterns

    Hierarchy Visualization:

    AI

     └── ML

          └── DL

    Simple Neural Network Example (Python / Keras)

Simple Neural Network Example in Python using TensorFlow (XOR Problem)

This Python example demonstrates how to build a simple Neural Network using TensorFlow and Keras to solve the XOR problem. The code creates a Sequential model with one hidden layer and an output layer, compiles it using the Adam optimizer and binary cross-entropy loss, and trains the model on a small dataset. Finally, it evaluates the model and prints the accuracy.

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np

# Example Dataset (XOR Problem)
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([0,1,1,0])

# Step 1: Create Model
model = Sequential()
model.add(Dense(4, input_dim=2, activation='relu'))  # Hidden Layer
model.add(Dense(1, activation='sigmoid'))            # Output Layer

# Step 2: Compile Model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])

# Step 3: Train Model
model.fit(X, y, epochs=500, verbose=0)

# Step 4: Evaluate
loss, accuracy = model.evaluate(X, y)
print("Accuracy:", accuracy)
  • Output Example:

    Accuracy: 1.0

    • Shows how a small neural network can learn a non-linear XOR pattern.

    • DL excels when scaling to thousands of neurons and layers with complex data.

Next