鄭琇茹
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # YOLO介紹 ## 甚麼是YOLO? 1. YOLO (You Only Look Once) 是**One stage**的物件偵測方法,也就是只需要對圖片作一次 CNN架構便能夠判斷圖形內的物體位置與類別。 1. 除了YOLO之外,還有很多其他的深度學習物件偵測方法,如R-CNN、Fast R-CNN、Faster R-CNN和Mask R-CNN等。這些方法各有特點和優勢,但YOLO的最大特色在於速度和精確度。YOLO可以在短時間內檢測到影像中的多個物體,並且具有很高的準確性,這使得YOLO在**邊緣運算**中非常受歡迎。 > **Two stage**: 假設一張圖選出一千個物件,後面的辨識就用重複做一千次,這種無法做及時運算。Example: R-CNN(Regions with CNN features),fast R-CNN,faster R-CNN。 > **One stage**:YOLO、SSD。SSD: Google在2015年12月提出 Single Shot Detector (SSD) *「We present a method for detecting objects in images using **a single deep neural network**.」* ## 名詞介紹 ![image](https://hackmd.io/_uploads/rkT7c40W1g.png) * Precision:精準度,代表預測為正的樣本有多少正確。 ![image](https://hackmd.io/_uploads/S1l1P5ECWkl.png =60%x) * Recall:召回率,代表真正為正的樣本中有多少被預測為正。 ![image](https://hackmd.io/_uploads/r1b8qECWyg.png =60%x) * AP(Average Precision):平均精度,綜合參考Precision和Recall。 * mAP(mean Average Precision):多個類別下,平均精度AP的均值。 * mAPval (mean Average Precision on the validation set):在驗證集上的mAP。 * IoU((Intersection overUnion)):IOU=area of overlap/area of union,IoU就等於 交集的面積/聯集的面積。換個意思,預測邊框(predicted box)和真實邊框(ground truth box)的交集/並集,這個值會介於0~1之間,越接近 1,表示預測越準確。 ![image](https://hackmd.io/_uploads/r14G7RogJl.png) Generally, IoU > 0.5 為合格預測框。 Unusually, IoU>0.7 高準確水準。 * mAPval 50-95:代表驗證集上的IoU =50-95之間的mAP。 https://claire-chang.com/2023/08/16/yolov8%E6%A8%A1%E5%9E%8B%E8%A8%93%E7%B7%B4%E5%8F%8A%E5%85%B6%E6%8C%87%E6%A8%99%E6%84%8F%E7%BE%A9/ ## 版本差異 YOLOv8與YOLOv5同樣是Ultralytics 這家公司所製作 YOLOv8 跟以往不同的地方是: * 無錨檢測(Anchor Free Detection) * 新的卷積層(New Convolutions) * 關閉馬賽克增強(Closing the Mosaic Augmentation) 在 YOLO 系列模型(如 YOLOv5 或 YOLOv8)中,mosaic 是一種資料增強技術,用於將 4 張圖片拼接成一張圖,幫助提升模型的泛化能力。Mosaic 能夠在訓練期間同時增加背景的多樣性和縮放變化,使模型在各種場景下表現得更好。 ![image](https://hackmd.io/_uploads/BkAMrR6xyg.png) 由下方圖片可以看到,Yolov8 目前推論的效果是贏過其他 Yolo 系列,並且提供五種模型大小 : YOLOv8n、YOLOv8s、YOLOv8m、YOLOv8l、YOLOv8x ![image](https://hackmd.io/_uploads/rkJ2XRpgJe.png) ## YOLOv8介紹 ![image](https://hackmd.io/_uploads/rkVC1Aag1l.png) YOLOv8系列提供很多模式的模型 * Detection 偵測 * Instance Segmentation 實例分割 * Pose/Keypoints 姿態/關鍵點 * Oriented Detection 定向檢測 * Classification 分類 ![image](https://hackmd.io/_uploads/HyCabJne1g.png) * YOLOv8模型n、s、m、l、x由小排到大,模型越大處理速度越慢但越準確。 * params(M):參數,模型的參數數量,以百萬為單位。參數數量通常與模型複雜度和計算需求成正比。 * FLOPs(B):浮點運算數,以十億為單位。指標反應模型運算一次所需的計算量。 ## 訓練參數說明 | 參數 | 默認值 | 描述 | 設置建議 | | ----------- | ------ | ---------------------------------- | --------------------------------------------------------------------------------------------------- | | model | None | 模型文件路徑 | 選擇適合任務的預訓練模型 | | data | None | 數據文件路徑 | 選擇適合的數據集配置 | | epochs | 100 | 訓練週期數 | 考慮數據集和模型規畫調整 | | time | None | 訓練時間 | 適用於有時間限制的訓練。 | | patience | 50 | 早停等待週期 | 若驗證指標在指定回合數內無提升,則停止訓練(早停法)。防止過度擬合。 | | batch | 16 | 批次大小 | 可設為整數(例如batch=16)、自動模式(batch=-1,使用60% GPU記憶體)或指定占用比例(如batch=0.70)。 | | imgsz | 640 | 圖像尺寸 | 適應模型和硬件設置 | | save | True | 是否儲存檢查點和最終模型權重。 | 方便中斷後繼續訓練或模型部署。 | | save_period | -1 | 檢查點保存頻率 | 需要設定時間週期(設為-1則不啟用此功能。) | | cache | False | 使用數據加載緩存 | (記憶體:True/ram,磁碟:disk)。能加快訓練,但會增加記憶體使用量。 | | device | None | 指定訓練所用設備| 單GPU(device=0)、多GPU(device=0,1)、CPU(device=cpu)或Apple Silicon(device=mps)。 | | workers | 8 |加載數據的工作線程數 | 多GPU時,增加此數值可提升數據預處理速度。 | | project | None | 設置專案目錄名稱 |自訂義區分的項目 | | exist_ok | False | 是否覆蓋現有實驗 | 如果為True,對迭代實驗有用| | pretrained | True | 使用預訓練模型| 可為布林值或指定模型的路徑,能提高訓練效率和模型表現。| | optimizer |'auto' | 優化器選擇 | 選擇訓練優化器,如SGD、Adam、RMSProp等,或使用auto根據模型自動選擇。影響收斂速度與穩定性。| | verbose | False|詳細輸出|提供詳細日誌和進度更新 | | seed | 0 | 設置隨機種子|可以是任意整數| | deterministic | True|強制使用確定性算法,確保可重複性。|結果一致時啟用| | single_cls | False | 單類訓練 |適用於二元分類或只關注目標物是否存在的情況。| | rect | False| 啟用矩形訓練,優化批次組合以減少填充量。| 提升效率但可能影響模型準確度。 | | cos_lr |False | 余弦學習率調度 | 隨回合調整學習率,有助於收斂。| |close_mosaic | 10 | 關閉馬賽克數據增強 |close_mosaic=0不關閉 Mosaic | * close_mosaic close_mosaic 參數的作用是 在訓練的最後幾個 epoch 停用 Mosaic 增強,以穩定模型的最終性能。雖然 Mosaic 在訓練初期非常有幫助,但在訓練的最後幾個 epoch,模型更需要在單一圖像上微調(Fine-tune)。提升模型收斂效果,減少過擬合。 (1) Mosaic 拼接會影響圖片的真實性,可能導致邊界框預測不精確。 (2)關閉 Mosaic 有助於模型在最後階段更準確地學習真實場景中的物體。 參數設置: close_mosaic=N:表示在訓練的最後 N 個 epoch 關閉 Mosaic 增強。 close_mosaic=0:表示不關閉 Mosaic,一直使用到訓練結束。 範例close_mosaic =10,表示在訓練的最後 10 個 epoch 關閉 Mosaic 增強。也就是第90個epoch(黃色的區域)。 ![image](https://hackmd.io/_uploads/Bkp--Aefkg.png) 所有參數顯示 ![image](https://hackmd.io/_uploads/Hyig4ew7yl.png) ## 訓練指標 ### result.png ![image](https://hackmd.io/_uploads/S1hztabz1x.png) #### loss functions 損失函數是用來衡量模型預測值和真實值的誤差,越小越準。 * box_loss(Box Regression Loss):預測框位置的損失函數。 * cls_loss(Class Classification Loss):預測目標類別。 * dfl_loss(Detection Focal Loss):焦點損失的主要目標是應對樣本不平衡問題。 通常我會看loss functions,有沒有收斂(就是趨近於平緩為止),或是達到我要的loss值。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully