You are on page 1of 25

SW·AI Educational Contents with AIBot

[09] A.I Object Classification


[09] A.I Object[01]
Classification
AIBot과 친해지기

Learning Goal

A.I , Machine learning, Supervised learning

✓ You can learn what artificial intelligence is and understand the


learning process of artificial intelligence.

✓ You can experience a program that classifies blocks by color when


AIBot recognizes blocks using a model that learned block colors
from images.
1. Artficial Intelligence – Definition
1 What is Artificial Intelligence(A.I)?

Technology to the simulate human intelligence in machines that are programmed


to think and learn like humans.

Programs that allows learning and reasoning( judgment) to solve problems

2 Difference between A.I and program : Who makes the judgment?

Not A.I A.I


It’s human who tell the rules It only provides questions and answers
for solving problems. and does not involve rules.

Problems are solved based on standards A.I(program) decides on its own how to
set by human solve the problem.

www.jinirobot.com 3
1. A.I – Various A.I Technologies

Artificial Intelligence
Machine Learning Neural Network
Technology that implements
human intellectual abilities, Technology that improves A.I
Technology to process
such as cognition and learning, performance by allowing
information using an
through computers computers to learn on their own
artificial neural network
similar to human neurons

Continent Nation City

www.jinirobot.com 4
1. A.I – Machine Learning

Machine Learning

Supervised Learning Unsupervised Learning Reinforcement Learning

Learning with a Discovering patterns Learning based on


labeled training set in unlabeled data Feedback or reward

This is

elephant giraffe

That is

Classification, Prediction Clustering Reward

www.jinirobot.com 5
1. A.I – Example of Supervised Learning

(1) Problem (2) Learning (3) 적용

Find 100 pictures of dogs and cats on the Internet and After taking a picture of the cat,
[Problem] input them. And then tell the program whether each is a enter it into the program
Classify between dog or a cat. (Learning data)

dogs and cats.


This is a ‘dog’. A.I “Click”

Actually
Classify a computer
Between program
dogs and
cats.
This is a ‘cat’.
This is a
cat.

The process of telling the program that this is a ‘dog’ and this is a ‘cat’
is called the ‘learning process’.
www.jinirobot.com 6
2. [Experiential Program] Preview

Mission Classify objects using an A.I model for object classification.

[1] Let's look at the process of classifying red block and blue block. (No coding.)

[2] When the IBot camera recognizes a block, ABot classifies the block by color based on
an artificial intelligence learning model.

■ experiential program : [aibotscratch109]AIObjectClassification.sb3

www.jinirobot.com 7
3. Think about Algorithem

1 | Connect the image model of the teachable machine and broadcast a ‘image recognition’ message.

2 | When receiving a ‘image recognition’ message,


2-1 | The IBot camera faces the center of the floor to recognize colored blocks.
2-2 | ABot opens its gripper and waits, ready to grab the block.
2-3 | If the classification result of the recognized block is not ‘none’, broadcast an ‘object
classification’ message.

3 | When receiving a ‘object classification’ message


3-1 | Start object classification based on learning results
3-2 | Lift up the block and place it on the left or right by color.
3-3 | When classification is complete, broadcast the ‘image recognition’ message again.

www.jinirobot.com 8
4. Create an Image Model with a Teachable Machine

1) Access the Teachable Machine website 2) Open project from file

✓ Search for “teachable machine” on Google ✓ Select ‘Open an existing project from a file’
✓ Or enter the address directly in address bar Download the project file from ‘www.jinirobot.com’
( https://teachablemachine.withgoogle.com/ )

www.jinirobot.com 9
4. Create an Image Model with a Teachable Machine

3) Train A.I model and export model

✓ Train three types of image samples : red, blue, none


3

※ Check whether model training has been completed successfully.

www.jinirobot.com 10
4. Create an Image Model with a Teachable Machine

4) Upload A.I training model

✓ Upload the A.I model. Then copy and save your shareable link address.

※ The copied link will be used in Scratch, so be sure to copy it to a notepad, etc.

www.jinirobot.com 11
5. Teachable Machine in Scratch

✓ Classifies images taken with a webcam using the image project model trained on Google's Teachable Machine.

✓ Classifies sounds taken from a microphone using the audio project model trained on Google's Teachable Machine.

1 Add Extention

2 Choose ‘Teachable Machine’

www.jinirobot.com 12
6. Use Learning template

Download the experiential program


from the jinirobot website(https://www.jinirobot.com/) and use it!

Click ‘English
1 3
in upper menu bar

4
2 Click & download

[download file]

www.jinirobot.com 13
7. Ready to Code

③ 1 Sprite
- Adjust position and size

2 Variables [recognition]
- A variable to save the image classification results(image labels)
using the trained model.

① 3 List [Target Position]

- After adding 6 items, enter the angle values to control AIBot


to the target position.
[x] -190
- item 1 to 4: ABot angles to lift up the block.
[y] 100
[Size] 70 - item 5 and 6: IBot angles for recognizing the block with a camera.

www.jinirobot.com 14
7. Ready to Code
4 Broadcast and Receive message

3 ok

1 Click ‘New message’ Enter the new


2
message name

Category Block Description

When the message is received, the connected blocks below will run.

Broadcast message selected from the list

Broadcast message selected from the list and wait until the blocks finish running.

www.jinirobot.com 15
8. Process of A.I Object Classification
1 The process of classifying objects

1. The program prepares the 2. Recognize the block placed ] 3. Classify blue blocks to the right
camera for use in the center of the floor. and red blocks to the left.

www.jinirobot.com 16
8. Process of A.I Object Classification
2 When it’s difficult to hold an object : Change the target position for holding the object.

Target location obtained


in the lesson 8.

1st-axis ?? degree
2nd-axis ?? degree
1st-axis 90 °
3rd-axis ?? degree
2nd-axis 12 °
3rd-axis 54 °
※ When it’s difficult to hold an object, change the target position
to the angle values you obtained in <Mission 1 of lesson 8>.

www.jinirobot.com 17
9. Coding: Object Classification

Step.1 First, Connect the training model link and broadcast ‘image recognition’.



① When the program runs, set module speed to 4.

② Link to object classification training model copied from the teachable machine.

③ Broadcast the ‘image recognition’ message.

www.jinirobot.com 18
9. Coding: Object Classification

Step.2 When the ‘image recognition’ message is received and an object is recognized,
the ‘object classification’ message is broadcast.


① Receiving the 'Image Recognition’ message,

execute the following blocks


② Get ready to recognize and classify objects

- ABot : Open the gripper and wait.


- IBot : Camera points toward the center of
the floor for object recognition.


③ Broadcast ‘object classification’ message

- Repeat object recognition.


- If the recognized image label is not 'none’,
broadcast the 'object classification' message.

www.jinirobot.com 19
9. Coding: Object Classification

Step.3 When you receive the 'object classification' message, check the image label
again and state the classification result.


① Receiving the ‘object classification’ message,

execute the following blocks



② To prevent errors, recheck the classification results

③ and save them in variables.

③ If the classification result is not ‘none’,

Next Step execute the following process.

www.jinirobot.com 20
9. Coding: Object Classification

Step.4 Say the classification result of the block and lift up the block to classify it.

① [2-1] Stop on block

[2-2] Move 3rd-axis to lower to block position

② [2-3] Close the gripper to grab the block

[2-4] Lift the block slightly with the 2nd-axis upward.

① Say the recognized result.

② Control ABot to target position and lift up recognized block.

www.jinirobot.com 21
9. Coding: Object Classification
Step.5 Sort the block by color and place it on the left or right.

① ① Red block is sorted to the left.

② Blue block is sorted to the right.


③ Place the block on the floor.


[3-1] Lower the 2nd-axis.

[3-2] Open the gripper ④ Once classification is complete,
and place the block on the floor.
④ start ‘image recognition’ again.

www.jinirobot.com 22
10. Full Code

www.jinirobot.com 23
10. Full Code

www.jinirobot.com 24
10. Full Code

www.jinirobot.com 25

You might also like