【YOLOv10单模态融合改进】普通数据集的双模型融合改进,涉及中期、中后期、后期融合方式的完整配置步骤以及二次改进方案
前言
主题: YOLOv10的单模态融合改进,普通数据集的双模型融合改进(双模型同步提升)
方式: 中期融合、中-后期融合、后期融合。
内容: 包含融合方式详解和完整配置步骤以及二次改进建议,通过融合多个模型的优势实现精度提升。
一、融合方式
输入的是一个模态的数据,所以没有早期的融合。
1.1 中期融合方法及结构图
定义: 在网络中间层(骨干网络与颈部网络之间)对多模态特征进行融合。
实现方式: 每个模态通过独立的骨干网络提取特征,融合时采用Concat操作合并特征图,送入颈部网络。
结构示意图:
1.2 中-后期融合方法及结构图
定义: 在颈部网络的上采样之后对多模态特征进行融合。
实现方式: 每个模态通过独立的骨干网络和颈部的FPN网络提取特征,融合时采用Concat操作合并特征图,送入检测头。
结构示意图:
1.3 后期融合方法及结构图
定义: 在网络输出阶段(如检测头或分类器前)对多模态特征进行融合。
实现方式: 每个模态通过独立的骨干网络和颈部网络提取特征,融合时采用Concat操作合并特征图,送入检测头。
结构示意图:
二、完整配置步骤
相关的配置只涉及单模态,只需在原本的项目包中配置运行即可,不需要使用我提供的多模态项目包。
①:在
ultralytics/nn/modules/block.py
中添加如下代码,并在
__all__
中添加
“IN”
class IN(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x
②:在
ultralytics/nn/modules/__init__.py
中的
from .block import (...)
添加
IN
③:在
ultralytics/nn/tasks.py
中的
from ultralytics.nn.modules import (...)
中添加
IN
至此,添加完成。
三、YAML模型结构
此处以
ultralytics/cfg/models/v10/yolov10.yaml
为例,在同目录下创建一个用于自己数据集训练的双模型融合文件,并粘贴下方的模型训练即可。
3.1 中期融合
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# YOLOv10n object detection model with P3/8 - P5/32 outputs
# Model docs: https://docs.ultralytics.com/models/yolov10
# Task docs: https://docs.ultralytics.com/tasks/detect
# Parameters
nc: 80 # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov10n.yaml' will call yolov10.yaml with scale 'n'
# [depth, width, max_channels]
n: [0.33, 0.25, 1024]
backbone:
# [from, repeats, module, args]
- [-1, 1, IN, []] # 0
- [0, 1, Conv, [64, 3, 2]] # 1-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 2-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 4-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 6-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 8-P5/32
- [-1, 3, C2f, [1024, True]]
- [0, 1, Conv, [64, 3, 2]] # 10-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 11-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 13-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 15-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 17-P5/32
- [-1, 3, C2f, [1024, True]]
- [[5, 14], 1, Concat, [1]] # 19 cat backbone P3
- [[7, 16], 1, Concat, [1]] # 20 cat backbone P4
- [[9, 18], 1, Concat, [1]] # 21 cat backbone P5
- [-1, 1, SPPF, [1024, 5]] # 22
- [-1, 1, PSA, [1024]] # 23
# YOLOv10.0n head
head:
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 20], 1, Concat, [1]] # cat backbone P4
- [-1, 3, C2f, [512]] # 26
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 19], 1, Concat, [1]] # cat backbone P3
- [-1, 3, C2f, [256]] # 29 (P3/8-small)
- [-1, 1, Conv, [256, 3, 2]]
- [[-1, 26], 1, Concat, [1]] # cat head P4
- [-1, 3, C2f, [512]] # 32 (P4/16-medium)
- [-1, 1, SCDown, [512, 3, 2]]
- [[-1, 23], 1, Concat, [1]] # cat head P5
- [-1, 3, C2fCIB, [1024, True, True]] # 35 (P5/32-large)
- [[29, 32, 35], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
3.2 中-后期融合
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# YOLOv10n object detection model with P3/8 - P5/32 outputs
# Model docs: https://docs.ultralytics.com/models/yolov10
# Task docs: https://docs.ultralytics.com/tasks/detect
# Parameters
nc: 80 # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov10n.yaml' will call yolov10.yaml with scale 'n'
# [depth, width, max_channels]
n: [0.33, 0.25, 1024]
backbone:
# [from, repeats, module, args]
- [-1, 1, IN, []] # 0
- [0, 1, Conv, [64, 3, 2]] # 1-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 2-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 4-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 6-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 8-P5/32
- [-1, 3, C2f, [1024, True]]
- [-1, 1, SPPF, [1024, 5]] # 10
- [-1, 1, PSA, [1024]] # 11
- [0, 1, Conv, [64, 3, 2]] # 12-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 13-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 15-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 17-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 19-P5/32
- [-1, 3, C2f, [1024, True]]
- [-1, 1, SPPF, [1024, 5]] # 21
- [-1, 1, PSA, [1024]] # 22
# YOLOv10.0n head
head:
- [11, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 7], 1, Concat, [1]] # cat backbone P4
- [-1, 3, C2f, [512]] # 25
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 5], 1, Concat, [1]] # cat backbone P3
- [-1, 3, C2f, [256]] # 28 (P3/8-small)
- [22, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 18], 1, Concat, [1]] # cat backbone P4
- [-1, 3, C2f, [512]] # 31
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 16], 1, Concat, [1]] # cat backbone P3
- [-1, 3, C2f, [256]] # 34 (P3/8-small)
- [[11, 22], 1, Concat, [1]] # 35 cat backbone P3
- [[25, 31], 1, Concat, [1]] # 36 cat backbone P4
- [[28, 34], 1, Concat, [1]] # 37 cat backbone P5
- [-1, 1, Conv, [256, 3, 2]]
- [[-1, 36], 1, Concat, [1]] # cat head P4
- [-1, 3, C2f, [512]] # 40 (P4/16-medium)
- [-1, 1, SCDown, [512, 3, 2]]
- [[-1, 35], 1, Concat, [1]] # cat head P5
- [-1, 3, C2fCIB, [1024, True, True]] # 43 (P5/32-large)
- [[37, 40, 43], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
3.3 后期融合
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# YOLOv10n object detection model with P3/8 - P5/32 outputs
# Model docs: https://docs.ultralytics.com/models/yolov10
# Task docs: https://docs.ultralytics.com/tasks/detect
# Parameters
nc: 80 # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov10n.yaml' will call yolov10.yaml with scale 'n'
# [depth, width, max_channels]
n: [0.33, 0.25, 1024]
backbone:
# [from, repeats, module, args]
- [-1, 1, IN, []] # 0
- [0, 1, Conv, [64, 3, 2]] # 1-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 2-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 4-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 6-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 8-P5/32
- [-1, 3, C2f, [1024, True]]
- [-1, 1, SPPF, [1024, 5]] # 10
- [-1, 1, PSA, [1024]] # 11
- [0, 1, Conv, [64, 3, 2]] # 12-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 13-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 15-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, SCDown, [512, 3, 2]] # 17-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, SCDown, [1024, 3, 2]] # 19-P5/32
- [-1, 3, C2f, [1024, True]]
- [-1, 1, SPPF, [1024, 5]] # 21
- [-1, 1, PSA, [1024]] # 22
# YOLOv10.0n head
head:
- [11, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 7], 1, Concat, [1]] # cat backbone P4
- [-1, 3, C2f, [512]] # 25
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 5], 1, Concat, [1]] # cat backbone P3
- [-1, 3, C2f, [256]] # 28 (P3/8-small)
- [-1, 1, Conv, [256, 3, 2]]
- [[-1, 25], 1, Concat, [1]] # cat head P4
- [-1, 3, C2f, [512]] # 31 (P4/16-medium)
- [-1, 1, SCDown, [512, 3, 2]]
- [[-1, 11], 1, Concat, [1]] # cat head P5
- [-1, 3, C2fCIB, [1024, True, True]] # 34 (P5/32-large)
- [22, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 18], 1, Concat, [1]] # cat backbone P4
- [-1, 3, C2f, [512]] # 37
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
- [[-1, 16], 1, Concat, [1]] # cat backbone P3
- [-1, 3, C2f, [256]] # 40 (P3/8-small)
- [-1, 1, Conv, [256, 3, 2]]
- [[-1, 37], 1, Concat, [1]] # cat head P4
- [-1, 3, C2f, [512]] # 43 (P4/16-medium)
- [-1, 1, SCDown, [512, 3, 2]]
- [[-1, 22], 1, Concat, [1]] # cat head P5
- [-1, 3, C2fCIB, [1024, True, True]] # 46 (P5/32-large)
- [[11, 22], 1, Concat, [1]] # 47 cat backbone P3
- [[31, 43], 1, Concat, [1]] # 48 cat backbone P4
- [[34, 46], 1, Concat, [1]] # 49 cat backbone P5
- [[47, 48, 49], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
四、成功运行结果
中期融合结果:
YOLOv10n-BiModel summary: 488 layers, 3,742,646 parameters, 3,742,630 gradients, 11.5 GFLOPs
from n params module arguments
0 -1 1 0 ultralytics.nn.modules.block.IN []
1 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
2 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
3 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
4 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
5 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
6 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
7 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
8 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
9 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
10 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
11 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
12 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
13 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
14 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
15 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
16 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
17 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
18 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
19 [5, 14] 1 0 ultralytics.nn.modules.conv.Concat [1]
20 [7, 16] 1 0 ultralytics.nn.modules.conv.Concat [1]
21 [9, 18] 1 0 ultralytics.nn.modules.conv.Concat [1]
22 -1 1 394240 ultralytics.nn.modules.block.SPPF [512, 256, 5]
23 -1 1 249728 ultralytics.nn.modules.block.PSA [256, 256]
24 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
25 [-1, 20] 1 0 ultralytics.nn.modules.conv.Concat [1]
26 -1 1 164608 ultralytics.nn.modules.block.C2f [512, 128, 1]
27 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
28 [-1, 19] 1 0 ultralytics.nn.modules.conv.Concat [1]
29 -1 1 41344 ultralytics.nn.modules.block.C2f [256, 64, 1]
30 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2]
31 [-1, 26] 1 0 ultralytics.nn.modules.conv.Concat [1]
32 -1 1 123648 ultralytics.nn.modules.block.C2f [192, 128, 1]
33 -1 1 18048 ultralytics.nn.modules.block.SCDown [128, 128, 3, 2]
34 [-1, 23] 1 0 ultralytics.nn.modules.conv.Concat [1]
35 -1 1 283136 ultralytics.nn.modules.block.C2fCIB [384, 256, 1, True, True]
36 [29, 32, 35] 1 861718 ultralytics.nn.modules.head.v10Detect [1, [64, 128, 256]]
YOLOv10n-BiModel summary: 488 layers, 3,742,646 parameters, 3,742,630 gradients, 11.5 GFLOPs
中-后期融合结果:
YOLOv10n-BiModel summary: 558 layers, 4,439,862 parameters, 4,439,846 gradients, 14.6 GFLOPs
from n params module arguments
0 -1 1 0 ultralytics.nn.modules.block.IN []
1 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
2 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
3 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
4 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
5 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
6 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
7 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
8 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
9 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
10 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5]
11 -1 1 249728 ultralytics.nn.modules.block.PSA [256, 256]
12 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
13 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
14 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
15 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
16 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
17 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
18 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
19 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
20 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
21 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5]
22 -1 1 249728 ultralytics.nn.modules.block.PSA [256, 256]
23 11 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
24 [-1, 7] 1 0 ultralytics.nn.modules.conv.Concat [1]
25 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1]
26 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
27 [-1, 5] 1 0 ultralytics.nn.modules.conv.Concat [1]
28 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1]
29 22 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
30 [-1, 18] 1 0 ultralytics.nn.modules.conv.Concat [1]
31 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1]
32 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
33 [-1, 16] 1 0 ultralytics.nn.modules.conv.Concat [1]
34 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1]
35 [11, 22] 1 0 ultralytics.nn.modules.conv.Concat [1]
36 [25, 31] 1 0 ultralytics.nn.modules.conv.Concat [1]
37 [28, 34] 1 0 ultralytics.nn.modules.conv.Concat [1]
38 -1 1 73856 ultralytics.nn.modules.conv.Conv [128, 64, 3, 2]
39 [-1, 36] 1 0 ultralytics.nn.modules.conv.Concat [1]
40 -1 1 140032 ultralytics.nn.modules.block.C2f [320, 128, 1]
41 -1 1 18048 ultralytics.nn.modules.block.SCDown [128, 128, 3, 2]
42 [-1, 35] 1 0 ultralytics.nn.modules.conv.Concat [1]
43 -1 1 348672 ultralytics.nn.modules.block.C2fCIB [640, 256, 1, True, True]
44 [37, 40, 43] 1 1090454 ultralytics.nn.modules.head.v10Detect [1, [128, 128, 256]]
YOLOv10n-BiModel summary: 558 layers, 4,439,862 parameters, 4,439,846 gradients, 14.6 GFLOPs
后期融合结果:
YOLOv10n-BiModel summary: 618 layers, 10,539,830 parameters, 10,539,814 gradients, 19.5 GFLOPs
from n params module arguments
0 -1 1 0 ultralytics.nn.modules.block.IN []
1 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
2 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
3 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
4 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
5 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
6 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
7 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
8 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
9 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
10 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5]
11 -1 1 249728 ultralytics.nn.modules.block.PSA [256, 256]
12 0 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2]
13 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2]
14 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True]
15 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2]
16 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True]
17 -1 1 9856 ultralytics.nn.modules.block.SCDown [64, 128, 3, 2]
18 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True]
19 -1 1 36096 ultralytics.nn.modules.block.SCDown [128, 256, 3, 2]
20 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True]
21 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5]
22 -1 1 249728 ultralytics.nn.modules.block.PSA [256, 256]
23 11 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
24 [-1, 7] 1 0 ultralytics.nn.modules.conv.Concat [1]
25 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1]
26 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
27 [-1, 5] 1 0 ultralytics.nn.modules.conv.Concat [1]
28 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1]
29 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2]
30 [-1, 25] 1 0 ultralytics.nn.modules.conv.Concat [1]
31 -1 1 123648 ultralytics.nn.modules.block.C2f [192, 128, 1]
32 -1 1 18048 ultralytics.nn.modules.block.SCDown [128, 128, 3, 2]
33 [-1, 11] 1 0 ultralytics.nn.modules.conv.Concat [1]
34 -1 1 283136 ultralytics.nn.modules.block.C2fCIB [384, 256, 1, True, True]
35 22 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
36 [-1, 18] 1 0 ultralytics.nn.modules.conv.Concat [1]
37 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1]
38 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
39 [-1, 16] 1 0 ultralytics.nn.modules.conv.Concat [1]
40 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1]
41 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2]
42 [-1, 37] 1 0 ultralytics.nn.modules.conv.Concat [1]
43 -1 1 123648 ultralytics.nn.modules.block.C2f [192, 128, 1]
44 -1 1 18048 ultralytics.nn.modules.block.SCDown [128, 128, 3, 2]
45 [-1, 22] 1 0 ultralytics.nn.modules.conv.Concat [1]
46 -1 1 283136 ultralytics.nn.modules.block.C2fCIB [384, 256, 1, True, True]
47 [11, 22] 1 0 ultralytics.nn.modules.conv.Concat [1]
48 [31, 43] 1 0 ultralytics.nn.modules.conv.Concat [1]
49 [34, 46] 1 0 ultralytics.nn.modules.conv.Concat [1]
50 [47, 48, 49] 1 6847382 ultralytics.nn.modules.head.v10Detect [1, [512, 256, 512]]
YOLOv10n-BiModel summary: 618 layers, 10,539,830 parameters, 10,539,814 gradients, 19.5 GFLOPs
五、二次改进方案
-
双模型的二次改进和普通模型的改进一致,主要涉及到C2fUIB、颈部结构、上采样、下采样等,可以增加或替换成其它模块,可以换成其它的颈部结构在进行融合。
-
两个骨干中均可以再次添加其它模块,需要注意的是融合的时候特征图大小要一致。