【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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈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…