AlibabaResearch / efficientteacher

A Supervised and Semi-Supervised Object Detection Library for YOLO Series
GNU General Public License v3.0
820 stars 147 forks source link

半监督训练过程结果P/R值反而变低了 #55

Open yeyan00 opened 1 year ago

yeyan00 commented 1 year ago

数据集是自有数据集,图像大小1024*1024,训练集6K,验证集500,无标签数据40K 修改训练参数 image size:1024 batch size:12(supervised),8(ssod) burn_epochs:200

先监督训练200个epoch,p/r value:0.76813/0.58473

然后用ssod训练,dataset_ssod无标签,走的是fake_iamge_label;

1.请问ssod训练过程还要注意哪些参数吗?

BowieHsu commented 1 year ago

@yeyan00 您好,您还有更多的log和超参能共享一下吗,比较重要的参数是生成伪标签的conf和nms阈值

yeyan00 commented 1 year ago

@yeyan00 您好,您还有更多的log和超参能共享一下吗,比较重要的参数是生成伪标签的conf和nms阈值

非常感谢您的回复!

config和log如下: 训练参数

# EfficientTeacher by Alibaba Cloud 

project: 'yolov5_ssod_pw'
adam: False
epochs: 100
weights: 'exp11/weights/last.pt'
prune_finetune: False
linear_lr: True
find_unused_parameters: True

hyp:
  lr0: 0.01
  hsv_h: 0.015
  hsv_s: 0.7
  hsv_v: 0.4
  lrf: 1.0
  scale: 0.9
  burn_epochs: 200
  no_aug_epochs: 0
  mosaic: 1.0
  # mixup: 0.1
  warmup_epochs: 3

Model:
  depth_multiple: 1.00  # model depth multiple
  width_multiple: 1.00  # layer channel multiple
  Backbone: 
    name: 'YoloV5'
    activation: 'SiLU'
  Neck: 
    name: 'YoloV5' 
    in_channels: [256, 512, 1024]
    out_channels: [256, 512, 1024]
    activation: 'SiLU'
  Head: 
    name: 'YoloV5'
    activation: 'SiLU'
  anchors: [[10,13, 16,30, 33,23],[30,61, 62,45, 59,119],[116,90, 156,198, 373,326]]  # P5/32]
Loss:
  type: 'ComputeLoss'
  cls: 0.3
  obj: 0.7
  anchor_t: 4.0

Dataset:
  data_name: 'coco'
  train: datasets/test_target/train.txt
  val:   datasets/test_target/val.txt 
  test:  datasets/test_target/val.txt
  target: datasets/target.txt
  nc: 7  # number of classes
  np: 0 #number of keypoints
  names: [ '1', '2', '3', '4', '5', '6', '7', ]
  img_size: 1024
  batch_size: 8 #12

SSOD:
  train_domain: True
  nms_conf_thres: 0.1
  nms_iou_thres: 0.65
  teacher_loss_weight: 1.0
  cls_loss_weight: 0.3
  box_loss_weight: 0.05
  obj_loss_weight: 0.7
  loss_type: 'ComputeStudentMatchLoss'
  ignore_thres_low: 0.1
  ignore_thres_high: 0.6
  uncertain_aug: True
  use_ota: False
  multi_label: False
  ignore_obj: False
  pseudo_label_with_obj: True
  pseudo_label_with_bbox: True
  pseudo_label_with_cls: False
  with_da_loss: False
  da_loss_weights: 0.01
  epoch_adaptor: True
  resample_high_percent: 0.25
  resample_low_percent: 0.99
  ema_rate: 0.999
  cosine_ema: True
  imitate_teacher: False
  # dynamic_thres: True
  ssod_hyp:
    with_gt: False
    mosaic: 1.0
    cutout: 0.5
    autoaugment: 0.5
    scale: 0.8
    degrees: 0.0
    shear: 0.0

log:

              epoch,      train/box_loss,      train/obj_loss,      train/cls_loss,   metrics/precision,      metrics/recall,     metrics/mAP_0.5,metrics/mAP_0.5:0.95,        val/box_loss,        val/obj_loss,        val/cls_loss,               x/lr0,               x/lr1,               x/lr2
                 200,            0.058321,           0.0075394,            0.010123,             0.77295,             0.57089,             0.65443,             0.45817,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 201,            0.052145,           0.0069274,            0.007829,             0.73603,             0.57944,             0.64247,             0.45159,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 202,            0.048028,           0.0064725,           0.0061186,             0.72618,             0.54796,             0.61716,             0.43428,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 203,            0.043944,             0.00602,           0.0047832,             0.72813,             0.52685,             0.59519,             0.41158,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 204,            0.042173,           0.0057919,           0.0043807,             0.75121,             0.50088,              0.5751,             0.39154,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 205,            0.041191,           0.0056821,            0.004147,             0.72235,             0.50613,             0.56577,             0.38433,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 206,            0.040881,            0.005655,           0.0040669,             0.72657,              0.5016,             0.56242,             0.37758,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 207,            0.039792,           0.0054416,           0.0036513,             0.72811,             0.50103,             0.56049,             0.37467,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 208,            0.040218,           0.0055046,           0.0038934,             0.68189,             0.49388,             0.55154,             0.37384,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 209,            0.040424,           0.0055795,           0.0039208,              0.6868,             0.49531,             0.55343,             0.37651,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 210,            0.040183,           0.0055007,           0.0038468,             0.67679,             0.50268,             0.55736,             0.37618,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 211,            0.039495,            0.005447,           0.0036891,             0.67071,             0.50672,             0.55611,             0.37446,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 212,            0.040163,           0.0054785,           0.0038868,             0.69708,             0.49645,             0.55594,             0.37297,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 213,            0.040442,           0.0055599,           0.0040067,             0.71779,             0.49104,             0.55733,             0.37369,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 214,            0.040356,           0.0055748,           0.0040357,             0.70968,             0.49747,             0.55785,              0.3758,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 215,            0.040113,           0.0055368,           0.0038601,             0.73359,             0.48886,             0.55911,              0.3779,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 216,            0.040519,           0.0056348,           0.0040296,             0.73027,             0.49079,             0.55974,             0.37739,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 217,             0.04211,           0.0058181,           0.0046134,             0.72598,              0.4941,             0.56208,             0.37913,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 218,            0.040778,           0.0056085,           0.0040758,             0.78336,             0.49196,             0.57009,              0.3828,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 219,            0.040072,           0.0055178,           0.0038117,             0.77906,             0.49113,             0.57438,             0.38569,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 220,            0.039904,           0.0054627,           0.0037906,             0.77396,              0.4903,             0.57428,             0.38615,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 221,            0.039558,           0.0054479,           0.0037251,             0.77501,              0.5084,             0.58562,             0.39149,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 222,            0.039841,           0.0054796,           0.0038705,             0.78104,             0.50777,             0.58867,             0.39407,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 223,            0.040341,           0.0055374,           0.0040509,             0.68206,             0.55447,              0.5923,             0.39558,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 224,            0.040295,           0.0056236,           0.0040332,             0.68204,             0.55051,             0.59192,              0.3941,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 225,            0.040649,           0.0056158,           0.0040314,             0.69214,              0.5489,             0.59185,             0.39529,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 226,            0.042779,           0.0059315,           0.0047266,             0.69578,             0.55081,             0.59398,             0.39638,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 227,            0.041858,           0.0057899,           0.0044368,             0.68412,             0.56147,             0.59354,             0.39755,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 228,            0.040571,           0.0055551,           0.0041417,              0.6965,             0.55951,             0.59272,             0.39671,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 229,            0.039785,           0.0055068,           0.0038227,             0.76667,             0.52193,             0.59231,              0.3948,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 230,             0.03998,           0.0055113,           0.0039404,             0.76032,             0.52615,             0.59029,             0.39385,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 231,             0.04042,           0.0055823,           0.0039816,             0.73844,             0.53282,             0.59177,             0.39466,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 232,            0.040161,           0.0055292,           0.0039988,             0.68458,             0.55917,             0.59314,             0.39495,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 233,            0.041172,           0.0057276,           0.0043228,             0.77819,             0.51305,              0.5941,             0.39629,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 234,            0.039622,           0.0054349,           0.0037551,             0.76874,             0.51686,             0.59404,             0.39708,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 235,            0.039399,           0.0053831,           0.0036508,              0.7258,             0.52973,              0.5928,             0.39991,                   0,                   0,                   0,                0.01,                0.01,                0.01
                 236,            0.039229,           0.0053484,           0.0035704,             0.74353,              0.5188,             0.59367,