יסודות בינה מלאכותית : RB29-10 – אימון בינה מלאוכתית YOLO8

יסודות בינה מלאכותית : RB29-10 – אימון בינה מלאוכתית YOLO8

 

 

 

 

חלק א : אימון yolo colab

1.1 קישור לתוכנה לסימון תוויות עבור YOLO מודל     : https://www.makesense.ai/


תרגיל כיתה 2

YOLO מודל

  1. יש לעבוד לפי הסרטון שלב אחרי שלב .
  2. הסרטון הוא המשך של הרצאה RB23-09 RB23-08 שם מוספר שלב אחרי שלב של התקנת הסביבה פיתוח , תוספים

 


תרגיל כיתה 2

YOLO מודל

אימון רשת זיהוי טנק

2.1  נעבור על הקוד שלב אחרי שלב


סביבת קולאב    COLAB : –  YOLO מודל yolo

שלב 1 :  התקנת הסיפריות (עושים פעם אחת בלבד בסביבת הפיתוח)

 

בסוף התקנת הספריות אם אין שגיעות נקבל הודעת DONE כלומר סיים להתקין


שימו לב : סיבבת הפיתוח הקבצים תראה כך לפני ההתקנה

 

 

אנחנו עובדים על ספריית CONTENT

 

 

 

 

 


שלב 2 : יצירת קובץ yaml

 

לאחר ההתקנה נקבל

ואפשר לראות את תוכן הקובץ – קליל כפול עם העכבר על שם הקובץ

 

 

חילוץ הקובץ  מ RAR : 

 

לאחר החילוץ RAR ולחיצה על TANK

 

 

 

 

 

 

שלב 3 :  התקנת קבצי התמונות והתוויות – (labels)  בסביבת – אימון

נתקין את התונות על יהיה העתקה  או יבואו או הורדה לסביבית הפיתוח שנאמן את הבינה המלאכותית – חייב להיות מאוד מדוייק – טעות הכי קטנה וזה לא יעבוד . . סביבת האימון יכולה להיות COLAB או ANACONDA  או אחר  ?

………………………………………………………………………………………………

נוריד מ GOOGLE DRIVE קובץ RAR שמכיל תמונות ו LABELS במבנה  הנכון – חובה מבנה נכון 

 

חילוץ קובץ RAR

 

https://colab.research.google.com/gist/RoboWild/19deff31306d95d2e315a9e1d331f156/yolo-train.ipynb

 

 

 

 

שלב 4 : אימון בינה מלאכותית מודל YOLO

יבוא ספריות , ויבוא המודל

 

נקבל את הספריות הבאות שימו לב על קובץ YOLOV8M.PT 

 

 

 

אימון הבינה מלאכותית  לפי קובץ YAML – זה המקום שהבינה מלאכותית לומדת

 

בסוף האימון של הבינה מלאכותית נקבל את הפלט הבא :

 

פעולת האימון של הבינה מלאכותית הסתיימה 

מודל שלנו מאומן


שלב 5: בדיקה איך הבינה שלנו למדה ניתוח הליך הלימוד  – נילמד בהמשך

 


שלב 6 : הרצה של קובץ של המודל שאומן

 

נחפש בתוך ספריית RUN את ה DETECT האחרון אם נרית כמה פעמים המספר יכול להשתנות של DETECT

 

 

 

נגדיר אובייקט PRE לפי המיקום של הקובץ BEST.PT

שימו לב : המיקום עשוי להשתנות בנתיב לפי שינוי בשם DETECT 

ואז ניטען אותו – אפשר להעביר למחשבים אחרים או מיקרו מעבדים שונים

 

הרצה של הבינה מלאכותית – שורת קוד אחת בלבד !  כל השאר קוד פייתון

 

את התוצאה נקבל לתוך ספריה

 

קוד מתקדם יותר

https://colab.research.google.com/drive/1Iim5HYrT0wGJyEc6SHFkiZtkRmlLiv70#scrollTo=PQXWhPmU5NBk

 

 

 

 

 

 

 

 



 

 

 

 

 

 


תרגיל כיתה 3 : 

1.מטרה היכרות  ראשונית של סביבית לימוד סביבת אנאקונדה – גוביפטר נודבוק (מקבילה לקולאב – מתחרה שלה) – לא להתבלב

 

 

 

2. תרגול קוד פייטון


 

 


 

 



תרגיל 3  OPENCV

נעבוד על התמונה :

 

התקנה של הספריות בפייטון

 

 

 

פ


פילטרים :

 

 

 

 

 

 


חלק ב : אימון YOLO אנקונדה 

קישור לתוכנה לסימון תוויות עבור YOLO מודל     : https://www.makesense.ai/

 

 

 

 

 

 

 

TensorFlow or PyTorch, in YOLOv8, the box_loss, cls_loss, and dfl_loss are error/loss

 

Concept TensorFlow / PyTorch YOLOv8 Equivalent
Loss Function loss = error between y_pred & y_true box_loss, cls_loss, dfl_loss
Training Goal Minimize the loss Minimize YOLO losses
High Loss Model is not learning well Same meaning in YOLO
Low Loss Model is making better predictions Same

In YOLO, these loss values are just split into parts specific to object detection:

  • box_loss = position error

  • cls_loss = label/class error

  • dfl_loss = precision of bounding box edges

All together, they behave like a regular total loss in TensorFlow.

values.

 

Loss Type What It Measures Meaning of High Value Goal
box_loss Error in the predicted box position & size Boxes are inaccurate ↓ Lower is better
cls_loss Error in predicting the correct object class AI is guessing wrong labels ↓ Lower is better
dfl_loss Precision error in box shape (Distribution Focal Loss) Shape/edges of box are off ↓ Lower is better

🔧 In simple terms:

  • Loss is the AI’s mistake counter.

  • The higher the value = the more wrong the AI is.

  • During training, loss should go down. If it stays high, something is wrong (not learning).

 

Parameter Your Value What It Means (Simple) Bad Value Good Value Best Value Your Rating
Epoch 100/100 How many rounds the AI trained. More rounds = better learning, but too much can be bad. <50 or >300 50–300 100–200 ✅ Good
GPU_mem 0G Shows if the AI used a fast brain (GPU). If 0G, it used a slow one (CPU). 0 >0 4G–12G+ ❌ Bad
box_loss 0.8291 Measures how wrong the AI is at drawing boxes around objects. Lower is better. >0.5 <0.5 <0.2 ❌ Bad
cls_loss 0.9094 Measures how wrong the AI is at naming what it sees (dog, cat, etc.). Lower is better. >0.5 <0.3 <0.1 ❌ Bad
dfl_loss 1.021 Checks how well the AI guesses the exact size/shape of objects. Lower is better. >0.5 <0.3 <0.1 ❌ Bad
Instances 4 Average number of objects per image the AI sees. N/A Info only Info only ℹ️ Info
Size 640 Size of input image (in pixels). Bigger = more details, but slower. <416 640–1280 960–1280 ✅ Good
Box(P) 0.46 How many of the AI's guesses were right. (Precision) Higher = better. <0.5 >0.5 >0.8 ⚠️ Avg
R (Recall) 0.857 How many real objects the AI found. Higher = better. <0.6 >0.7 >0.9 ✅ Good
mAP50 0.409 Overall score (at easy difficulty). Combines accuracy and detection. <0.4 >0.6 >0.8 ⚠️ Avg
mAP50-95 0.279 Overall score (at hard difficulty). Measures true AI skill. <0.3 >0.4 >0.6 ❌ Ba

 

 

 

 

 

 

 

 

 

 

 

כתיבת תגובה