0% found this document useful (0 votes)
12 views37 pages

AI Training2024Haile

The document discusses the importance of learning artificial intelligence (AI) for future career opportunities, problem-solving skills, and staying informed about technological advancements. It covers the basics of AI, its applications, and how AI systems learn from data, including machine learning and deep learning concepts. Additionally, it provides practical steps for starting with AI, including programming and building models, along with examples of AI applications in real-world scenarios.

Uploaded by

nathanak278
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views37 pages

AI Training2024Haile

The document discusses the importance of learning artificial intelligence (AI) for future career opportunities, problem-solving skills, and staying informed about technological advancements. It covers the basics of AI, its applications, and how AI systems learn from data, including machine learning and deep learning concepts. Additionally, it provides practical steps for starting with AI, including programming and building models, along with examples of AI applications in real-world scenarios.

Uploaded by

nathanak278
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Yibeltal Liulekal

Software & Hardware Dev’r

Tech-Assistant at BiTec

Artificial Intelligence
Why should you learn about AI?
1. Future-Proof Career Skills
AI is transforming industries, creating new jobs, and redefining
existing ones. Understanding AI gives a competitive edge in the job market.

2. Problem-Solving and Critical Thinking


Studying AI encourages analytical thinking and problem-solving skills.
learn to develop algorithms and models to solve complex problems.

3. Staying Informed: Being informed about AI helps students stay updated with
technological advancements & understand the potential and limitations of AI
technologies.
1
Artificial Intelligence
Artificial intelligence (AI), the ability of a digital computer to
perform tasks commonly associated with intelligent beings.
such as
 The ability to reason
 The ability to make decisions
 The ability to Learn /from past experience/

AI can be composed of algorithms & its algorithms can learn from data

2
Application of Artificial intelligence
• Image Recognition
• Forecasting
• Recommendation (TikTok ,Youtube)
• Voice Assistant
• Self-driving Car
• Fraud detection
3
Top AI user companies
for content recommendation and real-time translation on its social
platforms. This helps in delivering personalized content to users and
breaking language barriers, making communication more seamless.

to optimize its supply chain, improve product recommendations,


and enhance the conversational abilities of its voice assistant, Alexa.
For instance, AI analyzes images & videos to improve product
listings & recommendations, making the shopping experience more
personalized &efficient

for its autonomous driving technology. to process vast amounts of


data from sensors and cameras to enable self-driving capabilities,
enhancing safety and convenience for drivers 4
How does AI work
AI systems learn from data, just like students learn from textbooks
Data Collection
and teachers. This data can be anything from text ,images, videos

An algorithm is a set of rules or instructions a computer follows to


Algorithms solve a problem or complete a task.

Machine Learning: This is a type of AI where algorithms are


Training trained using data. During training, the AI system processes the
data and learns patterns

Prediction and Once the AI system is trained, it can make predictions or decisions
Decision Making based on new data

Feedback Loop Continuous Learning: AI systems can improve over time by


continuously learning from new data and feedback.
5
Building blocks of AI
AI is powered by machine learning and deep learning

6
Cont..

Machine Learning (ML): Machine learning is a broad field that involves


teaching computers to learn from data.

Deep Learning (DL): Deep learning is a specific subset of machine learning


that focuses on neural networks with many layers (hence “deep”).

These include Convolutional Neural Networks (CNNs) for image recognition


and Recurrent Neural Networks (RNNs) for sequence data like speech and
text.

7
Types of Machine Learning

Supervised unsupervised Reinforcement


Learning Learning Learning

Has labeled Has Input Data No input data.


input data. but not labeled. It learn from
environment
Eg. Cat or dog Eg. Face or not face
Eg. Trial & Error , like we
learn from our mistkes 8
AI in BiT Maker Space
• Face Recognition gate security
Done by hayat essa

• Blind eye glass


Done by Hermela Getnet and Yibeltal.L

• Vehicle Driver Anti-sleep alert

9
Deep Learning
Convolutional Neural Network (CNN)
A CNN is a neural network designed to automatically and adaptively
learn spatial features from input images. It consists of multiple layers,
including convolutional layers, pooling layers, and fully connected
layers.
Key Components:
• Convolutional Layer
• Pooling Layer
• Fully Connected Layer 10
Cont..
• Convolutional Layers: These layers apply filters (or kernels) to
the input image to create feature maps, highlighting important
features like edges and textures

11
Cont..

• Pooling Layers: These layers reduce the spatial size of the


feature maps, making the model more efficient.

12
Cont..
• Fully Connected Layers: similar to neural networks,
we take the features extracted by the convolutional & pooling
layers and use them to classify the image.

Input Hidden Layer Output

13
Cont..

Convolutional Neural Network (CNN)


14
Cont…
Convolutional Neural Network (CNN)

15
Convolutional Neural Network (CNN) Application

CNNs are used in various applications, such as:


• Image Classification: Identifying objects in images (e.g., identifying
cats vs dogs).
• Object Detection: Detecting and locating objects within an image.
• Image Segmentation: Dividing an image into segments for easier
analysis (e.g medical imaging).
16
How do I to Start AI ?

Step-1: Learn basic programming (python, c or c++)


Step-2: Learn basic Algebra and calculus
Step-3: Build things from scratch
(Regression, classification...)
Step-4: Learn to use libraries
(Tensorflow, scikit-learn, keras…)
17
Deep Learning with Example
We'll create a basic image classifier that can distinguish between
different types of fruits using a deep learning model called a
Convolutional Neural Network (CNN).

This simple example demonstrates the basic steps involved in building,


training, and using a deep learning model for image classification.

Tool needed:
• Programming Language: Python or C
• Libraries: TensorFlow and Keras libraries
18
Cont..
Step1 Install python libraries
pip install tensorflow

Step2 Load the Dataset (dataset of images stored in folders named apples,
bananas, and oranges.)

Train the Model. The CNN model consists of convolutional layers for
feature extraction and pooling layers to reduce spatial dimensions. The
Step3 final dense layers are used for classification.

After the Train we will get .h5 files


For example: fruit_classifier_model.h5

Step4 Test the trained model


Cont..
import tensorflow as tf
Step1
from tensorflow.keras import layers, models
from tensorflow.keras.preprocessing.image import ImageDataGenerator

Step2
Load the Dataset (dataset of images stored in folders named apples,
bananas, and oranges.)

20
Step2 Load the Dataset
# Set up data generators
train_datagen = ImageDataGenerator (rescale=1/255, validation_split=0.2)
train_generator = train_datagen.flow_from_directory (
'path/to/dataset',
target_size=(150, 150),
batch_size=20,
class_mode='categorical',
subset='training‘
)

# Batch_size; the number of image process in one batch/round/

# 'categorical; to convert the class-mode into one hot encoding, enabling effective
training and accurate classification 21
Cont..

validation_generator = train_datagen.flow_from_directory (
'path/to/dataset',
target_size=(150, 150),
batch_size=20,
class_mode='categorical',
subset='validation‘
)

22
Step3 Train the Model.

# Build the CNN model


model = models.Sequential ([
layers.Conv2D ( 32, (3, 3), activation='relu', input_shape=(150, 150, 3) ),
layers.MaxPooling2D ( (2, 2) ),
layers.Conv2D (64, (3, 3), activation='relu'),
layers.MaxPooling2D ((2, 2)),
layers.Conv2D (128, (3, 3), activation='relu'),
layers.MaxPooling2D ((2, 2)),
layers.Flatten(),
layers.Dense (512, activation='relu'),
layers.Dense (3, activation='softmax') # 3 classes: apples, bananas, oranges
])
# Compile the model
model.compile (optimizer='adam',
loss='categorical_crossentropy',metrics=['accuracy'] )
23
Cont..
# Train the model

trained_model = model.fit (
train_generator,
steps_per_epoch = train_generator.samples / 20,
epochs=10,
validation_data = validation_generator,
validation_steps = validation_generator.samples / 20
)
# Save the model
model.save('fruit_classifier_model.h5')
24
Testing the Model
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import numpy as np

model = load_model(“fruit_classifier_model.h5”) # Load the trained model

# Load and preprocess a new image


img_path = “fruit_image.jpg”
img = image.load_img ( img_path, target_size=(150, 150) )
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0)
img_array = img_array /255.0
25
Cont..

# Predict the class


predictions = model.predict(img_array)

class_names = ['Apple', 'Banana', 'Orange']

predicted_class = class_names[np.argmax(predictions)]

Print (“The image is :” , predicted_class)

26
Our CNN Expected Results

Apple
Banana

Orange

27
Computer Vision
Computer Vision: is a field of technology that enables computers to "see" and
understand the world just like humans do. It's all about teaching computers to
interpret and process visual information from the surrounding environment

• Image Capture: Just like your eyes see things, a computer uses cameras or
sensors to capture images or videos.

• Image Processing: The computer processes these images using various


algorithms. It looks at shapes, colors, and patterns to make sense of what it's
seeing.

• Analysis and Interpretation: After processing the images, the computer


can analyze and understand what it sees. For instance, it can recognize
objects, people, and even actions. 28
Computer Vision in Real World
• Facial Recognition: When your phone unlocks by recognizing your
face.

• Object Detection: Self-driving cars recognizing traffic lights,


pedestrians, and other vehicles.

• Medical Imaging: Helping doctors detect diseases from X-rays or


MRIs.

• Augmented Reality: Games like virtual objects are placed in the


real world through your phone's camera.
29
Computer Vision in Real World

30
Computer Vision in Real World
Object Detection & Recognition Example using Python

import cv2
import numpy as np
import yolov5

# Load YOLOv5 model


model = yolov5.load("yolov5s.pt")

# Load image
img = cv2.imread("path_to_your_image.jpg")
results = model(img) 31
Object Detection & Facial Recognition Example using Python
# Draw bounding boxes and labels

for result in results:


x1, y1, x2, y2, conf, cls_conf, cls = result
label = model.names [ int(cls) ]
cv2.rectangle(img, (x1, y1), (x2, y2), (255, 0, 0), 2)
cv2.putText(img, label, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 0, 0), 2)

# Display the image

cv2.imshow("Image", img)
cv2.waitKey(0)
cv2.destroyAllWindows() 32
Object Detection Results

33
AI in Everyday Life

34
Future of AI

35
Thank You

09-21-67-21-01 @ThePlusTech1

Credit: Slid template by fppt.com 36

You might also like