[Cambio mágico YOLOv5-6.x (abajo)] YOLOv5s+Ghostconv+BiFPN+CA

prefacio

[Cambio mágico YOLOv5-6.x (activado)]: combinación de redes ligeras Shufflenetv2, Mobilenetv3 y Ghostnet

[Cambio mágico YOLOv5-6.x (medio)]: Agregar función de activación ACON, mecanismo de atención CBAM y CA, pirámide bidireccional ponderada BiFPN

La versión de YOLOv5 utilizada en este artículo es v6.1 Los estudiantes que no están familiarizados con la estructura de red de YOLOv5-6.x pueden pasar a: [YOLOv5-6.x] Modelo de red y análisis de código fuente
 

configuraciones de entrenamiento

$ python -m torch.distributed.launch --nproc_per_node 2 train.py --weights  --cfg yolov5s.yaml --data data/VOC2007.yaml -- hyp data/hyps/hyp.scratch-high.yaml --epochs 300 --device 0,1
  • El entorno experimental son 2 GTX 1080 Ti
  • El conjunto de datos es VOC2007
  • El hiperparámetro es hyp.scratch-high.yaml
  • entrenar durante 300 épocas
  • Otros parámetros son los valores establecidos por defecto en el código fuente

 

Configuración de prueba

$ python val.py --weights yolov5s.pt --data VOC2007.yaml --img 832 --augment --half --iou 0.6
$ python val.py --weights yolov5s.pt --data VOC2007.yaml --img 640 --task speed --batch 1
  • Use la primera línea de código para la prueba del mapa ( método de prueba TTA )
  • Prueba de velocidad con segunda línea de código

 

Archivo modelo (referencia)

yolov5s-Ghostconv-BiFPN-CA.yaml

# Parameters
nc: 20  # number of classes
depth_multiple: 0.33  # model depth multiple
width_multiple: 0.50  # layer channel multiple
anchors:
  - [10,13, 16,30, 33,23]  # P3/8
  - [30,61, 62,45, 59,119]  # P4/16
  - [116,90, 156,198, 373,326]  # P5/32

# YOLOv5 v6.0 backbone
backbone:
  # [from, number, module, args]
  [[-1, 1, Conv, [64, 6, 2, 2]],  # 0-P1/2
   [-1, 1, GhostConv, [128, 3, 2]],  # 1-P2/4
   [-1, 3, C3, [128]],
   [-1, 1, GhostConv, [256, 3, 2]],  # 3-P3/8
   [-1, 6, C3, [256]],
   [-1, 1, GhostConv, [512, 3, 2]],  # 5-P4/16
   [-1, 9, C3, [512]],
   [-1, 1, GhostConv, [1024, 3, 2]],  # 7-P5/32
   [-1, 3, C3, [1024]],
   [-1, 1, CABlock, [1024, 32]],  # 9 CA <-- Coordinate Attention [out_channel, reduction]
   [-1, 1, SPPF, [1024, 5]],  # 10
  ]

# YOLOv5 v6.0 head
head:
  [[-1, 1, GhostConv, [512, 1, 1]],
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 6], 1, Concat, [1]],  # cat backbone P4
   [-1, 3, C3, [512, False]],  # 14

   [-1, 1, GhostConv, [256, 1, 1]],
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 4], 1, Concat, [1]],  # cat backbone P3
   [-1, 3, C3, [256, False]],  # 18 (P3/8-small)

   [-1, 1, GhostConv, [256, 3, 2]],
   [[-1, 15, 6], 1, Concat, [1]],  # cat head P4 <--- BiFPN change
   [-1, 3, C3, [512, False]],  # 21 (P4/16-medium)

   [-1, 1, GhostConv, [512, 3, 2]],
   [[-1, 11], 1, Concat, [1]],  # cat head P5
   [-1, 3, C3, [1024, False]],  # 24 (P5/32-large)

   [[18, 21, 24], 1, Detect, [nc, anchors]],  # Detect(P3, P4, P5)
  ]

 
La capacitación aún está en progreso y los resultados de las pruebas correspondientes se actualizarán más adelante. Aún no se han probado más métodos de mejora. Bienvenidos a todos a comunicarse y compartir los métodos para mejorar YOLOv5 ~

Supongo que te gusta

Origin blog.csdn.net/weixin_43799388/article/details/123612828
Recomendado
Clasificación