【EdgeYOLO】《EdgeYOLO: An Edge-Real-Time Object Detector》

在這里插入圖片描述

Liu S, Zha J, Sun J, et al. EdgeYOLO: An edge-real-time object detector[C]//2023 42nd Chinese Control Conference (CCC). IEEE, 2023: 7507-7512.

CCC-2023

源碼:https://github.com/LSH9832/edgeyolo

論文:https://arxiv.org/pdf/2302.07483


文章目錄

  • 1、Background and Motivation
  • 2、Related Work
  • 3、Advantages / Contributions
  • 4、Method
    • 4.1、Enhanced-Mosaic & Mixup
    • 4.2、Lite-Decoupled Head
    • 4.3、Staged Loss Function
  • 5、Experiments
    • 5.1、Datasets and Metrics
    • 5.2、Results & Comparison
    • 5.3、Ablation Study
    • 5.4、Tricks for Edge Computing Devices
  • 6、Conclusion(own) / Future work


1、Background and Motivation

  • 邊緣計算設備的需求增長
  • 現有物體檢測器的局限性(傳統的兩階段物體檢測器(如R-CNN系列)雖然在精度上表現較好,但由于其復雜的結構和較高的計算需求,難以在邊緣設備上實現實時運行。而一些輕量級的一階段檢測器(如MobileNet和ShuffleNet)雖然能在邊緣設備上運行,但往往以犧牲精度為代價。)
  • YOLO系列算法的發展(隨著YOLO系列版本的更新,雖然精度不斷提高,但在邊緣設備上的實時性能卻難以保證)
  • 小物體檢測的挑戰
  • 在設計和評估物體檢測器時,考慮整個檢測任務的完整性,包括預處理模型推理后處理時間,以確保在邊緣設備上實現真正的實時性能。

This paper proposes an efficient, low-complexity and anchor-free object detector based on the state-of-the-art YOLO framework, which can be implemented in real time on edge computing platforms

2、Related Work

  • Anchor-free Object Detector
    • anchor-point-based(本文)
    • keypoint-based
  • Data Augmentation
    • geometric augmentation
    • photometric augmentation(eg HSV & brightness adjustment)
  • Model Reduction
    • lossy reduction(有損壓縮,builds smaller networks)
    • lossless reduction(無損壓縮,eg re-parameterizing techniques)
  • Decoupled Regression
    • different tasks use the same convolution kernel if they are closely related. However, relations between the object’s location, confidence and category are not close enough in numerical logic
    • 優點,accelerate the loss convergence
    • 缺點, brings extra inference costs.
  • Small Object Detecting Optimization
    • 小目標信息有限
    • small objects always account for a less proportion of loss in total loss while training
    • 解決方式:(1)replication augmentation, (2)zoomed(指的是大目標縮小成小目標,提高了小目標的占比) and spliced, (3)Loss function
    • 解決方式(1)的缺點:scale mismatch and background mismatch,本文作者探索的是(2)(3)

3、Advantages / Contributions

  • anchor-free object detector is designed——EdgeYOLO
  • a more powerful data augmentation method is proposed(ensures the quantity and validity of training data)
  • 設計了輕量級的解耦頭結構,Structures that can be re-parameterized are used(減少推理時間)
  • A loss function is designed to improve the precision on small objects.
  • 在公開數據集上取得了優異性能
  • 開源了代碼和模型權重
  • 多進程/多線程計算架構等優化技巧,進一步提高了EdgeYOLO在邊緣設備上的實時性能。

4、Method

4.1、Enhanced-Mosaic & Mixup

在這里插入圖片描述
還是 mosaic 和 mixup 的混搭,作者 mosaic 的時候做了個分組,然后 mixup,group = 2(the group number can be set according to the richness of the average number of labels in a single picture in the dataset.)

看論文的描述沒有 get 到作者的意思,舉得例子也僅僅是圖片中數量上的差異導致的區別

在這里插入圖片描述

是提高了 mosaic 的圖片數量嗎?比如原來 4 張,現在 8 張?

4.2、Lite-Decoupled Head

在這里插入圖片描述

基于 FCOS 的decouple head 進行了輕量化改進,引入了 re-parameterization 技術(推理的時候部分結構合并到一起)和 implicit konwledge 技術

With the method of re-parameterizing, implicit representation layers are integrated into convolutional layers for lower inference costs.

implicit konwledge 出自

Wang C Y, Yeh I H, Liao H Y M. You only learn one representation: Unified network for multiple tasks[J]. arXiv preprint arXiv:2105.04206, 2021.
在這里插入圖片描述
在這里插入圖片描述

yolov7 中也采用了這個技術

【YOLOv7】《YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors》

4.3、Staged Loss Function

整體 loss 結構, L Δ L_{\Delta} LΔ? 是 regulation loss
在這里插入圖片描述

loss 分為三個階段,每個階段不一致

第一階段

gIOU loss for IOU loss, Balanced Cross Entropy loss for classification loss and object loss, regulation loss 被設置為 0

第二階段

at the last few data-augmentation-enabled epochs

分類和目標損失采用的是 Hybrid-Random Loss,應該是作者原創,沒有看到列出的參考文獻

在這里插入圖片描述

基于交叉熵損失的改進

第三階段

close data augmentation

set L1 loss as our regulation loss, and replace gIOU loss by cIOU loss

5、Experiments

訓練時網絡配置參數

默認參數

# models & weights------------------------------------------------------------------------------------------------------
model_cfg: "params/model/edgeyolo.yaml"              # model structure config file
weights: "output/train/edgeyolo_coco/last.pth"       # contains model_cfg, set null or a no-exist filename if not use it
use_cfg: false                                       # force using model_cfg instead of cfg in weights to build model# output----------------------------------------------------------------------------------------------------------------
output_dir: "output/train/edgeyolo_coco"             # all train output file will save in this dir
save_checkpoint_for_each_epoch: true                 # save models for each epoch (epoch_xxx.pth, not only best/last.pth)
log_file: "log.txt"                                  # log file (in output_dir)# dataset & dataloader--------------------------------------------------------------------------------------------------
dataset_cfg: "params/dataset/coco.yaml"              # dataset config
batch_size_per_gpu: 8                                # batch size for each GPU
loader_num_workers: 4                                # number data loader workers for each GPU
num_threads: 1                                       # pytorch threads number for each GPU# device & data type----------------------------------------------------------------------------------------------------
device: [0, 1, 2, 3]                                 # training device list
fp16: false                                          # train with fp16 precision
cudnn_benchmark: false                               # it's useful when multiscale_range is set zero# train hyper-params----------------------------------------------------------------------------------------------------
optimizer: "SGD"                                     # or Adam
max_epoch: 300                                       # or 400
close_mosaic_epochs: 15                              # close data augmentation at last several epochs# learning rate---------------------------------------------------------------------------------------------------------
lr_per_img: 0.00015625                               # total_lr = lr_per_img * batch_size_per_gpu * len(devices)
warmup_epochs: 5                                     # warm-up epochs at the beginning of training
warmup_lr_ratio: 0.0                                 # warm-up learning rate start from value warmup_lr_ratio * total_lr
final_lr_ratio: 0.05                                 # final_lr_per_img = final_lr_ratio * lr_per_img# training & dataset augmentation---------------------------------------------------------------------------------------
#      [cls_loss, conf_loss, iou_loss]
loss_use: ["bce", "bce", "giou"]  # bce: BCE loss. bcf: Balanced Focal loss. hyb: HR loss, iou, c/g/s iou is available
input_size: [640, 640]            # image input size for model
multiscale_range: 5               # real_input_size = input_size + randint(-multiscale_range, multiscale_range) * 32
weight_decay: 0.0005              # optimizer weight decay
momentum: 0.9                     # optimizer momentum
enhance_mosaic: true              # use enhanced mosaic method
use_ema: true                     # use EMA method
enable_mixup: true                # use mixup
mixup_scale: [0.5, 1.5]           # mixup image scale
mosaic_scale: [0.1, 2.0]          # mosaic image scale
flip_prob: 0.5                    # flip image probability
mosaic_prob: 1                    # mosaic probability
mixup_prob: 1                     # mixup probability
degrees: 10                       # maximum rotate degrees
hsv_gain: [0.0138, 0.664, 0.464]  # hsv gain ratio# evaluate--------------------------------------------------------------------------------------------------------------
eval_at_start: false              # evaluate loaded model before training
val_conf_thres: 0.001             # confidence threshold when doing evaluation
val_nms_thres: 0.65               # NMS IOU threshold when doing evaluation
eval_only: false                  # do not train, run evaluation program only for all weights in output_dir
obj_conf_enabled: true            # use object confidence when doing inference
eval_interval: 1                  # evaluate interval epochs# show------------------------------------------------------------------------------------------------------------------
print_interval: 100               # print result after every $print_interval iterations# others----------------------------------------------------------------------------------------------------------------
load_optimizer_params: true       # load optimizer params when resume train, set false if there is an error.
train_backbone: true              # set false if you only want to train yolo head
train_start_layers: 51            # if not train_backbone, train from this layer, see params/models/edgeyolo.yaml
force_start_epoch: -1             # set -1 to disable this option

5.1、Datasets and Metrics

  • VisDrone2019-DET dataset:https://github.com/VisDrone/VisDrone-Dataset
  • MS COCO2017

metric 是 COCO 數據集的 mAP

5.2、Results & Comparison

baseline 是 yolov7 的 ELAN-Darknet

在這里插入圖片描述
作者的方法在小目標上的提升尤為明顯

VisDrone 數據上的模型 pre-trained on MS COCO2017-train.

FPS 在 device Jetson AGX Xavier 測試得到的

5.3、Ablation Study

(1)Decoupled head

在這里插入圖片描述

改進后又快又好

(2)Segmentation labels (poor effect)

旋轉增廣后 bbox 可能框的沒有那么準(由于bbox沒有角度平行于邊界導致),作者用分割的標簽輔助生成旋轉后的 bbox,不會產生 contain more invalid background information 的現象了

When the data augmentation is enabled and the loss enters a stable decline phase, using segmentation labels can bring a significant increase by 2% - 3% AP.

訓練末期的時候,關掉了數據增強, all labels become more accurate,even if the segmentation labels are not used, the final accuracy decreases only by about 0.04% AP(這說明 bbox 沒有 segmentation 的標簽準???)

(3)Loss function

在這里插入圖片描述

To sum up, a better precision can be obtained by using HR loss and cIOU loss in later training stages

5.4、Tricks for Edge Computing Devices

(1)Input size adaptation.

訓練的時候 640x640,部署的時候適配 device 的尺寸,4:3 or 16:9,可以顯著提速

在這里插入圖片描述

(2)Multi-process & multi-thread computing architecture

用多線程或者多進程來提速網絡運行時的三個階段

pre-process, model input and post-process

achieve about 8%-14% FPS increase.


可視化的結果展示

在這里插入圖片描述

在這里插入圖片描述

6、Conclusion(own) / Future work

  • pre-process, model inference and post-process
  • edge computing device
  • time latency in post-processing is almost proportional to the number of anchors of each grid cell
  • Decouple,However, relations between the object’s location, confidence and category are not close enough in numerical logic
  • Multi-process & multi-thread computing architecture
  • we believe that the framework can be extended to other pixel level recognition tasks such as instance segmentation
  • Jetson AGX Xavier
    在這里插入圖片描述
    在這里插入圖片描述

更多論文解讀,請參考 【Paper Reading】

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/81367.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/81367.shtml
英文地址,請注明出處:http://en.pswp.cn/web/81367.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

宮格導航--純血鴻蒙組件庫AUI

摘要: 宮格導航(A_GirdNav):可設置導航數據,建議導航項超過16個,可設置“更多”圖標指向的頁面路由。最多顯示兩行,手機每行最多顯示4個圖標,折疊屏每行最多6個圖標,平板每行最多8個圖標。多余圖…

調試的按鈕

在Debug的時候,會有一些按鈕,我們需要知道它們各自的作用。 注:調試器本身并沒有一個直接的、可以撤銷已執行代碼效果的“返回上一步(Undo Last Step)”或“逆向執行(Reverse Debugging)”按鈕…

人工智能如何協助老師做課題

第一步:在騰訊元寶對話框中輸入如何協助老師做課題,通過提問,我們了解了老師做課題的步驟和建議。 第二步:開題報告提問,騰訊元寶對話框中,輸入“大單元視域下小學數學教學實踐研究課題開題報告。”......…

OpenGL Chan視頻學習-5 Vertex Attributes and Layouts in OpenGL

bilibili視頻鏈接: 【最好的OpenGL教程之一】https://www.bilibili.com/video/BV1MJ411u7Bc?p5&vd_source44b77bde056381262ee55e448b9b1973 一、知識點整理 1.1.OpenGL管線工作流程 為顯卡提供繪制的所有數據,并將數據存儲在GPU內存使用著色器&…

Linux_編輯器Vim基本使用

?? 歡迎大家來到小傘的大講堂?? 🎈🎈養成好習慣,先贊后看哦~🎈🎈 所屬專欄:LInux_st 小傘的主頁:xiaosan_blog 制作不易!點個贊吧!!謝謝喵!&a…

MyBatis 高級映射功能詳解:處理復雜數據庫關系

MyBatis 的高級映射功能是其強大特性之一,它允許開發者輕松處理數據庫中的復雜關系,如一對一、一對多和多對多關系。本文將深入探討這些高級映射功能,包括映射配置方法、嵌套查詢和關聯查詢的使用,并通過示例代碼進行演示。 1.數據…

Halo:一個強大易用的國產開源建站工具

Halo 是一款國產開源的建站工具,適合快速搭建博客、論壇、知識庫、公司官網等多種類型的網站,目前在 GitHub 上已經獲得了 35.6k Star。 功能特性 Halo 核心功能與優勢包括: 插件架構:Halo 采用可插拔架構,功能模塊之…

Java-ArrayList集合的遍歷方式詳解

Java-ArrayList集合的遍歷方式詳解 二、ArrayList概述三、ArrayList的遍歷方式1. 普通for循環遍歷2. 增強for循環遍歷3. 迭代器遍歷4. ListIterator遍歷5. Java 8 Stream API遍歷 四、性能對比與分析性能測試結果分析 五、遍歷方式的選擇建議六、常見遍歷陷阱與注意事項1. 并發…

華為網路設備學習-23(路由器OSPF-LSA及特殊詳解 二)

OSPF動態路由協議要求: 1.必須有一個骨干區域(Area 0)。有且僅有一個,而且連續不可分割。 2.所有非骨干區域(Area 1-n)必須和骨干區域(Area 0)直接相連,且所有區域之間…

基于大模型的急性腐蝕性胃炎風險預測與診療方案研究報告

目錄 一、引言 1.1 研究背景與意義 1.2 研究目的 1.3 國內外研究現狀 二、急性腐蝕性胃炎概述 2.1 定義與發病機制 2.2 病因分析 2.3 臨床表現與分型 2.4 診斷方法 三、大模型技術介紹 3.1 大模型原理 3.2 常用大模型及在醫療領域應用案例 3.3 選擇用于急性腐蝕性…

泰迪杯特等獎案例深度解析:基于三維點云與深度學習的復雜零件裝配質量檢測系統設計

一、案例背景與行業痛點 1.1 工業裝配質檢的現狀與挑戰 在精密制造領域(如航空航天發動機、新能源汽車電池模組),復雜零件的裝配質量直接影響產品性能與安全性。傳統人工質檢存在效率低(單件檢測耗時>3分鐘)、漏檢率高(約15%)等問題,而現有自動化方案面臨以下技術…

離散傅里葉變換DFT推導及理解

DTFT到DFT的推導 關于DTFT的相關推導已經做過總結,詳見《DTFT及其反變換的直觀理解》,每一個離散的頻率分量都是由時域中的復指數信號累加得到的,DTFT得到的頻譜時頻率的連續函數 。 離散時間傅里葉變換公式,式1: 將…

欣佰特科技|工業 / 農業 / AR 場景怎么選?Stereolabs ZED 雙目3D相機型號對比與選型建議

Stereolabs ZED 相機系列為視覺感知領域提供了多種創新解決方案,適用于不同應用場景。選擇合適的 ZED 相機型號,需綜合考慮分辨率、深度感知范圍、接口類型等因素。 Stereolabs ZED 相機產品系列概覽 ZED:首款立體視覺相機,專為高…

黑馬點評Reids重點詳解(Reids使用重點)

目錄 一、短信登錄(redisseesion) 基于Session實現登錄流程 🔄 圖中關鍵模塊解釋: 利用seesion登錄的問題 設計key的具體細節 整體訪問流程 二、商戶查詢緩存 reids與數據庫主動更新的三種方案 緩存穿透 緩存雪崩問題及…

【Pandas】pandas DataFrame add_suffix

Pandas2.2 DataFrame Reindexing selection label manipulation 方法描述DataFrame.add_prefix(prefix[, axis])用于在 DataFrame 的行標簽或列標簽前添加指定前綴的方法DataFrame.add_suffix(suffix[, axis])用于在 DataFrame 的行標簽或列標簽后添加指定后綴的方法 pandas…

解鎖MCP:AI大模型的萬能工具箱

摘要:MCP(Model Context Protocol,模型上下文協議)是由Anthropic開源發布的一項技術,旨在作為AI大模型與外部數據和工具之間溝通的“通用語言”。它通過標準化協議,讓大模型能夠自動調用外部工具完成任務&a…

nginx性能調優與深度監控

目錄 nginx性能調優 更改進程數與連接數 進程數 連接數 靜態緩存功能設置 日志切割 配置網頁壓縮 nginx 的深度監控 GoAccess 簡介 GoAccess安裝 ?編輯 配置中文環境 GOAccess生成中文報告 測試訪問 nginx vts 簡介 nginx vts 安裝 nginx配置開啟vts 測試訪問…

【時時三省】Python 語言----牛客網刷題筆記

目錄 1,常用函數 1,input() 2,map() 3,split() 4,range() 5, 切片 6,列表推導式 山不在高,有仙則名。水不在深,有龍則靈。 ----CSDN 時時三省 1,常用函數 1,input() 該函數遇到 換行停止接收,返回類型為字符串 2,map() 該函數出鏡率較高,目的是將一個可迭…

docker compose yml 啟動的容器中,如何使用linux環境變量賦值

在 Docker Compose 中,可以通過環境變量(${VAR} 或 $VAR)來動態配置容器。以下是幾種常見的使用方式 - 使用 env_file 加載變量文件 可以單獨定義一個環境變量文件(如 app.env),然后在 docker-compose.y…

深入解析Kafka JVM堆內存:優化策略與監控實踐

💝💝💝歡迎蒞臨我的博客,很高興能夠在這里和您見面!希望您在這里可以感受到一份輕松愉快的氛圍,不僅可以獲得有趣的內容和知識,也可以暢所欲言、分享您的想法和見解。 推薦:「storms…