ZHANGYUXUAN-zR commited on
Commit
2087865
·
verified ·
1 Parent(s): dcdd658

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +230 -0
  2. parse/dev/0I3su3mkuL/0I3su3mkuL.md +370 -0
  3. parse/dev/0I3su3mkuL/0I3su3mkuL_content_list.json +0 -0
  4. parse/dev/7gE9V9GBZaI/7gE9V9GBZaI.md +560 -0
  5. parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_content_list.json +0 -0
  6. parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_middle.json +0 -0
  7. parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_model.json +0 -0
  8. parse/dev/KwmPfARgOTD/KwmPfARgOTD.md +0 -0
  9. parse/dev/KwmPfARgOTD/KwmPfARgOTD_content_list.json +0 -0
  10. parse/dev/KwmPfARgOTD/KwmPfARgOTD_middle.json +0 -0
  11. parse/dev/KwmPfARgOTD/KwmPfARgOTD_model.json +0 -0
  12. parse/dev/OgCcfc1m0TO/OgCcfc1m0TO.md +267 -0
  13. parse/dev/OgCcfc1m0TO/OgCcfc1m0TO_model.json +0 -0
  14. parse/dev/RA7ND878XP/RA7ND878XP.md +310 -0
  15. parse/dev/RA7ND878XP/RA7ND878XP_content_list.json +1379 -0
  16. parse/dev/RA7ND878XP/RA7ND878XP_middle.json +0 -0
  17. parse/dev/RA7ND878XP/RA7ND878XP_model.json +0 -0
  18. parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_content_list.json +0 -0
  19. parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_middle.json +0 -0
  20. parse/dev/VgOw1pUPh97/VgOw1pUPh97_middle.json +0 -0
  21. parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_model.json +0 -0
  22. parse/train/0NXUSlb6oEu/0NXUSlb6oEu_layout.pdf +3 -0
  23. parse/train/0NXUSlb6oEu/0NXUSlb6oEu_origin.pdf +3 -0
  24. parse/train/0NXUSlb6oEu/0NXUSlb6oEu_span.pdf +3 -0
  25. parse/train/6YEQUn0QICG/6YEQUn0QICG_layout.pdf +3 -0
  26. parse/train/6YEQUn0QICG/6YEQUn0QICG_origin.pdf +3 -0
  27. parse/train/6YEQUn0QICG/6YEQUn0QICG_span.pdf +3 -0
  28. parse/train/74RmfBweB60/74RmfBweB60_layout.pdf +3 -0
  29. parse/train/74RmfBweB60/74RmfBweB60_origin.pdf +3 -0
  30. parse/train/74RmfBweB60/74RmfBweB60_span.pdf +3 -0
  31. parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_layout.pdf +3 -0
  32. parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_origin.pdf +3 -0
  33. parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_span.pdf +3 -0
  34. parse/train/8dqEeFuhgMG/8dqEeFuhgMG_layout.pdf +3 -0
  35. parse/train/8dqEeFuhgMG/8dqEeFuhgMG_origin.pdf +3 -0
  36. parse/train/8dqEeFuhgMG/8dqEeFuhgMG_span.pdf +3 -0
  37. parse/train/9xC2tWEwBD/9xC2tWEwBD_layout.pdf +3 -0
  38. parse/train/9xC2tWEwBD/9xC2tWEwBD_origin.pdf +3 -0
  39. parse/train/9xC2tWEwBD/9xC2tWEwBD_span.pdf +3 -0
  40. parse/train/B1ewdt9xe/B1ewdt9xe_layout.pdf +3 -0
  41. parse/train/B1ewdt9xe/B1ewdt9xe_origin.pdf +3 -0
  42. parse/train/B1ewdt9xe/B1ewdt9xe_span.pdf +3 -0
  43. parse/train/B1gTShAct7/B1gTShAct7_layout.pdf +3 -0
  44. parse/train/B1gTShAct7/B1gTShAct7_origin.pdf +3 -0
  45. parse/train/B1gTShAct7/B1gTShAct7_span.pdf +3 -0
  46. parse/train/B1lnbRNtwr/B1lnbRNtwr_layout.pdf +3 -0
  47. parse/train/B1lnbRNtwr/B1lnbRNtwr_origin.pdf +3 -0
  48. parse/train/B1lnbRNtwr/B1lnbRNtwr_span.pdf +3 -0
  49. parse/train/B1xm3RVtwB/B1xm3RVtwB_layout.pdf +3 -0
  50. parse/train/B1xm3RVtwB/B1xm3RVtwB_origin.pdf +3 -0
.gitattributes CHANGED
@@ -5349,3 +5349,233 @@ parse/train/rylrdxHFDr/rylrdxHFDr_span.pdf filter=lfs diff=lfs merge=lfs -text
5349
  parse/train/rylrdxHFDr/rylrdxHFDr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5350
  parse/train/SJeS16EKPr/SJeS16EKPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5351
  parse/train/SJeS16EKPr/SJeS16EKPr_span.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5349
  parse/train/rylrdxHFDr/rylrdxHFDr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5350
  parse/train/SJeS16EKPr/SJeS16EKPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5351
  parse/train/SJeS16EKPr/SJeS16EKPr_span.pdf filter=lfs diff=lfs merge=lfs -text
5352
+ parse/train/SJeS16EKPr/SJeS16EKPr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5353
+ parse/train/SJx9ngStPH/SJx9ngStPH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5354
+ parse/train/SJx9ngStPH/SJx9ngStPH_span.pdf filter=lfs diff=lfs merge=lfs -text
5355
+ parse/train/SJx9ngStPH/SJx9ngStPH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5356
+ parse/train/LkFG3lB13U5/LkFG3lB13U5_origin.pdf filter=lfs diff=lfs merge=lfs -text
5357
+ parse/train/LkFG3lB13U5/LkFG3lB13U5_span.pdf filter=lfs diff=lfs merge=lfs -text
5358
+ parse/train/LkFG3lB13U5/LkFG3lB13U5_layout.pdf filter=lfs diff=lfs merge=lfs -text
5359
+ parse/train/B1xm3RVtwB/B1xm3RVtwB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5360
+ parse/train/B1xm3RVtwB/B1xm3RVtwB_span.pdf filter=lfs diff=lfs merge=lfs -text
5361
+ parse/train/B1xm3RVtwB/B1xm3RVtwB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5362
+ parse/train/B1ewdt9xe/B1ewdt9xe_origin.pdf filter=lfs diff=lfs merge=lfs -text
5363
+ parse/train/B1ewdt9xe/B1ewdt9xe_layout.pdf filter=lfs diff=lfs merge=lfs -text
5364
+ parse/train/B1ewdt9xe/B1ewdt9xe_span.pdf filter=lfs diff=lfs merge=lfs -text
5365
+ parse/train/S1x0CnEtvB/S1x0CnEtvB_span.pdf filter=lfs diff=lfs merge=lfs -text
5366
+ parse/train/S1x0CnEtvB/S1x0CnEtvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5367
+ parse/train/S1x0CnEtvB/S1x0CnEtvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5368
+ parse/train/S1J2ZyZ0Z/S1J2ZyZ0Z_origin.pdf filter=lfs diff=lfs merge=lfs -text
5369
+ parse/train/S1J2ZyZ0Z/S1J2ZyZ0Z_layout.pdf filter=lfs diff=lfs merge=lfs -text
5370
+ parse/train/S1J2ZyZ0Z/S1J2ZyZ0Z_span.pdf filter=lfs diff=lfs merge=lfs -text
5371
+ parse/train/axNDkxU9-6z/axNDkxU9-6z_span.pdf filter=lfs diff=lfs merge=lfs -text
5372
+ parse/train/axNDkxU9-6z/axNDkxU9-6z_origin.pdf filter=lfs diff=lfs merge=lfs -text
5373
+ parse/train/axNDkxU9-6z/axNDkxU9-6z_layout.pdf filter=lfs diff=lfs merge=lfs -text
5374
+ parse/train/blfSjHeFM_e/blfSjHeFM_e_layout.pdf filter=lfs diff=lfs merge=lfs -text
5375
+ parse/train/blfSjHeFM_e/blfSjHeFM_e_span.pdf filter=lfs diff=lfs merge=lfs -text
5376
+ parse/train/blfSjHeFM_e/blfSjHeFM_e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5377
+ parse/train/HyeSin4FPB/HyeSin4FPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5378
+ parse/train/HyeSin4FPB/HyeSin4FPB_span.pdf filter=lfs diff=lfs merge=lfs -text
5379
+ parse/train/HyeSin4FPB/HyeSin4FPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5380
+ parse/train/9xC2tWEwBD/9xC2tWEwBD_span.pdf filter=lfs diff=lfs merge=lfs -text
5381
+ parse/train/9xC2tWEwBD/9xC2tWEwBD_origin.pdf filter=lfs diff=lfs merge=lfs -text
5382
+ parse/train/9xC2tWEwBD/9xC2tWEwBD_layout.pdf filter=lfs diff=lfs merge=lfs -text
5383
+ parse/train/hfkER_KJiNw/hfkER_KJiNw_span.pdf filter=lfs diff=lfs merge=lfs -text
5384
+ parse/train/hfkER_KJiNw/hfkER_KJiNw_origin.pdf filter=lfs diff=lfs merge=lfs -text
5385
+ parse/train/hfkER_KJiNw/hfkER_KJiNw_layout.pdf filter=lfs diff=lfs merge=lfs -text
5386
+ parse/train/ryxB2lBtvH/ryxB2lBtvH_span.pdf filter=lfs diff=lfs merge=lfs -text
5387
+ parse/train/ryxB2lBtvH/ryxB2lBtvH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5388
+ parse/train/ryxB2lBtvH/ryxB2lBtvH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5389
+ parse/train/ByGq7hRqKX/ByGq7hRqKX_origin.pdf filter=lfs diff=lfs merge=lfs -text
5390
+ parse/train/ByGq7hRqKX/ByGq7hRqKX_span.pdf filter=lfs diff=lfs merge=lfs -text
5391
+ parse/train/ByGq7hRqKX/ByGq7hRqKX_layout.pdf filter=lfs diff=lfs merge=lfs -text
5392
+ parse/train/dV19Yyi1fS3/dV19Yyi1fS3_layout.pdf filter=lfs diff=lfs merge=lfs -text
5393
+ parse/train/dV19Yyi1fS3/dV19Yyi1fS3_span.pdf filter=lfs diff=lfs merge=lfs -text
5394
+ parse/train/dV19Yyi1fS3/dV19Yyi1fS3_origin.pdf filter=lfs diff=lfs merge=lfs -text
5395
+ parse/train/ByxGkySKwH/ByxGkySKwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5396
+ parse/train/HJgXCV9xx/HJgXCV9xx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5397
+ parse/train/HJgXCV9xx/HJgXCV9xx_span.pdf filter=lfs diff=lfs merge=lfs -text
5398
+ parse/train/rkmu5b0a-/rkmu5b0a-_layout.pdf filter=lfs diff=lfs merge=lfs -text
5399
+ parse/train/rkmu5b0a-/rkmu5b0a-_span.pdf filter=lfs diff=lfs merge=lfs -text
5400
+ parse/train/rkmu5b0a-/rkmu5b0a-_origin.pdf filter=lfs diff=lfs merge=lfs -text
5401
+ parse/train/Hkx6hANtwH/Hkx6hANtwH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5402
+ parse/train/Hkx6hANtwH/Hkx6hANtwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5403
+ parse/train/Hkx6hANtwH/Hkx6hANtwH_span.pdf filter=lfs diff=lfs merge=lfs -text
5404
+ parse/train/tUeeRzMXJZ/tUeeRzMXJZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5405
+ parse/train/tUeeRzMXJZ/tUeeRzMXJZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5406
+ parse/train/tUeeRzMXJZ/tUeeRzMXJZ_span.pdf filter=lfs diff=lfs merge=lfs -text
5407
+ parse/train/LJjC6DmSkgT/LJjC6DmSkgT_layout.pdf filter=lfs diff=lfs merge=lfs -text
5408
+ parse/train/LJjC6DmSkgT/LJjC6DmSkgT_origin.pdf filter=lfs diff=lfs merge=lfs -text
5409
+ parse/train/LJjC6DmSkgT/LJjC6DmSkgT_span.pdf filter=lfs diff=lfs merge=lfs -text
5410
+ parse/train/jSz59N8NvUP/jSz59N8NvUP_span.pdf filter=lfs diff=lfs merge=lfs -text
5411
+ parse/train/jSz59N8NvUP/jSz59N8NvUP_layout.pdf filter=lfs diff=lfs merge=lfs -text
5412
+ parse/train/jSz59N8NvUP/jSz59N8NvUP_origin.pdf filter=lfs diff=lfs merge=lfs -text
5413
+ parse/train/rJeKjwvclx/rJeKjwvclx_span.pdf filter=lfs diff=lfs merge=lfs -text
5414
+ parse/train/rJeKjwvclx/rJeKjwvclx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5415
+ parse/train/rJeKjwvclx/rJeKjwvclx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5416
+ parse/train/B1lnbRNtwr/B1lnbRNtwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5417
+ parse/train/B1lnbRNtwr/B1lnbRNtwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5418
+ parse/train/B1lnbRNtwr/B1lnbRNtwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5419
+ parse/train/EI2KOXKdnP/EI2KOXKdnP_layout.pdf filter=lfs diff=lfs merge=lfs -text
5420
+ parse/train/EI2KOXKdnP/EI2KOXKdnP_origin.pdf filter=lfs diff=lfs merge=lfs -text
5421
+ parse/train/EI2KOXKdnP/EI2KOXKdnP_span.pdf filter=lfs diff=lfs merge=lfs -text
5422
+ parse/train/ryghZJBKPS/ryghZJBKPS_span.pdf filter=lfs diff=lfs merge=lfs -text
5423
+ parse/train/ryghZJBKPS/ryghZJBKPS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5424
+ parse/train/ryghZJBKPS/ryghZJBKPS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5425
+ parse/train/djbC2A4uTHP/djbC2A4uTHP_origin.pdf filter=lfs diff=lfs merge=lfs -text
5426
+ parse/train/djbC2A4uTHP/djbC2A4uTHP_layout.pdf filter=lfs diff=lfs merge=lfs -text
5427
+ parse/train/djbC2A4uTHP/djbC2A4uTHP_span.pdf filter=lfs diff=lfs merge=lfs -text
5428
+ parse/train/HJepXaVYDr/HJepXaVYDr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5429
+ parse/train/HJepXaVYDr/HJepXaVYDr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5430
+ parse/train/HJepXaVYDr/HJepXaVYDr_span.pdf filter=lfs diff=lfs merge=lfs -text
5431
+ parse/train/SJe3HiC5KX/SJe3HiC5KX_layout.pdf filter=lfs diff=lfs merge=lfs -text
5432
+ parse/train/SJe3HiC5KX/SJe3HiC5KX_span.pdf filter=lfs diff=lfs merge=lfs -text
5433
+ parse/train/SJe3HiC5KX/SJe3HiC5KX_origin.pdf filter=lfs diff=lfs merge=lfs -text
5434
+ parse/train/SkgC6TNFvr/SkgC6TNFvr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5435
+ parse/train/SkgC6TNFvr/SkgC6TNFvr_span.pdf filter=lfs diff=lfs merge=lfs -text
5436
+ parse/train/SkgC6TNFvr/SkgC6TNFvr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5437
+ parse/train/rye9LT8cee/rye9LT8cee_span.pdf filter=lfs diff=lfs merge=lfs -text
5438
+ parse/train/rye9LT8cee/rye9LT8cee_origin.pdf filter=lfs diff=lfs merge=lfs -text
5439
+ parse/train/rye9LT8cee/rye9LT8cee_layout.pdf filter=lfs diff=lfs merge=lfs -text
5440
+ parse/train/S1xcx3C5FX/S1xcx3C5FX_layout.pdf filter=lfs diff=lfs merge=lfs -text
5441
+ parse/train/S1xcx3C5FX/S1xcx3C5FX_span.pdf filter=lfs diff=lfs merge=lfs -text
5442
+ parse/train/S1xcx3C5FX/S1xcx3C5FX_origin.pdf filter=lfs diff=lfs merge=lfs -text
5443
+ parse/train/rylKB3A9Fm/rylKB3A9Fm_layout.pdf filter=lfs diff=lfs merge=lfs -text
5444
+ parse/train/rylKB3A9Fm/rylKB3A9Fm_span.pdf filter=lfs diff=lfs merge=lfs -text
5445
+ parse/train/rylKB3A9Fm/rylKB3A9Fm_origin.pdf filter=lfs diff=lfs merge=lfs -text
5446
+ parse/train/rkeNr6EKwB/rkeNr6EKwB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5447
+ parse/train/rkeNr6EKwB/rkeNr6EKwB_span.pdf filter=lfs diff=lfs merge=lfs -text
5448
+ parse/train/rkeNr6EKwB/rkeNr6EKwB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5449
+ parse/train/OMizHuea_HB/OMizHuea_HB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5450
+ parse/train/OMizHuea_HB/OMizHuea_HB_span.pdf filter=lfs diff=lfs merge=lfs -text
5451
+ parse/train/OMizHuea_HB/OMizHuea_HB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5452
+ parse/train/BJm4T4Kgx/BJm4T4Kgx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5453
+ parse/train/BJm4T4Kgx/BJm4T4Kgx_span.pdf filter=lfs diff=lfs merge=lfs -text
5454
+ parse/train/BJm4T4Kgx/BJm4T4Kgx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5455
+ parse/train/SklEhlHtPr/SklEhlHtPr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5456
+ parse/train/SklEhlHtPr/SklEhlHtPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5457
+ parse/train/SklEhlHtPr/SklEhlHtPr_span.pdf filter=lfs diff=lfs merge=lfs -text
5458
+ parse/train/S1esMkHYPr/S1esMkHYPr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5459
+ parse/train/S1esMkHYPr/S1esMkHYPr_span.pdf filter=lfs diff=lfs merge=lfs -text
5460
+ parse/train/S1esMkHYPr/S1esMkHYPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5461
+ parse/train/Skxd6gSYDS/Skxd6gSYDS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5462
+ parse/train/Skxd6gSYDS/Skxd6gSYDS_span.pdf filter=lfs diff=lfs merge=lfs -text
5463
+ parse/train/Skxd6gSYDS/Skxd6gSYDS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5464
+ parse/train/BJfYvo09Y7/BJfYvo09Y7_span.pdf filter=lfs diff=lfs merge=lfs -text
5465
+ parse/train/BJfYvo09Y7/BJfYvo09Y7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5466
+ parse/train/BJfYvo09Y7/BJfYvo09Y7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5467
+ parse/train/HJlTpCEKvS/HJlTpCEKvS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5468
+ parse/train/HJlTpCEKvS/HJlTpCEKvS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5469
+ parse/train/HJlTpCEKvS/HJlTpCEKvS_span.pdf filter=lfs diff=lfs merge=lfs -text
5470
+ parse/train/HyunpgbR-/HyunpgbR-_layout.pdf filter=lfs diff=lfs merge=lfs -text
5471
+ parse/train/HyunpgbR-/HyunpgbR-_origin.pdf filter=lfs diff=lfs merge=lfs -text
5472
+ parse/train/HyunpgbR-/HyunpgbR-_span.pdf filter=lfs diff=lfs merge=lfs -text
5473
+ parse/train/rkKCdAdgx/rkKCdAdgx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5474
+ parse/train/rkKCdAdgx/rkKCdAdgx_span.pdf filter=lfs diff=lfs merge=lfs -text
5475
+ parse/train/rkKCdAdgx/rkKCdAdgx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5476
+ parse/train/zeFrfgyZln/zeFrfgyZln_span.pdf filter=lfs diff=lfs merge=lfs -text
5477
+ parse/train/zeFrfgyZln/zeFrfgyZln_layout.pdf filter=lfs diff=lfs merge=lfs -text
5478
+ parse/train/zeFrfgyZln/zeFrfgyZln_origin.pdf filter=lfs diff=lfs merge=lfs -text
5479
+ parse/train/BJlLdhNFPr/BJlLdhNFPr_span.pdf filter=lfs diff=lfs merge=lfs -text
5480
+ parse/train/BJlLdhNFPr/BJlLdhNFPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5481
+ parse/train/BJlLdhNFPr/BJlLdhNFPr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5482
+ parse/train/kW_zpEmMLdP/kW_zpEmMLdP_origin.pdf filter=lfs diff=lfs merge=lfs -text
5483
+ parse/train/kW_zpEmMLdP/kW_zpEmMLdP_layout.pdf filter=lfs diff=lfs merge=lfs -text
5484
+ parse/train/kW_zpEmMLdP/kW_zpEmMLdP_span.pdf filter=lfs diff=lfs merge=lfs -text
5485
+ parse/train/0NXUSlb6oEu/0NXUSlb6oEu_origin.pdf filter=lfs diff=lfs merge=lfs -text
5486
+ parse/train/0NXUSlb6oEu/0NXUSlb6oEu_span.pdf filter=lfs diff=lfs merge=lfs -text
5487
+ parse/train/0NXUSlb6oEu/0NXUSlb6oEu_layout.pdf filter=lfs diff=lfs merge=lfs -text
5488
+ parse/train/Hkg9HgBYwH/Hkg9HgBYwH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5489
+ parse/train/Hkg9HgBYwH/Hkg9HgBYwH_span.pdf filter=lfs diff=lfs merge=lfs -text
5490
+ parse/train/Hkg9HgBYwH/Hkg9HgBYwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5491
+ parse/train/rJXMpikCZ/rJXMpikCZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5492
+ parse/train/rJXMpikCZ/rJXMpikCZ_span.pdf filter=lfs diff=lfs merge=lfs -text
5493
+ parse/train/rJXMpikCZ/rJXMpikCZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5494
+ parse/train/HyeJf1HKvS/HyeJf1HKvS_span.pdf filter=lfs diff=lfs merge=lfs -text
5495
+ parse/train/HyeJf1HKvS/HyeJf1HKvS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5496
+ parse/train/HyeJf1HKvS/HyeJf1HKvS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5497
+ parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_span.pdf filter=lfs diff=lfs merge=lfs -text
5498
+ parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_origin.pdf filter=lfs diff=lfs merge=lfs -text
5499
+ parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_layout.pdf filter=lfs diff=lfs merge=lfs -text
5500
+ parse/train/6YEQUn0QICG/6YEQUn0QICG_layout.pdf filter=lfs diff=lfs merge=lfs -text
5501
+ parse/train/6YEQUn0QICG/6YEQUn0QICG_origin.pdf filter=lfs diff=lfs merge=lfs -text
5502
+ parse/train/6YEQUn0QICG/6YEQUn0QICG_span.pdf filter=lfs diff=lfs merge=lfs -text
5503
+ parse/train/HJxwDiActX/HJxwDiActX_layout.pdf filter=lfs diff=lfs merge=lfs -text
5504
+ parse/train/HJxwDiActX/HJxwDiActX_origin.pdf filter=lfs diff=lfs merge=lfs -text
5505
+ parse/train/HJxwDiActX/HJxwDiActX_span.pdf filter=lfs diff=lfs merge=lfs -text
5506
+ parse/train/BkMiWhR5K7/BkMiWhR5K7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5507
+ parse/train/BkMiWhR5K7/BkMiWhR5K7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5508
+ parse/train/BkMiWhR5K7/BkMiWhR5K7_span.pdf filter=lfs diff=lfs merge=lfs -text
5509
+ parse/train/ByxGSsR9FQ/ByxGSsR9FQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5510
+ parse/train/ByxGSsR9FQ/ByxGSsR9FQ_span.pdf filter=lfs diff=lfs merge=lfs -text
5511
+ parse/train/ByxGSsR9FQ/ByxGSsR9FQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5512
+ parse/train/rkxoNnC5FQ/rkxoNnC5FQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5513
+ parse/train/rkxoNnC5FQ/rkxoNnC5FQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5514
+ parse/train/rkxoNnC5FQ/rkxoNnC5FQ_span.pdf filter=lfs diff=lfs merge=lfs -text
5515
+ parse/train/EnmG3G5SYR/EnmG3G5SYR_span.pdf filter=lfs diff=lfs merge=lfs -text
5516
+ parse/train/EnmG3G5SYR/EnmG3G5SYR_layout.pdf filter=lfs diff=lfs merge=lfs -text
5517
+ parse/train/EnmG3G5SYR/EnmG3G5SYR_origin.pdf filter=lfs diff=lfs merge=lfs -text
5518
+ parse/train/B1gTShAct7/B1gTShAct7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5519
+ parse/train/B1gTShAct7/B1gTShAct7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5520
+ parse/train/B1gTShAct7/B1gTShAct7_span.pdf filter=lfs diff=lfs merge=lfs -text
5521
+ parse/train/r1ltgp4FwS/r1ltgp4FwS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5522
+ parse/train/r1ltgp4FwS/r1ltgp4FwS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5523
+ parse/train/r1ltgp4FwS/r1ltgp4FwS_span.pdf filter=lfs diff=lfs merge=lfs -text
5524
+ parse/train/BJgkbyHKDS/BJgkbyHKDS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5525
+ parse/train/BJgkbyHKDS/BJgkbyHKDS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5526
+ parse/train/BJgkbyHKDS/BJgkbyHKDS_span.pdf filter=lfs diff=lfs merge=lfs -text
5527
+ parse/train/de11dbHzAMF/de11dbHzAMF_span.pdf filter=lfs diff=lfs merge=lfs -text
5528
+ parse/train/de11dbHzAMF/de11dbHzAMF_origin.pdf filter=lfs diff=lfs merge=lfs -text
5529
+ parse/train/de11dbHzAMF/de11dbHzAMF_layout.pdf filter=lfs diff=lfs merge=lfs -text
5530
+ parse/train/r1glDpNYwS/r1glDpNYwS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5531
+ parse/train/r1glDpNYwS/r1glDpNYwS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5532
+ parse/train/r1glDpNYwS/r1glDpNYwS_span.pdf filter=lfs diff=lfs merge=lfs -text
5533
+ parse/train/fUxqIofPPi/fUxqIofPPi_origin.pdf filter=lfs diff=lfs merge=lfs -text
5534
+ parse/train/fUxqIofPPi/fUxqIofPPi_layout.pdf filter=lfs diff=lfs merge=lfs -text
5535
+ parse/train/fUxqIofPPi/fUxqIofPPi_span.pdf filter=lfs diff=lfs merge=lfs -text
5536
+ parse/train/WigDnV-_Gq/WigDnV-_Gq_layout.pdf filter=lfs diff=lfs merge=lfs -text
5537
+ parse/train/WigDnV-_Gq/WigDnV-_Gq_span.pdf filter=lfs diff=lfs merge=lfs -text
5538
+ parse/train/WigDnV-_Gq/WigDnV-_Gq_origin.pdf filter=lfs diff=lfs merge=lfs -text
5539
+ parse/train/Hke-WTVtwr/Hke-WTVtwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5540
+ parse/train/Hke-WTVtwr/Hke-WTVtwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5541
+ parse/train/Hke-WTVtwr/Hke-WTVtwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5542
+ parse/train/74RmfBweB60/74RmfBweB60_layout.pdf filter=lfs diff=lfs merge=lfs -text
5543
+ parse/train/74RmfBweB60/74RmfBweB60_origin.pdf filter=lfs diff=lfs merge=lfs -text
5544
+ parse/train/74RmfBweB60/74RmfBweB60_span.pdf filter=lfs diff=lfs merge=lfs -text
5545
+ parse/train/rytstxWAW/rytstxWAW_layout.pdf filter=lfs diff=lfs merge=lfs -text
5546
+ parse/train/rytstxWAW/rytstxWAW_origin.pdf filter=lfs diff=lfs merge=lfs -text
5547
+ parse/train/rytstxWAW/rytstxWAW_span.pdf filter=lfs diff=lfs merge=lfs -text
5548
+ parse/train/rklklCVYvB/rklklCVYvB_span.pdf filter=lfs diff=lfs merge=lfs -text
5549
+ parse/train/rklklCVYvB/rklklCVYvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5550
+ parse/train/rklklCVYvB/rklklCVYvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5551
+ parse/train/Bkg6RiCqY7/Bkg6RiCqY7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5552
+ parse/train/Bkg6RiCqY7/Bkg6RiCqY7_span.pdf filter=lfs diff=lfs merge=lfs -text
5553
+ parse/train/Bkg6RiCqY7/Bkg6RiCqY7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5554
+ parse/train/SJMnG2C9YX/SJMnG2C9YX_origin.pdf filter=lfs diff=lfs merge=lfs -text
5555
+ parse/train/SJMnG2C9YX/SJMnG2C9YX_span.pdf filter=lfs diff=lfs merge=lfs -text
5556
+ parse/train/SJMnG2C9YX/SJMnG2C9YX_layout.pdf filter=lfs diff=lfs merge=lfs -text
5557
+ parse/train/8dqEeFuhgMG/8dqEeFuhgMG_origin.pdf filter=lfs diff=lfs merge=lfs -text
5558
+ parse/train/8dqEeFuhgMG/8dqEeFuhgMG_layout.pdf filter=lfs diff=lfs merge=lfs -text
5559
+ parse/train/8dqEeFuhgMG/8dqEeFuhgMG_span.pdf filter=lfs diff=lfs merge=lfs -text
5560
+ parse/train/SygcCnNKwr/SygcCnNKwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5561
+ parse/train/SygcCnNKwr/SygcCnNKwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5562
+ parse/train/SygcCnNKwr/SygcCnNKwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5563
+ parse/train/rYhBGWYm6AU/rYhBGWYm6AU_origin.pdf filter=lfs diff=lfs merge=lfs -text
5564
+ parse/train/rYhBGWYm6AU/rYhBGWYm6AU_layout.pdf filter=lfs diff=lfs merge=lfs -text
5565
+ parse/train/rYhBGWYm6AU/rYhBGWYm6AU_span.pdf filter=lfs diff=lfs merge=lfs -text
5566
+ parse/train/SJgw51HFDr/SJgw51HFDr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5567
+ parse/train/SJgw51HFDr/SJgw51HFDr_span.pdf filter=lfs diff=lfs merge=lfs -text
5568
+ parse/train/SJgw51HFDr/SJgw51HFDr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5569
+ parse/train/hqDb8d65Vfh/hqDb8d65Vfh_layout.pdf filter=lfs diff=lfs merge=lfs -text
5570
+ parse/train/hqDb8d65Vfh/hqDb8d65Vfh_span.pdf filter=lfs diff=lfs merge=lfs -text
5571
+ parse/train/hqDb8d65Vfh/hqDb8d65Vfh_origin.pdf filter=lfs diff=lfs merge=lfs -text
5572
+ parse/train/rJx1Na4Fwr/rJx1Na4Fwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5573
+ parse/train/rJx1Na4Fwr/rJx1Na4Fwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5574
+ parse/train/rJx1Na4Fwr/rJx1Na4Fwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5575
+ parse/train/HyxnnnVtwB/HyxnnnVtwB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5576
+ parse/train/HyxnnnVtwB/HyxnnnVtwB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5577
+ parse/train/HyxnnnVtwB/HyxnnnVtwB_span.pdf filter=lfs diff=lfs merge=lfs -text
5578
+ parse/train/r1VPNiA5Fm/r1VPNiA5Fm_layout.pdf filter=lfs diff=lfs merge=lfs -text
5579
+ parse/train/r1VPNiA5Fm/r1VPNiA5Fm_origin.pdf filter=lfs diff=lfs merge=lfs -text
5580
+ parse/train/r1VPNiA5Fm/r1VPNiA5Fm_span.pdf filter=lfs diff=lfs merge=lfs -text
5581
+ parse/train/HJGwcKclx/HJGwcKclx_origin.pdf filter=lfs diff=lfs merge=lfs -text
parse/dev/0I3su3mkuL/0I3su3mkuL.md ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Q-Transformer: Scalable Offline Reinforcement Learning via Autoregressive Q-Functions
2
+
3
+ Yevgen Chebotar∗, Quan Vuong∗, Alex Irpan, Karol Hausman, Fei Xia, Yao Lu, Aviral Kumar, Tianhe Yu, Alexander Herzog, Karl Pertsch, Keerthana Gopalakrishnan, Julian Ibarz, Ofir Nachum, Sumedh Sontakke, Grecia Salazar, Huong T Tran, Jodilyn Peralta, Clayton Tan, Deeksha Manjunath, Jaspiar Singht, Brianna Zitkovich, Tomas Jackson, Kanishka Rao, Chelsea Finn, Sergey Levine
4
+
5
+ Google DeepMind
6
+
7
+ Abstract: In this work, we present a scalable reinforcement learning method for training multi-task policies from large offline datasets that can leverage both human demonstrations and autonomously collected data. Our method uses a Transformer to provide a scalable representation for Q-functions trained via offline temporal difference backups. We therefore refer to the method as Q-Transformer. By discretizing each action dimension and representing the Q-value of each action dimension as separate tokens, we can apply effective high-capacity sequence modeling techniques for Q-learning. We present several design decisions that enable good performance with offline RL training, and show that Q-Transformer outperforms prior offline RL algorithms and imitation learning techniques on a large diverse real-world robotic manipulation task suite. The project’s website and videos can be found at qtransformer.github.io
8
+
9
+ # 1 Introduction
10
+
11
+ Robotic learning methods that incorporate large and diverse datasets in combination with highcapacity expressive models, such as Transformers [1, 2, 3, 4, 5, 6], have the potential to acquire generalizable and broadly applicable policies that perform well on a wide variety of tasks [1, 2]. For example, these policies can follow natural language instructions [4, 7], perform multi-stage behaviors [8, 9], and generalize broadly across environments, objects, and even robot morphologies [10, 3]. However, many of the recently proposed high-capacity models in the robotic learning literature are trained with supervised learning methods. As such, the performance of the resulting policy is limited by the degree to which human demonstrators can provide high-quality demonstration data. This is limiting for two reasons. First, we would like robotic systems that are more proficient than human teleoperators, exploiting the full potential of the hardware to perform tasks quickly, fluently, and reliably. Second, we would like robotic systems that get better with autonomously gathered experience, rather than relying entirely on high-quality demonstrations.
12
+
13
+ ![](images/8f3b8d97deb66fea8fdfde8197851ec9a51cda09800ea72c66a724048084a978.jpg)
14
+ Figure 1: Q-Transformer enables training highcapacity sequential architectures on mixed quality data. Our policies are able to improve upon human demonstrations and execute a variety of manipulation tasks in the real world.
15
+
16
+ Reinforcement learning in principle provides both of these capabilities. A number of promising recent advances demonstrate the successes of large-scale robotic RL in varied settings, such as robotic grasping and stacking [11, 12], learning heterogeneous tasks with human-specified rewards [13], learning multi-task policies [14, 15], learning goal-conditioned policies [16, 17, 18, 19], and robotic navigation [20, 21, 22, 23, 24]. However, training high-capacity models such as Transformers using RL algorithms has proven more difficult to instantiate effectively at large scale. In this paper, we aim to combine large-scale robotic learning from diverse real-world datasets with modern high-capacity Transformer-based policy architectures.
17
+
18
+ While in principle simply replacing existing architectures (e.g., ResNets [15] or smaller convolutional neural networks [11, 14]) with a Transformer is conceptually straightforward, devising a methodology that effectively makes use of such architectures is considerably more challenging. High-capacity models only make sense when we train on large and diverse datasets – small, narrow datasets simply do not require this much capacity and do not benefit from it. While prior works used simulation to create such datasets [2, 25, 26], the most representative data comes from the real world [12, 11, 14]. Therefore, we focus on reinforcement learning methods that can use Transformers and incorporate large, previously collected datasets via offline RL. Offline RL methods train on prior data, aiming to derive the most effective possible policy from a given dataset. Of course, this dataset can be augmented with additionally autonomously gathered data, but the training is separated from data collection, providing an appealing workflow for large-scale robotics applications [27].
19
+
20
+ Another issue in applying Transformer models to RL is to design RL systems that can effectively train such models. Effective offline RL methods generally employ Q-function estimation via temporal difference updates [28]. Since Transformers model discrete token sequences, we convert the Q-function estimation problem into a discrete token sequence modeling problem, and devise a suitable loss function for each token in the sequence. Na¨ıvely discretizing the action space leads to exponential blowup in action cardinality, so we employ a per-dimension discretization scheme, where each dimension of the action space is treated as a separate time step for RL. Different bins in the discretization corresponds to distinct actions. The per-dimension discretization scheme allows us to use simple discrete-action Q-learning methods with a conservative regularizer to handle distributional shift [29, 30]. We propose a specific regularizer that minimizes values of every action that was not taken in the dataset and show that our method can learn from both narrow demonstration-like data and broader data with exploration noise. Finally, we utilize a hybrid update that combines Monte Carlo and $n$ -step returns with temporal difference backups [31], and show that doing so improves the performance of our Transformer-based offline RL method on large-scale robotic learning problems.
21
+
22
+ In summary, our main contribution is the Q-Transformer, a Transformer-based architecture for robotic offline reinforcement learning that makes use of per-dimension tokenization of Q-values and can readily be applied to large and diverse robotic datasets, including real-world data. We summarize the components of Q-Transformer in Figure 1. Our experimental evaluation validates the Q-Transformer by learning large-scale text-conditioned multi-task policies, both in simulation for rigorous comparisons and in large-scale real-world experiments for realistic validation. Our real-world experiments utilize a dataset with 38,000 successful demonstrations and 20,000 failed autonomously collected episodes on more than 700 tasks, gathered with a fleet of 13 robots. QTransformer outperforms previously proposed architectures for large-scale robotic RL [15, 14], as well as previously proposed Transformer-based models such as the Decision Transformer [32, 33].
23
+
24
+ # 2 Related Work
25
+
26
+ Offline RL has been extensively studied in recent works [34, 35, 36, 37, 35, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 39]. Conservative Q-learning (CQL) [29] learns policies constrained to a conservative lower bound of the value function. Our goal is not to develop a new algorithmic principle for offline RL, but to devise an offline RL system that can integrate with high-capacity Transformers, and scale to real-world multi-task robotic learning. We thus develop a version of CQL particularly effective for training large Transformer-based Q-functions on mixed quality data. While some works have noted that imitation learning outperforms offline RL on demonstration data [49], other works showed offline RL techniques to be effective with demonstrations both in theory and in practice [50, 15]. Nonetheless, a setting that combines “narrow” demonstration data with “broad” sub-optimal (e.g., autonomously collected) data is known to be particularly difficult [51, 52, 53], though it is quite natural in many robotic learning settings where we might want to augment a core set of demonstrations with relatively inexpensive low-quality autonomously collected data. We believe that the effectiveness of our method in this setting is of particular interest to practitioners.
27
+
28
+ Transformer-based architectures [54] have been explored in recent robotics research, both to learn generalizable task spaces [55, 56, 57, 58, 8, 59] and to learn multi-task or even multi-domain sequential policies directly [2, 1, 6, 3]. Although most of these works considered Transformers in a supervised learning setting, e.g., learning from demonstrations [4, 5], there are works on employing Transformers for RL and conditional imitation learning [32, 20, 60, 33]. In our experiments, we compare to Decision Transformer (DT) in particular [32], which extends conditional imitation learning with reward conditioning [61, 62] to use sequence models, and structurally resembles imitation learning methods that have been used successfully for robotic control. Although DT incorporates elements of RL (namely, reward functions), it does not provide a mechanism to improve over the demonstrated behavior or recombine parts of the dataset to synthesize more optimal behaviors, and indeed is known to have theoretical limitations [63]. On the other hand, such imitation-based recipes are popular perhaps due to the difficulty of integrating Transformer architectures with more powerful temporal difference methods (e.g., Q-learning). We show that several simple but important design decisions are needed to make this work, and our method significantly outperforms non-TD methods such as DT, as well as imitation learning, on our large-scale multi-task robotic control evaluation. Extending Decision Transformer, Yamagata et al. [64] proposed to use a Q-function in combination with a Transformer-based policy, but the Q-function itself did not use a Transformer-based architecture. Our Q-function could in principle be combined with this method, but our focus is specifically on directly training Transformers to represent Q-values.
29
+
30
+ ![](images/986b982ec8c568fb40ea32d38ae1b19d3470a6ea1e8ed97267472f6f8e9e17f2.jpg)
31
+ Figure 2: Q-values update for each action dimension at timestep t. Given a history of states, we update the Q-values of all bins in all action dimensions. The Q-values of the discrete action bins of the dataset actions are trained via the Bellman update (green boxes). The values of action bins not observed in the dataset are minimized towards zero (red boxes). The Q-targets of all action dimensions except the last one are computed using maximization over the next action dimension within the same time step. The Q-target of the last action dimension is computed using the discounted maximization of the first dimension of the next time step plus the reward. We also incorporate Monte Carlo returns by taking the maximum of the computed Q-targets and the return-to-go.
32
+
33
+ To develop a Transformer-based Q-learning method, we discretize each action space dimension, with each dimension acting as a distinct time step. Autoregressive generation of discrete actions has been explored by Metz et al. [65], who propose a hierarchical decomposition of an MDP and then utilize LSTM [66] for autoregressive discretization. Our discretization scheme is similar but simpler, in that we do not use any hierarchical decomposition but simply treat each dimension as a time step. However, since our goal is to perform offline RL at scale with real-world image based tasks (vs. the smaller state-space tasks learned via online RL by Metz et al. [65]), we present a number of additional design decisions to impose a conservative regularizer, enabling training our Transformerbased offline Q-learning method at scale, providing a complete robotic learning system.
34
+
35
+ # 3 Background
36
+
37
+ In RL, we learn policies $\pi$ that maximizes the expected total reward in a Markov decision process (MDP) with states $s$ , actions $a$ , discount factor $\gamma \in \mathsf { \Gamma } ( 0 , 1 ]$ , transition function $T ( s ^ { \prime } | s , { \bar { a } } )$ and a reward function $R ( s , a )$ . Actions $a$ have dimensionality $d _ { \mathcal { A } }$ . Value-based RL approaches learn a Q-function $Q ( s , a )$ representing the total discounted return $\begin{array} { r } { \sum _ { t } \gamma ^ { t } R ( s _ { t } , a _ { t } ) } \end{array}$ , with policy $\pi ( a | s ) =$ arg maxa $Q ( s , a )$ . The Q-function can be learned by iteratively applying the Bellman operator [67]:
38
+
39
+ $$
40
+ \mathcal { B } ^ { * } Q ( s _ { t } , a _ { t } ) = R ( s _ { t } , a _ { t } ) + \gamma \operatorname* { m a x } _ { a _ { t + 1 } } Q ( s _ { t + 1 } , a _ { t + 1 } ) ,
41
+ $$
42
+
43
+ approximated via function approximation and sampling. The offline RL setting assumes access to an offline dataset of transitions or episodes, produced by some unknown behavior policy $\pi _ { \beta } ( a | s )$ , but does not assume the ability to perform additional online interaction during training. This is appealing for real-world robotic learning, where on-policy data collection is time-consuming. Learning from offline datasets requires addressing distributional shift, since in general the action that maximizes $Q ( s _ { t + 1 } , a _ { t + 1 } )$ might lie outside of the data distribution. One approach to mitigate this is to add a conservative penalty [29, 52] that pushes down the Q-values $Q ( s , a )$ for any action $a$ outside of the dataset, thus ensuring that the maximum value action is in-distribution.
44
+
45
+ ![](images/66b914dead3ba20f12925e3d7db42b32bbe75dce7aa50d0d18bb162fd19fdb6e.jpg)
46
+ Figure 3: Q-Transformer network architecture, as applied to our multi-task language-conditioned robotic control setting. The encoding of the observations is concatenated with embeddings of the previous predicted action dimensions and processed by Transformer layers. We apply a sigmoid to the Transformer output to produce Q-values (normalized to lie in the range $[ 0 , 1 ] )$ for each of the action value bins. Finally, one-hot action vectors are constructed by taking the arg max over all bins and are fed back to the network to predict the Q-values of the next action dimensions. The language instruction is encoded with Universal Sentence Encoder [68] and then fed to FiLM EfficientNet [69, 70] network together with the robot camera images.
47
+
48
+ In this work, we consider tasks with sparse rewards, where a binary reward $R \in \{ 0 , 1 \}$ (indicating success or failure) is assigned at the last time step of episodes. Although our method is not specific to this setting, such reward structure is common in robotic manipulation tasks that either succeed or fail on each episode, and can be particularly challenging for RL due to the lack of reward shaping.
49
+
50
+ # 4 Q-Transformer
51
+
52
+ In this section, we introduce Q-Transformer, an architecture for offline Q-learning with Transformer models, which is based on three main ingredients. First, we describe how we apply discretization and autoregression to enable TD-learning with Transformer architectures. Next, we introduce a particular conservative Q-function regularizer that enables learning from offline datasets. Lastly, we show how Monte Carlo and $n$ -step returns can be used to improve learning efficiency.
53
+
54
+ # 4.1 Autoregressive Discrete Q-Learning
55
+
56
+ Using Transformers with Q-learning presents two challenges: (1) we must tokenize the inputs to effectively apply attention mechanisms, which requires discretizing the action space; (2) we must perform maximization of Q-values over discretized actions while avoiding the curse of dimensionality. Addressing these issues within the standard Q-learning framework requires new modeling decisions. The intuition behind our autoregressive Q-learning update is to treat each action dimension as essentially a separate time step. That way, we can discretize individual dimensions (1D quantities), rather than the entire action space, avoiding the curse of dimensionality. This can be viewed as a simplified version of the scheme proposed in [65], though we apply this to high-capacity Transformer models, extend it to the offline RL setting, and scale it up to real-world robotic learning.
57
+
58
+ Let $\tau = ( s _ { 1 } , a _ { 1 } , \dots , s _ { T } , a _ { T } )$ be a trajectory of robotic experience of length $T$ from an offline dataset $\mathcal { D }$ . For a given time-step $t$ , and the corresponding action $a _ { t }$ in the trajectory, we define a per-dimension view of the action $a _ { t }$ . Let $a _ { t } ^ { 1 : i }$ denote the vector of action dimensions from the first dimension $a _ { t } ^ { 1 }$ until the $i$ -th dimension $a _ { t } ^ { i }$ , where $i$ can range from 1 to the total number of action dimensions, that we denote as $d _ { \mathcal { A } }$ . Then, for a time window $w$ of state history, we define the Q-value of the action $a _ { t } ^ { i }$ in the $_ { i - t h }$ dimension using an autoregressive Q-function conditioned on states from this time window $s _ { t - w : t }$ and previous action dimensions for the current time step $a _ { t } ^ { 1 : i - 1 }$ . To train the Q-function, we define a per-dimension Bellman update. For all dimensions $i \in \{ \bar { 1 } , \ldots , d _ { A } \}$ :
59
+
60
+ $$
61
+ Q ( s _ { t - w : t } , a _ { t } ^ { 1 : i - 1 } , a _ { t } ^ { i } ) \gets \left\{ \begin{array} { l l } { \operatorname* { m a x } _ { a _ { t } ^ { i + 1 } } Q ( s _ { t - w : t } , a _ { t } ^ { 1 : i } , a _ { t } ^ { i + 1 } ) } & { \mathrm { i f ~ } i \in \{ 1 , \dots , d _ { A } - 1 \} } \\ { a _ { t } ^ { i + 1 } } & { \mathrm { ~ i f ~ } i \in \{ 1 , \dots , d _ { A } \} } \end{array} \right.
62
+ $$
63
+
64
+ The reward is only applied on the last dimension (second line in the equation), as we do not receive any reward before executing the whole action. In addition, we only discount Q-values between the time steps and keep discounting at 1.0 for all but the last dimension within each time step, to ensure the same discounting as in the original MDP. Figure 2 illustrates this process, where each yellow box represents the Q-target computation with additional conservatism and Monte Carlo returns described in the next subsections. It should be noted that by treating each action dimension as a time step for the Bellman update, we do not change the general optimization properties of Q-learning algorithms and the principle of the Bellman optimality still holds for a given MDP as we maximize over an action dimension given the optimality of all action dimensions in the future. We show that this approach provides a theoretically consistent way to optimize the original MDP in Appendix A, with a proof of convergence in the tabular setting in Appendix B.
65
+
66
+ # 4.2 Conservative Q-Learning with Transformers
67
+
68
+ Having defined a Bellman backup for running Q-learning with Transformers, we now develop a technique that enables learning from offline data, including human demonstrations and autonomously collected data. This typically requires addressing over-estimation due to the distributional shift, when the Q-function for the target value is queried at an action that differs from the one on which it was trained. Conservative Q-learning (CQL) [29] minimizes the Q-function on out-of-distribution actions, which can result in Q-values that are significantly smaller than the minimal possible cumulative reward that can be attained in any trajectory. When dealing with sparse rewards $R \in \{ 0 , 1 \}$ , results in [27] show that the Q-function regularized with a standard conservative objective can take on negative values, even though instantaneous rewards are all non-negative. This section presents a modified version of conservative Q-learning that addresses this issue in our problem setting.
69
+
70
+ The key insight behind our design is that, rather than minimizing the Q-values on actions not in the data, we can instead regularize these $\mathrm { Q }$ -values to be close to the minimal attainable possible cumulative reward. Concretely, denoting the minimal possible reward on the task as $R _ { \mathrm { m i n } }$ , and the time horizon of the task as $T$ , our approach regularizes the Q-values on actions not covered by the dataset towards $R _ { \operatorname* { m i n } } \cdot T$ , which in our problem setting is equal to 0 (i.e., $R _ { \mathrm { m i n } } = 0 .$ ). For simplicity of notation, we omit the action dimension indices in presenting the resulting objective, but remark that the training objective below is applied to Bellman backups on all action dimensions as described in the previous section. Let $\pi _ { \beta }$ be the behavioral policy that induced a given dataset $\mathcal { D }$ , and let $\begin{array} { r } { \tilde { \pi } _ { \beta } ( a | s ) = \frac { 1 } { Z ( s ) } \cdot ( 1 . 0 - \pi _ { \beta } ( a | \dot { s } ) ) } \end{array}$ be the distribution over all actions which have a very low density under $\pi _ { \beta } ( a | s )$ . Our objective to train the Q-function is:
71
+
72
+ $$
73
+ J = \ \frac { 1 } { 2 } \underbrace { \mathbb { E } _ { s \sim \mathcal { D } , a \sim \pi _ { \beta } ( a | s ) } \left[ \left( Q ( s , a ) - B ^ { * } Q ^ { k } ( s , a ) \right) ^ { 2 } \right] } _ { ( i ) , \mathrm { ~ I D ~ e r r o r } } + \alpha \cdot \frac { 1 } { 2 } \underbrace { \mathbb { E } _ { s \sim \mathcal { D } , a \sim \pi _ { \beta } ( a | s ) } \left[ \left( Q ( s , a ) - 0 \right) ^ { 2 } \right] } _ { ( i i ) , \mathrm { ~ c o n s e r v a t i v e ~ r e g u l a r i z a t i o n ~ } \mathcal { L } _ { C } } ,
74
+ $$
75
+
76
+ where the first term $( i )$ trains the Q-function by minimizing the temporal difference error objective as defined in Eq. 1, and the second term $( i i )$ regularizes the $\mathbf { Q }$ -values to the minimal possible $\mathrm { Q }$ - value of 0 in expectation under the distribution of actions induced by $\tilde { \pi } _ { \beta }$ , which we denote as a conservative regularization term $\mathcal { L } _ { C }$ . Term $( i i )$ is also weighted by a multiplier $\alpha$ , which modulates the strength of this conservative regularization. We discuss the choice of $\alpha$ in our implementation in Appendix D.2 and analyze the behavior of the conservatism term in Appendix C, providing a simple characterization of how this regularizer modifies the learned Q-function in tabular settings.
77
+
78
+ # 4.3 Improving Learning Efficiency with Monte Carlo and $n$ -step Returns
79
+
80
+ When the dataset contains some good trajectories (e.g., demonstrations) and some suboptimal trajectories (e.g., autonomously collected trials), utilizing Monte Carlo return-to-go estimates to accelerate Q-learning can lead to significant performance improvements, as the Monte Carlo estimates along the better trajectories lead to much faster value propagation. This has also been observed in prior work [31]. Based on this observation, we propose a simple improvement to Q-Transformer that we found to be quite effective in practice. The Monte Carlo return is defined by the cumulative reward within the offline trajectory $\begin{array} { r } { \tau \colon \mathbf { M } \mathbf { C } _ { t : T } = \sum _ { j = t } ^ { T } \gamma ^ { j - t } R ( s _ { j } , a _ { j } ) } \end{array}$ . This matches the Q-value of the behavior policy $\pi _ { \beta }$ , and since the optimal $Q ^ { * } ( s , a )$ is larger than the Q-value for any other policy, we have $Q ^ { * } ( s _ { t } , a _ { t } ) \geq \mathbf { M } \mathbf { C } _ { t : T }$ . Since the Monte Carlo return is a lower bound of the optimal Q-function, we can augment the Bellman update to take the maximum between the MC-return and the current Q-value: max $( \mathbf { M } \mathbf { C } _ { t : T } , Q ( s _ { t } , a _ { t } \mathbf { \bar { ) } } )$ , without changing what the Bellman update will converge to.
81
+
82
+ ![](images/f92bdbe0b51c194ecf6f9283f428c517cca501a702b0252001d60139f983a236.jpg)
83
+ Figure 4: Left: Real world manipulation tasks. Right: Real world performance comparison. RT-1 [1] is imitation learning on demonstrations. Q-Transformer (Q-T), Decision Transformer (DT) [32], Implicit Q-learning (IQL) [40] learn from both demonstrations and autonomous data.
84
+
85
+ Although this does not change convergence, including this maximization speeds up learning (see Section 5.3). We present a hypothesis why this occurs. In practice, $\mathrm { Q }$ -values for final timesteps $( s _ { T } , a _ { T } )$ are learned first and then propagated backwards in future gradient steps. It can take multiple gradients for the Q-value to propagate all the way to $( s _ { 1 } , a _ { 1 } )$ . The $\operatorname* { m a x } ( \mathbf { M C } , Q )$ allows us to apply useful gradients to $Q ( s _ { 1 } , a _ { 1 } )$ at the start of training before the $\mathbf { Q }$ -values have propagated.
86
+
87
+ In our experiments, we also notice that additionally employing $n$ -step returns [71, 72] over action dimensions can significantly help with the learning speed. We pick $n$ such that the final Q-value of the last dimension of the next time step is used as the Q-target. This is because we get a new state and reward only after inferring and executing the whole action as opposed to parts of it, meaning that intermediate rewards remain 0 all the way until the last action dimension. While this introduces bias to the Bellman backups, as is always the case with off-policy learning with $n$ -step returns, we find in our ablation study in Section 5.3 that the detrimental effects of this bias are small, while the speedup in training is significant. This is consistent with previously reported results [72]. More details about our Transformer sequence model architecture (depicted in Figure 3) conservative Qlearning implementation, and the robot system can be found in Appendix D.
88
+
89
+ # 5 Experiments
90
+
91
+ In our experiments, we aim to answer the following questions: (1) Can Q-Transformer learn from a combination of demonstrations and sub-optimal data? (2) How does Q-Transformer compare to other methods? (3) How important are the specific design choices in Q-Transformer? (4) Can QTransformer be applied to large-scale real world robotic manipulation problems?
92
+
93
+ # 5.1 Real-world language-conditioned manipulation evaluation
94
+
95
+ Training dataset. The offline data used in our experiments was collected with a fleet of 13 robots, and consists of a subset of the demonstration data described by Brohan et al. [1], combined with lower quality autonomously collected data. The demonstrations were collected via human teleoperation for over 700 distinct tasks, each with a separate language description. We use a maximum of 100 demonstrations per task, for a total of about 38,000 demonstrations. All of these demonstrations succeed on their respective tasks and receive a reward of 1.0. The rest of the dataset was collected by running the robots autonomously, executing policies learned via behavioral cloning.
96
+
97
+ To ensure a fair comparison between Q-Transformer and imitation learning methods, we discard all successful episodes in the autonomously collected data when we train our method, to ensure that by including the autonomous data the Q-Transformer does not get to observe more successful trials than the imitation learning baselines. This leaves us with about 20,000 additional autonomously collected failed episodes, each with a reward of 0.0, for a dataset size of about 58,000 episodes. The episodes are on average 35 time steps in length. Examples of the tasks are shown in Figure 4.
98
+
99
+ Performance evaluation. To evaluate how well Q-Transformer can perform when learning from real-world offline datasets while effectively incorporating autonomously collected failed episodes, we evaluate Q-Transformer on 72 unique manipulation tasks, and a variety of different skills, such as “drawer pick and place”, “open and close drawer”, “move object near target”, each consisting of 18, 7 and 48 unique tasks instructions respectively to specify different object combinations and drawers. As such, the average success rate in Table 4 is the average over 72 tasks.
100
+
101
+ Since each task in the training set only has a maximum of 100 demonstrations, we observe from Figure 4 that an imitation learning algorithm like RT-1 [1], which also uses a similar Transformer architecture, struggles to obtain a good performance when learning from only the limited pool of successful robot demonstrations. Existing offline RL methods, such as IQL [40] and a Transformerbased method such as Decision Transformer [32], can learn from both successful demonstrations and failed episodes, and show better performance compared to RT-1, though by a relatively small margin. Q-Transformer has the highest success rate and outperforms both the behavior cloning baseline (RT-1) and offline RL baselines (Decision Transformer, IQL), exceeding the average performance of the best-performing prior method by about $70 \%$ . This demonstrates that Q-Transformer can effectively improve upon human demonstrations using autonomously collected sub-optimal data.
102
+
103
+ Appendix G also shows that Q-Transformer can be successfully applied in combination with a recently proposed language task planner [8] to perform both affordance estimation and robot action execution. Q-Transformer outperforms prior methods for planning and executing long-horizon tasks.
104
+
105
+ # 5.2 Benchmarking in simulation
106
+
107
+ In this section, we evaluate Q-Transformer on a challenging simulated offline RL task that require incorporating sub-optimal data to solve the task. In particular, we use a visual simulated picking task depicted in Figure 5, where we have a small amount of position controlled human demonstrations ${ \sim } 8 \%$ of the data). The demonstrations are replayed with noise to generate more trajectories ( ${ \sim } 9 2 \%$ of the data). Figure 5 shows a comparison to several offline algorithms, such as QT-Opt with CQL [11, 29], IQL [40], AW-Opt [73], and Decision Transformer [32], along with RT-1 using Behavioral Cloning [1] on demonstrations only. As we see, algorithms that can effectively perform TDlearning to combine optimal and sub-optimal data (such as Q-Transformer and QT-Opt) perform better than others. BC with RT-1 is not
108
+
109
+ ![](images/a2c99c10cf55b4c6ab22b7a5b8fd317dcfb759dd2644215d5fd65744698b5e1f.jpg)
110
+ Figure 5: Performance comparison on a simulated picking task.
111
+
112
+ able to take advantage of sub-optimal data. Decision Transformer is trained on both demonstrations and sub-optimal data, but is not able to leverage the noisy data for policy improvement and does not end up performing as well as our method. Although IQL and AW-Opt perform TD-learning, the actor remains too close to the data and can not fully leverage the sub-optimal data. Q-Transformer is able to both bootstrap the policy from demonstrations and also quickly improve through propagating information with TD-learning. We also analyze the statistical significance of the results by training with multiple random seeds in Appendix F.
113
+
114
+ # 5.3 Ablations
115
+
116
+ We perform a series of ablations of our method design choices in simulation, with results presented in Figure 6 (left). First, we demonstrate that our choice of conservatism for Q-Transformer performs better than the standard CQL regularizer, which corresponds to a softmax layer on top of the Q-function outputs with a cross-entropy loss between the dataset action and the output of this softmax [29]. This regularizer plays a similar role to the one we propose, decreasing the Q-values for out-of-distribution actions and staying closer to the behavior policy.
117
+
118
+ As we see in Figure 6 (left), performance with softmax conservatism drops to around the fraction of demonstration episodes $( \sim 8 \% )$ . This suggests a collapse to the behavior policy as the conservatism penalty becomes too good at constraining to the behavior policy distribution. Due to the nature of the softmax, pushing Q-values down for unobserved actions also pushes Q-values up for the observed actions, and we theorize this makes it difficult to keep Q-values low for sub-optimal in-distribution actions that fail to achieve high reward. Next, we show that using conservatism is important. When removing conservatism entirely, we observe that performance collapses. Actions that are rare in the dataset will have overestimated Q-values, since they are not trained by the offline Q-learning procedure. The resulting overestimated values will propagate and collapse the entire Q-function, as described in prior work [38]. Finally, we ablate the Monte-Carlo returns and again observe performance collapse. This demonstrates that adding information about the sampled future returns significantly helps in bootstrapping the training of large architectures such as Transformers.
119
+
120
+ ![](images/1eba88ec9249b5b4812bc607c8926c1418975b18085015c1bc5e30d4d2d5bc77.jpg)
121
+ Figure 6: Left: Ablations: changing to softmax conservatism decreases performance. Removing MC returns or conservatism completely collapse performance. Top Right: The $n$ -step return version of our method reaches similar performance to the standard version with 4 times fewer steps, indicating that the added bias from $n$ -step returns is small compared to the gain in training speed. Using $n$ -step return also leads to better performance on tasks that have longer horizon, e.g. move object near target. Bottom Right: Success rates on real world task categories with a larger dataset.
122
+
123
+ <table><tr><td>n-step ablation</td><td>n-step 1-step</td><td>1-step</td></tr><tr><td># of gradient steps Training duration (hours)</td><td>137480 582960 32 163</td><td>136920 40</td></tr><tr><td>pick object move object near target</td><td>94% 88%</td><td>97% 92% 80% 67%</td></tr><tr><td>Large offline dataset</td><td>Q-T DT</td><td>RT-1</td></tr><tr><td>Average success rate</td><td>88% 78%</td><td>82%</td></tr></table>
124
+
125
+ We also ablate the choice of $n$ -step returns from the Section 4.3 on real robots and observe that using $n$ -step returns leads to a significantly faster training speed as measured by the number of gradient steps and wall clock time compared to using 1-step returns, with a minimal loss in performance, as shown in Figure 6 (top right).
126
+
127
+ # 5.4 Massively scaling up Q-Transformer
128
+
129
+ The experiments in the previous section used a large dataset that included successful demonstrations and failed autonomous trials, comparable in size to some of the largest prior experiments that utilized demonstration data [74, 15, 58]. We also carry out a preliminary experiment with a much larger dataset to investigate the performance of Q-Transformer as we scale up the dataset size.
130
+
131
+ This experiment includes all of the data collected with 13 robots and comprises of the demonstrations used by RT-1 [1] and successful autonomous episodes, corresponding to about 115,000 successful trials, and an additional 185,000 failed autonomous episodes, for a total dataset size of about 300,000 trials. Model architecture and hyperparameters were kept exactly the same, as the computational cost of the experiment made further hyperparameter tuning prohibitive (in fact, we only train the models once). Note that with this number of successful demonstrations, even standard imitation learning with the RT-1 architecture already performs very well, attaining $82 \%$ success rate. However, as shown in Figure 6 (bottom right), Q-Transformer was able to improve even on this very high number. This experiment demonstrates that Q-Transformer can continue to scale to extremely large dataset sizes, and continues to outperform both imitation learning with RT-1 and Decision Transformer.
132
+
133
+ # 6 Limitations and Discussion
134
+
135
+ In this paper, we introduced the Q-Transformer, an architecture for offline reinforcement learning with high-capacity Transformer models that is suitable for large-scale multi-task robotic RL. Our framework does have several limitations. First, we focus on sparse binary reward tasks corresponding to success or failure for each trial. While this setup is reasonable for a broad range of episodic robotic manipulation problems, it is not universal, and we expect that Q-Transformer could be extended to more general settings as well in the future.
136
+
137
+ Second, the per-dimension action discretization scheme that we employ may become more cumbersome in higher dimensions (e.g., controlling a humanoid robot), as the sequence length and inference time for our model increases with action dimensionality. Although $n$ -step returns mitigate this to a degree, the length of the sequences still increases with action dimensionality. For such higherdimensional action space, adaptive discretization methods might also be employed, for example by training a discrete autoencoder model and reducing representation dimensionality. Uniform action discretization can also pose problems for manipulation tasks that require a large range of motion granularities, e.g. both coarse and fine movements. In this case, adaptive discretization based on the distribution of actions could be used for representing both types of motions.
138
+
139
+ Finally, in this work we concentrated on the offline RL setting. However, extending Q-Transformer to online finetuning is an exciting direction for future work that would enable even more effective autonomous improvement of complex robotic policies.
140
+
141
+ References
142
+ [1] A. Brohan, N. Brown, J. Carbajal, Y. Chebotar, J. Dabis, C. Finn, K. Gopalakrishnan, K. Hausman, A. Herzog, J. Hsu, et al. Rt-1: Robotics transformer for real-world control at scale. arXiv preprint arXiv:2212.06817, 2022.
143
+ [2] Y. Jiang, A. Gupta, Z. Zhang, G. Wang, Y. Dou, Y. Chen, L. Fei-Fei, A. Anandkumar, Y. Zhu, and L. Fan. Vima: General robot manipulation with multimodal prompts. arXiv preprint arXiv:2210.03094, 2022.
144
+ [3] A. Gupta, L. Fan, S. Ganguli, and L. Fei-Fei. Metamorph: Learning universal controllers with transformers. arXiv preprint arXiv:2203.11931, 2022.
145
+ [4] M. Shridhar, L. Manuelli, and D. Fox. Perceiver-actor: A multi-task transformer for robotic manipulation. arXiv preprint arXiv:2209.05451, 2022.
146
+ [5] N. M. M. Shafiullah, Z. J. Cui, A. Altanzaya, and L. Pinto. Behavior transformers: Cloning $k$ modes with one stone. arXiv preprint arXiv:2206.11251, 2022.
147
+ [6] S. Reed, K. Zolna, E. Parisotto, S. G. Colmenarejo, A. Novikov, G. Barth-Maron, M. Gimenez, Y. Sulsky, J. Kay, J. T. Springenberg, et al. A generalist agent. arXiv preprint arXiv:2205.06175, 2022.
148
+ [7] M. Shridhar, L. Manuelli, and D. Fox. Cliport: What and where pathways for robotic manipulation. In Proceedings of the 5th Conference on Robot Learning (CoRL), 2021.
149
+ [8] M. Ahn, A. Brohan, N. Brown, Y. Chebotar, O. Cortes, B. David, C. Finn, K. Gopalakrishnan, K. Hausman, A. Herzog, et al. Do as I can, not as I say: Grounding language in robotic affordances. arXiv preprint arXiv:2204.01691, 2022.
150
+ [9] D.-A. Huang, Y.-W. Chao, C. Paxton, X. Deng, L. Fei-Fei, J. C. Niebles, A. Garg, and D. Fox. Motion reasoning for goal-based imitation learning. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 4878–4884. IEEE, 2020.
151
+ [10] D. Shah, A. Sridhar, A. Bhorkar, N. Hirose, and S. Levine. Gnm: A general navigation model to drive any robot. arXiv preprint arXiv:2210.03370, 2022.
152
+ [11] D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, E. Jang, D. Quillen, E. Holly, M. Kalakrishnan, V. Vanhoucke, et al. Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, pages 651–673. PMLR, 2018.
153
+ [12] A. X. Lee, C. M. Devin, Y. Zhou, T. Lampe, K. Bousmalis, J. T. Springenberg, A. Byravan, A. Abdolmaleki, N. Gileadi, D. Khosid, et al. Beyond pick-and-place: Tackling robotic stacking of diverse shapes. In 5th Annual Conference on Robot Learning, 2021.
154
+ [13] S. Cabi, S. G. Colmenarejo, A. Novikov, K. Konyushkova, S. Reed, R. Jeong, K. Zolna, Y. Aytar, D. Budden, M. Vecerik, et al. Scaling data-driven robotics with reward sketching and batch reinforcement learning. arXiv preprint arXiv:1909.12200, 2019.
155
+ [14] D. Kalashnikov, J. Varley, Y. Chebotar, B. Swanson, R. Jonschkowski, C. Finn, S. Levine, and K. Hausman. MT-opt: Continuous multi-task robotic reinforcement learning at scale. arXiv, 2021.
156
+ [15] A. Kumar, A. Singh, F. Ebert, Y. Yang, C. Finn, and S. Levine. Pre-training for robots: Offline rl enables learning new tasks from a handful of trials. arXiv preprint arXiv:2210.05178, 2022.
157
+ [16] L. P. Kaelbling. Learning to achieve goals. In R. Bajcsy, editor, IJCAI, pages 1094–1099. Morgan Kaufmann, 1993. ISBN 1-55860-300-X.
158
+ [17] Y. Chebotar, K. Hausman, Y. Lu, T. Xiao, D. Kalashnikov, J. Varley, A. Irpan, B. Eysenbach, R. Julian, C. Finn, et al. Actionable models: Unsupervised offline reinforcement learning of robotic skills. arXiv preprint arXiv:2104.07749, 2021.
159
+ [18] T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. In F. Bach and D. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1312–1320, Lille, France, 07–09 Jul 2015. PMLR.
160
+ [19] M. Andrychowicz, D. Crow, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems, pages 5048–5058, 2017.
161
+ [20] K. Fang, A. Toshev, L. Fei-Fei, and S. Savarese. Scene memory transformer for embodied agents in long-horizon tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 538–547, 2019.
162
+ [21] P. Anderson, A. X. Chang, D. S. Chaplot, A. Dosovitskiy, S. Gupta, V. Koltun, J. Kosecka, J. Malik, R. Mottaghi, M. Savva, and A. R. Zamir. On evaluation of embodied navigation agents. CoRR, abs/1807.06757, 2018. URL http://dblp.uni-trier.de/db/ journals/corr/corr1807.html#abs-1807-06757.
163
+ [22] P. Anderson, Q. Wu, D. Teney, J. Bruce, M. Johnson, N. Sunderhauf, I. D. Reid, S. Gould, ¨ and A. van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. CoRR, abs/1711.07280, 2017. URL http: //arxiv.org/abs/1711.07280.
164
+ [23] P. Mirowski, R. Pascanu, F. Viola, H. Soyer, A. J. Ballard, A. Banino, M. Denil, R. Goroshin, L. Sifre, K. Kavukcuoglu, D. Kumaran, and R. Hadsell. Learning to navigate in complex environments. CoRR, abs/1611.03673, 2016. URL http://dblp.uni-trier.de/db/ journals/corr/corr1611.html#MirowskiPVSBBDG16.
165
+ [24] Y. Zhu, R. Mottaghi, E. Kolve, J. J. Lim, A. Gupta, L. Fei-Fei, and A. Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In ICRA, pages 3357– 3364. IEEE, 2017. ISBN 978-1-5090-4633-1. URL http://dblp.uni-trier.de/db/ conf/icra/icra2017.html#ZhuMKLGFF17.
166
+ [25] T. Yu, D. Quillen, Z. He, R. Julian, K. Hausman, C. Finn, and S. Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on robot learning, pages 1094–1100. PMLR, 2020.
167
+ [26] J. Fu, A. Kumar, O. Nachum, G. Tucker, and S. Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
168
+ [27] A. Kumar, A. Singh, S. Tian, C. Finn, and S. Levine. A workflow for offline model-free robotic reinforcement learning. arXiv preprint arXiv:2109.10813, 2021.
169
+ [28] R. S. Sutton and A. G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981.
170
+ [29] A. Kumar, A. Zhou, G. Tucker, and S. Levine. Conservative q-learning for offline reinforcement learning. Advances in Neural Information Processing Systems, 33:1179–1191, 2020.
171
+ [30] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
172
+ [31] A. Wilcox, A. Balakrishna, J. Dedieu, W. Benslimane, D. S. Brown, and K. Goldberg. Monte carlo augmented actor-critic for sparse reward deep reinforcement learning from suboptimal demonstrations. In A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum? id=FLzTj4ia8BN.
173
+ [32] L. Chen, K. Lu, A. Rajeswaran, K. Lee, A. Grover, M. Laskin, P. Abbeel, A. Srinivas, and I. Mordatch. Decision transformer: Reinforcement learning via sequence modeling. Advances in neural information processing systems, 34:15084–15097, 2021.
174
+ [33] K.-H. Lee, O. Nachum, M. Yang, L. Lee, D. Freeman, W. Xu, S. Guadarrama, I. Fischer, E. Jang, H. Michalewski, et al. Multi-game decision transformers. arXiv preprint arXiv:2205.15241, 2022.
175
+ [34] N. Jaques, A. Ghandeharioun, J. H. Shen, C. Ferguson, A. Lapedriza, N. Jones, S. Gu, and R. Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
176
+ [35] Y. Wu, G. Tucker, and O. Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
177
+ [36] X. B. Peng, A. Kumar, G. Zhang, and S. Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019.
178
+ [37] N. Y. Siegel, J. T. Springenberg, F. Berkenkamp, A. Abdolmaleki, M. Neunert, T. Lampe, R. Hafner, and M. Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020.
179
+ [38] A. Kumar, J. Fu, M. Soh, G. Tucker, and S. Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, pages 11761–11771, 2019.
180
+ [39] I. Kostrikov, J. Tompson, R. Fergus, and O. Nachum. Offline reinforcement learning with fisher divergence critic regularization. arXiv preprint arXiv:2103.08050, 2021.
181
+ [40] I. Kostrikov, A. Nair, and S. Levine. Offline reinforcement learning with implicit q-learning. arXiv preprint arXiv:2110.06169, 2021.
182
+ [41] Z. Wang, A. Novikov, K. Zołna, J. T. Springenberg, S. Reed, B. Shahriari, N. Siegel, J. Merel, ˙ C. Gulcehre, N. Heess, et al. Critic regularized regression. arXiv preprint arXiv:2006.15134, 2020.
183
+ [42] S. Fujimoto and S. S. Gu. A minimalist approach to offline reinforcement learning. arXiv preprint arXiv:2106.06860, 2021.
184
+ [43] X. Chen, Z. Zhou, Z. Wang, C. Wang, Y. Wu, and K. Ross. Bail: Best-action imitation learning for batch deep reinforcement learning, 2019. URL https://arxiv.org/abs/1910. 12179.
185
+ [44] H. Furuta, Y. Matsuo, and S. S. Gu. Generalized decision transformer for offline hindsight information matching. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $=$ CAjxVodl_v.
186
+ [45] Y. Jang, J. Lee, and K.-E. Kim. GPT-critic: Offline reinforcement learning for end-to-end taskoriented dialogue systems. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ qaxhBG1UUaS.
187
+ [46] L. Meng, M. Wen, Y. Yang, chenyang le, X. yun Li, H. Zhang, Y. Wen, W. Zhang, J. Wang, and B. XU. Offline pre-trained multi-agent decision transformer, 2022. URL https:// openreview.net/forum?id=W08IqLMlMer.
188
+ [47] P. Daoudi, M. Barlier, L. D. Santos, and A. Virmaux. Density estimation for conservative q-learning, 2022. URL https://openreview.net/forum?id $=$ liV-Re74fK.
189
+ [48] L. Liu, Z. Tang, L. Li, and D. Luo. Robust imitation learning from corrupted demonstrations, 2022. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ UECzHrGio7i.
190
+ [49] A. Mandlekar, D. Xu, J. Wong, S. Nasiriany, C. Wang, R. Kulkarni, F.-F. Li, S. Savarese, Y. Zhu, and R. Mart´ın-Mart´ın. What matters in learning from offline human demonstrations for robot manipulation. In 5th Annual Conference on Robot Learning, 2021. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ JrsfBJtDFdI.
191
+ [50] A. Kumar, J. Hong, A. Singh, and S. Levine. When should we prefer offline reinforcement learning over behavioral cloning? arXiv preprint arXiv:2204.05618, 2022.
192
+ [51] A. Singh, A. Kumar, Q. Vuong, Y. Chebotar, and S. Levine. Offline rl with realistic datasets: Heteroskedasticity and support constraints. arXiv preprint arXiv:2211.01052, 2022.
193
+ [52] Q. Vuong, A. Kumar, S. Levine, and Y. Chebotar. DASCO: Dual-generator adversarial support constrained offline reinforcement learning. In A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id ${ . } = { }$ jBTQGGy9qA-.
194
+ [53] J. Li, X. Zhan, H. Xu, X. Zhu, J. Liu, and Y.-Q. Zhang. Distance-sensitive offline reinforcement learning. arXiv preprint arXiv:2205.11027, 2022.
195
+ [54] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
196
+ [55] Y. Zhang and J. Chai. Hierarchical task learning from language instructions with unified transformers and self-monitoring. arXiv preprint arXiv:2106.03427, 2021.
197
+ [56] A. Pashevich, C. Schmid, and C. Sun. Episodic transformer for vision-and-language navigation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 15942–15952, 2021.
198
+ [57] A. Silva, N. Moorman, W. Silva, Z. Zaidi, N. Gopalan, and M. Gombolay. Lancon-learn: Learning with language to enable generalization in multi-task manipulation. IEEE Robotics and Automation Letters, 7(2):1635–1642, 2021.
199
+ [58] E. Jang, A. Irpan, M. Khansari, D. Kappler, F. Ebert, C. Lynch, S. Levine, and C. Finn. Bc-z: Zero-shot task generalization with robotic imitation learning. In Conference on Robot Learning, pages 991–1002. PMLR, 2021.
200
+ [59] S. Nair, E. Mitchell, K. Chen, S. Savarese, C. Finn, et al. Learning language-conditioned robot behavior from offline data and crowd-sourced annotation. In Conference on Robot Learning, pages 1303–1315. PMLR, 2022.
201
+ [60] M. Janner, Q. Li, and S. Levine. Reinforcement learning as one big sequence modeling problem. In ICML 2021 Workshop on Unsupervised Reinforcement Learning, 2021.
202
+ [61] A. Kumar, X. B. Peng, and S. Levine. Reward-conditioned policies. arXiv preprint arXiv:1912.13465, 2019.
203
+ [62] R. K. Srivastava, P. Shyam, F. Mutz, W. Jaskowski, and J. Schmidhuber. Training agents using ´ upside-down reinforcement learning. arXiv preprint arXiv:1912.02877, 2019.
204
+ [63] D. Brandfonbrener, A. Bietti, J. Buckman, R. Laroche, and J. Bruna. When does returnconditioned supervised learning work for offline reinforcement learning? arXiv preprint arXiv:2206.01079, 2022.
205
+ [64] T. Yamagata, A. Khalil, and R. Santos-Rodriguez. Q-learning decision transformer: Leveraging dynamic programming for conditional sequence modelling in offline rl, 2023.
206
+ [65] L. Metz, J. Ibarz, N. Jaitly, and J. Davidson. Discrete sequential prediction of continuous actions for deep rl. CoRR, abs/1705.05035, 2017. URL http://dblp.uni-trier.de/ db/journals/corr/corr1705.html#MetzIJD17.
207
+ [66] S. Hochreiter and J. Schmidhuber. Long Short-Term Memory. 9(8):1735–1780, 1997.
208
+ [67] R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. Second edition, 2018.
209
+ [68] D. Cer, Y. Yang, S.-y. Kong, N. Hua, N. Limtiaco, R. S. John, N. Constant, M. GuajardoCespedes, S. Yuan, C. Tar, et al. Universal sentence encoder. arXiv preprint arXiv:1803.11175, 2018.
210
+ [69] E. Perez, F. Strub, H. De Vries, V. Dumoulin, and A. Courville. Film: Visual reasoning with a general conditioning layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
211
+ [70] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pages 6105–6114. PMLR, 2019.
212
+ [71] R. S. Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9–44, 1988.
213
+ [72] M. Hessel, J. Modayil, H. Van Hasselt, T. Schaul, G. Ostrovski, W. Dabney, D. Horgan, B. Piot, M. Azar, and D. Silver. Rainbow: Combining improvements in deep reinforcement learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
214
+ [73] Y. Lu, K. Hausman, Y. Chebotar, M. Yan, E. Jang, A. Herzog, T. Xiao, A. Irpan, M. Khansari, D. Kalashnikov, and S. Levine. Aw-opt: Learning robotic skills with imitation andreinforcement at scale. In 5th Annual Conference on Robot Learning, 2021.
215
+ [74] S. Dasari and A. Gupta. Transformers for one-shot visual imitation. In Conference on Robot Learning, pages 2071–2084. PMLR, 2021.
216
+ [75] C. J. Watkins and P. Dayan. Q-learning. Machine Learning, 8:279–292, 1992.
217
+ [76] T. Xiao, E. Jang, D. Kalashnikov, S. Levine, J. Ibarz, K. Hausman, and A. Herzog. Thinking while moving: Deep reinforcement learning with concurrent control. arXiv preprint arXiv:2004.06089, 2020.
218
+ [77] A. Chowdhery, S. Narang, J. Devlin, M. Bosma, G. Mishra, A. Roberts, P. Barham, H. W. Chung, C. Sutton, S. Gehrmann, P. Schuh, K. Shi, S. Tsvyashchenko, J. Maynez, A. Rao, P. Barnes, Y. Tay, N. Shazeer, V. Prabhakaran, E. Reif, N. Du, B. Hutchinson, R. Pope, J. Bradbury, J. Austin, M. Isard, G. Gur-Ari, P. Yin, T. Duke, A. Levskaya, S. Ghemawat, S. Dev, H. Michalewski, X. Garcia, V. Misra, K. Robinson, L. Fedus, D. Zhou, D. Ippolito, D. Luan, H. Lim, B. Zoph, A. Spiridonov, R. Sepassi, D. Dohan, S. Agrawal, M. Omernick, A. M. Dai, T. S. Pillai, M. Pellat, A. Lewkowycz, E. Moreira, R. Child, O. Polozov, K. Lee, Z. Zhou, X. Wang, B. Saeta, M. Diaz, O. Firat, M. Catasta, J. Wei, K. Meier-Hellstern, D. Eck, J. Dean, S. Petrov, and N. Fiedel. Palm: Scaling language modeling with pathways, 2022. URL https://arxiv.org/abs/2204.02311.
219
+
220
+ # A Proof of MDP optimization consistency
221
+
222
+ To show that transforming MDP into a per-action-dimension form still ensures optimization of the original MDP, we show that optimizing the Q-function for each action dimension is equivalent to optimizing the Q-function for the full action.
223
+
224
+ If we consider the full action $a _ { 1 : d _ { \mathcal { A } } }$ and that we switch to the state $s ^ { \prime }$ at the next timestep, the Qfunction for optimizing over the full action MDP would be:
225
+
226
+ $$
227
+ \begin{array} { r l } & { \underset { a _ { 1 : d _ { \cal A } } } { \operatorname* { m a x } } Q ( s , a _ { 1 : d _ { \cal A } } ) = \underset { a _ { 1 : d _ { \cal A } } } { \operatorname* { m a x } } \left[ R ( s , a _ { 1 : d _ { \cal A } } ) + \gamma \underset { a _ { 1 : d _ { \cal A } } } { \operatorname* { m a x } } Q ( s ^ { \prime } , a _ { 1 : d _ { \cal A } } ) \right] } \\ & { \quad \quad \quad \quad = R ( s , a _ { 1 : d _ { \cal A } } ^ { * } ) + \gamma \underset { a _ { 1 : d _ { \cal A } } } { \operatorname* { m a x } } Q ( s ^ { \prime } , a _ { 1 : d _ { \cal A } } ) , } \end{array}
228
+ $$
229
+
230
+ where $R ( s , a _ { 1 : d _ { A } } ^ { * } )$ is the reward we get after executing the full action.
231
+
232
+ The optimization over each action dimension using our Bellman update is:
233
+
234
+ $$
235
+ \begin{array} { r l } { \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \delta , \epsilon } ^ { \star } , \eta _ { \epsilon } \in \mathcal { G } _ { \epsilon - 1 } \sim \mathcal { G } _ { \epsilon } ^ { \star } } } & { = - \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon } ^ { \star } \cup \mathcal { G } _ { \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon } ^ { \star } } } \\ & { = \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon } ^ { \star } \cup \mathcal { G } _ { \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon + 1 , \epsilon - 1 } } } \\ & { = \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon } ^ { \star } \cup \mathcal { G } _ { \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & { - \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { F } _ { \epsilon } \cup \mathcal { G } _ { \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & { - \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { F } _ { \epsilon } \cap \mathcal { G } _ { \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & { - \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon + 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & { - \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon + 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & { = \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon + 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } + \operatorname* { m a x } _ { \mathbf { x } \in \mathcal { G } _ { \epsilon + 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 , \epsilon - 1 } } } \\ & - \operatorname* { m a x } _ \ \end{array}
236
+ $$
237
+
238
+ which optimizes the original full action MDP as in Eq. 3.
239
+
240
+ # B Proof of convergence
241
+
242
+ Convergence of Q-learning has been shown in the past [67, 75]. Below we demonstrate that per-action dimension Q-function converges as well, by providing a proof almost identical to the standard $\mathrm { Q }$ -learning convergence proof, but extended to account for the per-action dimension maximization.
243
+
244
+ Let $d _ { \mathcal { A } }$ be the dimensionality of the action space, $a$ indicates a possible sequence of actions, whose dimension is not necessarily equal to the dimension of the action space. That is:
245
+
246
+ $$
247
+ a \in \{ a _ { 1 : i } , \forall i \leq d _ { A } \}
248
+ $$
249
+
250
+ To proof convergence, we can demonstrate that the Bellman operator applied to the per-action dimension Q-function is a contraction, i.e.:
251
+
252
+ $$
253
+ | | \mathcal { B } ^ { * } Q _ { 1 } ( s , a ) - \mathcal { B } ^ { * } Q _ { 2 } ( s , a ) | | _ { \infty } \leq c | | Q _ { 1 } ( s , a ) - Q _ { 2 } ( s , a ) | | _ { \infty } ,
254
+ $$
255
+
256
+ where
257
+
258
+ $$
259
+ B ^ { \ast } Q ( s , a ) = \left\{ \begin{array} { l l } { R ( s , a ) + \gamma \displaystyle \operatorname* { m a x } _ { a ^ { \prime } } Q ( s , a , a ^ { \prime } ) } & { \mathrm { i f ~ t h e ~ d i m e n s i o n ~ o f ~ } a \mathrm { ~ i s ~ l e s s ~ t h a n ~ } d \mathcal { A } } \\ { R ( s , a ) + \gamma \displaystyle \operatorname* { m a x } _ { a ^ { \prime } } \frac { E } { s ^ { \prime } } [ Q ( s ^ { \prime } , a ^ { \prime } ) ] } & { \mathrm { i f ~ t h e ~ d i m e n s i o n ~ o f ~ } a \mathrm { ~ i s ~ e q u a l ~ t o ~ } d \mathcal { A } } \end{array} \right.
260
+ $$
261
+
262
+ $a ^ { \prime }$ is the next action dimension following the sequence $a , s ^ { \prime }$ is the next state of the MDP, $\gamma$ is the discounting factor, and $0 \leq c \leq 1$ .
263
+
264
+ Proof: We can show that this is the case as follows:
265
+
266
+ Case 1: For action sequence whose dimension is less than the dimension of the action space.
267
+
268
+ $$
269
+ \begin{array} { r l } & { \mathcal { B } ^ { * } Q _ { 1 } ( s , a ) - \mathcal { B } ^ { * } Q _ { 2 } ( s , a ) } \\ & { \quad = R ( s , a ) + \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { 1 } ( s , a , a ^ { \prime } ) - R ( s , a ) - \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { 2 } ( s , a , a ^ { \prime } ) } \\ & { \quad = \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } [ Q _ { 1 } ( s , a , a ^ { \prime } ) - Q _ { 2 } ( s , a , a ^ { \prime } ) ] } \\ & { \quad \le \gamma \underset { s , a } { \operatorname* { s u p } } [ Q _ { 1 } ( s , a ) - Q _ { 2 } ( s , a ) ] } \\ & { \quad \Longrightarrow | | \mathcal { B } ^ { * } Q _ { 1 } ( s , a ) - \mathcal { B } ^ { * } Q _ { 2 } ( s , a ) | | _ { \infty } \le \gamma | | Q _ { 1 } ( s , a ) - Q _ { 2 } ( s , a ) | | _ { \infty } } \end{array}
270
+ $$
271
+
272
+ where $\operatorname { s u p } _ { s , a }$ is the supremum over all action sequences, with $0 \leq \gamma \leq 1$ and $\| f \| _ { \infty } = \operatorname* { s u p } _ { x } [ f ( x ) ]$ .
273
+
274
+ Case 2: For action sequence whose dimension is equal to the dimension of the action space
275
+
276
+ $$
277
+ \begin{array} { r l } & { \mathcal { B } ^ { * } Q _ { 1 } ( s , a ) - \mathcal { B } ^ { * } Q _ { 2 } ( s , a ) } \\ & { \ = R ( s , a ) + \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } E [ Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) ] - R ( s , a ) - \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } E [ Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) ] } \\ & { \ = \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } E [ Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) - Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) ] } \\ & { \ \leq \gamma \underset { s , a } { \operatorname* { s u p } } [ Q _ { 1 } ( s , a ) - Q _ { 2 } ( s , a ) ] } \\ & { \ \Longrightarrow \ | | \mathcal { B } ^ { * } Q _ { 1 } ( s , a ) - \mathcal { B } ^ { * } Q _ { 2 } ( s , a ) | | _ { \infty } \leq \gamma | | Q _ { 1 } ( s , a ) - Q _ { 2 } ( s , a ) | | _ { \infty } } \end{array}
278
+ $$
279
+
280
+ # C Analysis of the conservatism term
281
+
282
+ With the goal of understanding the behavior of our training procedure, we theoretically analyze the solution obtained by Eq. 2 for the simpler cases when $Q$ is represented as a table, and when the objective in Eq. 2 can be minimized exactly. We derive the minimizer of the objective in Eq. 2 by differentiating $J$ with respect to $Q$ :
283
+
284
+ $$
285
+ \begin{array} { r l } & { \forall s , a , k , \frac { d J } { d Q ( s , a ) } = 0 } \\ & { \pi _ { \beta } ( a | s ) \left( Q ( s , a ) - B ^ { * } Q ^ { k } ( s , a ) \right) + \alpha \tilde { \pi } _ { \beta } ( a | s ) Q ( s , a ) = 0 } \\ & { Q ( s , a ) \left( \pi _ { \beta } ( a | s ) + \alpha \tilde { \pi } _ { \beta } ( a | s ) \right) = \pi _ { \beta } ( a | s ) B ^ { * } Q ^ { k } ( s , a ) } \\ & { Q ^ { k + 1 } ( s , a ) = \underbrace { \pi _ { \beta } ( a | s ) } _ { : = m ( s , a ) } . } \end{array}
286
+ $$
287
+
288
+ Eq. 4 implies that training with the objective in Eq. 2 performs a weighted Bellman backup: unlike the standard Bellman backup, training with Eq. 2 multiplies large Q-value targets by a weight $m ( s , a )$ . This weight $m ( s , a )$ takes values between 0 and 1, with larger values close to 1 for indistribution actions where $( s , a ) \in \mathcal { D }$ , and very small values close to 0 for out-of-distribution actions $a$ at any state $s$ (i.e., actions where $\pi _ { \beta } ( a | s )$ is small). Thus, the Bellman backup induced via Eq. 4 should effectively prevent over-estimation of Q-values for unseen actions.
289
+
290
+ # D Q-Transformer Architecture & System
291
+
292
+ In this section, we describe the architecture of Q-Transformer as well as the important implementation and system details that make it an effective Q-learning algorithm for real robots.
293
+
294
+ # D.1 Transformer sequence model architecture
295
+
296
+ Our neural network architecture is shown in Figure 3. The architecture is derived from the RT-1 design [1], adapted to accommodate the Q-Transformer framework, and consists of a Transformer backbone that reads in images via a convolutional encoder followed by tokenization. Since we apply Q-Transformer to a multi-task robotic manipulation problem where each task is specified by a natural language instruction, we first embed the natural language instruction into an embedding vector via the Universal Sentence Encoder [68]. The embedding vector and images from the robot camera are then converted into a sequence of input tokens via a FiLM EfficientNet [69, 70]. In the standard RT-1 architecture [1], the robot action space is discretized and the Transformer sequence model outputs the logits for the discrete action bins per dimension and per time step. In this work, we extend the network architecture to use Q-learning by applying a sigmoid activation to the output values for each action, and interpreting the resulting output after the sigmoid as Q-values. This representation is particularly suitable for tasks with sparse per-episode rewards $R \in [ 0 , 1 ]$ , since the Q-values may be interpreted as probabilities of task success and should always lie in the range $[ 0 , 1 ]$ . Note that unlike the standard softmax, this interpretation of Q-values does not prescribe normalizing across actions (i.e., each action output can take on any value in $[ 0 , 1 ] )$ ).
297
+
298
+ Since our robotic system, described in Section D.3, has 8-dimensional actions, we end up with 8 dimensions per time step and discretize each one into $N = 2 5 6$ value bins. Our reward function is a sparse reward that assigns value 1.0 at the last step of an episode if the episode is successful and 0.0 otherwise. We use a discount rate $\gamma = 0 . 9 8$ . As is common in deep RL, we use a target network to estimate target Q-values $Q ^ { k }$ , using an exponential moving average of $Q$ -network weights to update the target network. The averaging constant is set to 0.01.
299
+
300
+ # D.2 Conservative Q-learning implementation
301
+
302
+ The conservatism penalty in Section 4.2 requires estimating expectations under $\pi _ { \beta } ( a | s )$ and $\tilde { \pi } _ { \beta } ( a | s ) \propto ( 1 - \pi _ { \beta } ( \bar { a } | s ) )$ , with the latter being especially non-trivial to estimate. We employ a simple and crude approximation that we found to work well in practice, replacing $\pi _ { \beta } ( a | s )$ with the empirical distribution corresponding, for each sampled state-action tuple $( s _ { j } , a _ { j } ) \in \mathcal { D }$ , to a Dirac delta centered on $a _ { j }$ , such that $\pi _ { \beta } ( { \bar { a } } | s _ { j } ) = \delta ( a = { \bar { a } } _ { j } )$ . This results in a simple expression for $\tilde { \pi } _ { \beta } ( a | s _ { j } )$ corresponding to the uniform distribution over all other actions, such that ${ \tilde { \pi } } _ { \beta } ( a | s _ { j } ) \propto \delta ( a \stackrel { . } { \neq } a _ { j } )$ . After discretizing the actions, there are $N - 1$ bins per dimension to exhaustively iterate over when computing the conservatism term in Eq. 2, which is the same as taking the average over targets for all unseen action values. In our experiments, we find that simply setting the conservatism weight to $\alpha = 1 . 0$ worked best, without additional tuning.
303
+
304
+ # D.3 Robot system overview
305
+
306
+ The robot that we use in this work is a mobile manipulator with a 7-DOF arm with a 2 jaw parallel gripper, attached to a mobile base with a head-mounted RGB camera, illustrated in Figure 1. The RGB camera provides a $6 4 0 \times 5 1 2$ RGB image, which is downsampled to $3 2 0 \times 2 5 6$ before being consumed by the Q-Transformer. See Figure 4 for images from the robot camera view. The learned policy is set up to control the arm and the gripper of the robot. Our action space consists of 8 dimensions: 3D position, 3D orientation, gripper closure command, and an additional dimension indicating whether the episode should terminate, which the policy must trigger to receive a positive reward upon successful task completion. Position and orientation are relative to the current pose, while the gripper command is the absolute closedness fraction, ranging from fully open to fully closed. Orientation is represented via axis-angles, and all actions except whether to terminate are continuous actions discretized over their full action range in 256 bins. The termination action is binary, but we pad it to be the same size as the other action dimensions to avoid any issues with unequal weights. The policy operates at $3 \ : \mathrm { H z }$ , with actions executed asynchronously [76].
307
+
308
+ Algorithm 1 Temporal difference error and loss computation for one action dimension i at timestep $t$ , $\hat { a } _ { t } ^ { i }$ .
309
+
310
+ Input Sequence of state in time window of size $w$ , $s _ { t - w : t }$ Input Language embedding of task instruction $l$ .
311
+ Input The state at timestep $t + 1$ , $s _ { t + 1 }$ .
312
+ Input Dataset action up to dimension $i$ , $\{ \boldsymbol { \mathcal { D } } \boldsymbol { a } _ { t } ^ { j } \} _ { j = 0 } ^ { i }$ .
313
+ Output The loss to optimize Q-Transformer.
314
+
315
+ ${ Q } ^ { t a r g } \gets$ Compute maximum Q-values of the next action dimension using Eq. 1 // Compute the maximum between $\mathsf { Q }$ -target and Monte Carlo return. $Q ^ { t a r g } \gets \mathrm { m a x } ( \mathbf { M } \mathbf { C } , Q ^ { t a r g } )$
316
+
317
+ // Compute the temporal difference error. $\mathrm { T D E r r o r } = \frac { 1 } { 2 } ( \mathrm { Q } \mathrm { - } \mathrm { T r a n s f o r m e r } ( l , s _ { t - w : t } , \{ a ^ { j } \} _ { j = 1 } ^ { i } ) - Q ^ { t a r g } ) ^ { 2 }$
318
+
319
+ // Compute the conservative regularizer.
320
+ // The sum is over all action bins not equal to the tokenized dataset action.
321
+ // $N$ is the number of discretization bin.
322
+ $\mathrm { R e g } = \frac { 1 } { 2 ( N - 1 ) } \sum _ { a \neq _ { \mathscr D } a _ { t } ^ { i } } \left( \mathrm { Q } \mathrm { - T r a n s f o r m e r } ( l , s _ { t - w : t } , \{ a ^ { j } \} _ { j = 1 } ^ { i - 1 } \cup \{ a \} ) \right) ^ { 2 }$
323
+ // Compute the loss function
324
+ $\mathcal { L } = \mathrm { T D E r r o r } + \mathrm { R e g }$
325
+
326
+ Return $\mathcal { L }$ as the loss function to optimize Q-Transformer with.
327
+
328
+ # E Pseudo-code
329
+
330
+ Algorithm 1 shows the loss computation for training each action dimension of the Q-Transformer. We first use Eq. 1 to compute the maximum Q-values over the next action dimensions. Then we compute the Q-target for the given dataset action by using the Bellman update with an additional maximization over the Monte-Carlo return and predicted maximum Q-value at the next time step. The TD-error is then computed using the Mean-Squared Error. Finally, we set a target of 0 for all discretized action bins except the dataset action and add the averaged Mean-Squared Error over these dimensions to the TD-Error, which results in the total loss $\mathcal { L }$ .
331
+
332
+ # F Running training for multiple random seeds
333
+
334
+ ![](images/03319d946e15d6073b3d3dc41af3eba492e895c4c32254425de7b2833e2b1373.jpg)
335
+ Figure 7: Mean and variance of Q-Transformer and RT-1 performance in simulation when running the training for 5 different random seeds.
336
+
337
+ In addition to performing a large amount of evaluations, we also analyze the statistical significance of our learning results by running our training of Q-Transformer and RT-1 on multiple seeds in simulation. In particular, we run the training for 5 random seeds in Figure 7. As we can see, QTransformer retains its improved performance across the distribution of the random seeds.
338
+
339
+ # G Q-Transformer value function with a language planner experiments
340
+
341
+ ![](images/418de5cc2615f3453f597de834c6ca9da2678908ac1770117968ab5dd507f285.jpg)
342
+ Figure 8: Qualitative comparisons of Q-values from QT-Opt (sim-to-real) and Q-Transformer. QTransformer outputs sharper Q-values for objects close to the robot, which can be grasped faster and more easily than the objects farther away.
343
+
344
+ Recently, the SayCan algorithm [8] was proposed as a way to combine large language models (LLMs) with learned policies and value functions to solve long-horizon tasks. In this framework, the value function for each available skill is used to determine the “affordance” of the current state for that skill, and a large language model then selects from among the available affordances to take a step towards performing some temporally extended task. For example, if the robot is commanded to bring all the items on a table, the LLM might propose a variety of semantically meaningful items, and select from among them based on the item grasping skill that currently has a high value (corresponding to items that the robot thinks it can grasp). SayCan uses QT-Opt in combination with sim-to-real transfer to train Q-functions for these affordances. In the following set of experiments, we demonstrate that the Q-Transformer outperforms QT-Opt for affordance estimation without using any sim-to-real transfer, entirely using the real world dataset that we employ in the preceding experiments.
345
+
346
+ We first benchmark Q-Transformer on the problem of correctly estimating task affordances from the RT-1 dataset [1]. In addition to the standard training on demonstrations and autonomous data, we introduce a training with relabeling, which we found particularly useful for affordance estimation. During relabeling, we sample a random alternate task for a given episode. We relabel the task name of the episode to the newly sampled task, and set reward to 0.0. This ensures that the boundaries between tasks are more clearly learned during train
347
+
348
+ <table><tr><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>QT-Opt (sim-to-real)</td><td>0.61</td><td>0.68</td><td>0.64</td></tr><tr><td>Q-T w/ relabel</td><td>0.76</td><td>0.89</td><td>0.82</td></tr><tr><td>Q-T w/o relabel</td><td>0.58</td><td>0.93</td><td>0.71</td></tr></table>
349
+
350
+ Table 1: Affordance estimation comparison: precision, recall and F1 score when using Q-values to determine if a task is feasible. Q-Transformer (Q-T) with multitask relabeling consistently produces better affordance estimates.
351
+
352
+ ing. Table 1 shows comparison of performance of our model with and without relabeling as well as the sim-to-real QT-Opt model used in SayCan [8]. Both of our models outperform the QT-Opt model on F1 score, with the relabeled model outperforming it by a large margin. This demonstrates that our Q-function can be effectively used for affordance estimation, even without training with sim-to-real transfer. Visualization of the Q-values produced by our Q-function can be found in Figure 8.
353
+
354
+ We then use Q-Transformer in a long horizon SayCan style evaluation, replacing both the sim-to-real QT-Opt model for affordance estimation, and the RT-1 policy for low-level robotic control. During this evaluation, a PaLM language model [77] is used to propose task candidates given a user query. Q-values are then used to pick the task candidate with the highest affordance score, which is then executed on the robot using the execution policy. The $\mathrm { Q } \mathrm { - }$ Transformer used for affordance estimation is trained with relabeling. The QTransformer used for low-level control is
355
+
356
+ Table 2: Performance on SayCan style long-horizon tasks: SayCan queries $Q ( s , \bar { a } )$ in planning to pick a language instruction, then runs a policy to execute the plan. Q-Transformer outperforms RT-1 with QT-Opt in both planning and execution.
357
+
358
+ <table><tr><td colspan="2">Method</td><td colspan="2">Success Rate</td></tr><tr><td>Affordance</td><td>Execution Planning</td><td></td><td>Execution</td></tr><tr><td>Q-T w/ relabel QT-Opt (sim-to-real)</td><td>Q-T RT-1</td><td>93 87</td><td>93 67</td></tr></table>
359
+
360
+ trained without relabeling, since we found relabeling episodes at the task level did not improve execution performance. SayCan with Q-Transformer is better at both planning the sequence of tasks and executing those plans, as illustrated in Table 2.
361
+
362
+ # H Real robotic manipulation tasks used in our evaluation
363
+
364
+ We include the complete list of evaluation tasks in our real robot experiments below.
365
+
366
+ Drawer pick and place: pick 7up can from top drawer and place on counter, place 7up can into top drawer, pick brown chip bag from top drawer and place on counter, place brown chip bag into top drawer, pick orange can from top drawer and place on counter, place orange can into top drawer, pick coke can from middle drawer and place on counter, place coke can into middle drawer, pick orange from middle drawer and place on counter, place orange into middle drawer, pick green rice chip bag from middle drawer and place on counter, place green rice chip bag into middle drawer, pick blue plastic bottle from bottom drawer and place on counter, place blue plastic bottle into bottom drawer, pick water bottle from bottom drawer and place on counter, place water bottle into bottom drawer, pick rxbar blueberry from bottom drawer and place on counter, place rxbar blueberry into bottom drawer.
367
+
368
+ Open and close drawer: open top drawer, close top drawer, open middle drawer, close middle drawer, open bottom drawer, close bottom drawer.
369
+
370
+ Move object near target: move 7up can near apple, move 7up can near blue chip bag, move apple near blue chip bag, move apple near 7up can, move blue chip bag near 7up can, move blue chip bag near apple, move blue plastic bottle near pepsi can, move blue plastic bottle near orange, move pepsi can near orange, move pepsi can near blue plastic bottle, move orange near blue plastic bottle, move orange near pepsi can, move redbull can near rxbar blueberry, move redbull can near water bottle, move rxbar blueberry near water bottle, move rxbar blueberry near redbull can, move water bottle near redbull can, move water bottle near rxbar blueberry, move brown chip bag near coke can, move brown chip bag near green can, move coke can near green can, move coke can near brown chip bag, move green can near brown chip bag, move green can near coke can, move green jalapeno chip bag near green rice chip bag, move green jalapeno chip bag near orange can, move green rice chip bag near orange can, move green rice chip bag near green jalapeno chip bag, move orange can near green jalapeno chip bag, move orange can near green rice chip bag, move redbull can near sponge, move sponge near water bottle, move sponge near redbull can, move water bottle near sponge, move 7up can near blue blastic bottle, move 7up can near green can, move blue plastic bottle near green can, move blue plastic bottle near 7up can, move green can near 7up can, move green can near blue plastic bottle, move apple near brown chip bag, move apple near green jalapeno chip bag, move brown chip bag near green jalapeno chip bag, move brown chip bag near apple, move green jalapeno chip bag near apple, move green jalapeno chip bag near brown chip bag.
parse/dev/0I3su3mkuL/0I3su3mkuL_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/7gE9V9GBZaI/7gE9V9GBZaI.md ADDED
@@ -0,0 +1,560 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EXPLORING MEMORIZATION IN ADVERSARIAL TRAINING
2
+
3
+ Yinpeng $\mathbf { D o n g ^ { 1 , 2 } }$ , Ke $\mathbf { X } \mathbf { u } ^ { 4 }$ , Xiao Yang1, Tianyu Pang1, Zhijie Deng1, Hang $\mathbf { S u } ^ { 1 , 3 }$ , J $\mathbf { u n } \mathbf { Z } \mathbf { h } \mathbf { u } ^ { 1 , 2 , 3 * }$ 1 Dept. of Comp. Sci. and Tech., Institute for AI, Tsinghua-Bosch Joint ML Center, THBI Lab 1 BNRist Center, Tsinghua University, Beijing, China; 2 RealAI; 3 Peng Cheng Laboratory; 4 CMU {dongyinpeng, suhangss, dcszj}@mail.tsinghua.edu.cn, kx1@andrew.cmu.edu
4
+
5
+ # ABSTRACT
6
+
7
+ Deep learning models have a propensity for fitting the entire training set even with random labels, which requires memorization of every training sample. In this paper, we explore the memorization effect in adversarial training (AT) for promoting a deeper understanding of model capacity, convergence, generalization, and especially robust overfitting of the adversarially trained models. We first demonstrate that deep networks have sufficient capacity to memorize adversarial examples of training data with completely random labels, but not all AT algorithms can converge under the extreme circumstance. Our study of AT with random labels motivates further analyses on the convergence and generalization of AT. We find that some AT approaches suffer from a gradient instability issue and most recently suggested complexity measures cannot explain robust generalization by considering models trained on random labels. Furthermore, we identify a significant drawback of memorization in AT that it could result in robust overfitting. We then propose a new mitigation algorithm motivated by detailed memorization analyses. Extensive experiments on various datasets validate the effectiveness of the proposed method.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep neural networks (DNNs) usually exhibit excellent generalization ability in pattern recognition tasks, despite their sufficient capacity to overfit or memorize the entire training set with completely random labels (Zhang et al., 2017). The memorization behavior in deep learning has aroused tremendous attention to identifying the differences between learning on true and random labels (Arpit et al., 2017; Neyshabur et al., 2017), and examining what and why DNNs memorize (Feldman, 2020; Feldman & Zhang, 2020; Maennel et al., 2020). This phenomenon has also motivated a growing body of works on model capacity (Arpit et al., 2017; Belkin et al., 2019), convergence (Allen-Zhu et al., 2019; Du et al., 2019; Zou et al., 2020), and generalization (Neyshabur et al., 2017; Bartlett et al., 2017), which consequently provide a better understanding of the DNN working mechanism.
12
+
13
+ In this paper, we explore the memorization behavior for a different learning algorithm—adversarial training (AT). Owing to the security threat of adversarial examples, i.e., maliciously generated inputs by adding imperceptible perturbations to cause misclassification (Szegedy et al., 2014; Goodfellow et al., 2015), various defense methods have been proposed to improve the adversarial robustness of DNNs (Kurakin et al., 2017; Madry et al., 2018; Liao et al., 2018; Wong & Kolter, 2018; Cohen et al., 2019; Zhang et al., 2019b; Pang et al., 2019; 2020; Dong et al., 2020a). AT is arguably the most effective defense technique (Athalye et al., 2018; Dong et al., 2020b), in which the network is trained on the adversarially augmented samples instead of the natural ones (Madry et al., 2018).
14
+
15
+ Despite the popularity, the memorization behavior in AT is less explored. Schmidt et al. (2018) show that a model is able to fully (over)fit the training set against an adversary, i.e., reaching almost $1 0 0 \%$ robust training accuracy, while the performance on test data is much inferior, witnessing a significant generalization gap. The overfitting phenomenon in AT is further investigated in Rice et al. (2020). However, it is not clear whether DNNs could memorize adversarial examples of training data with completely random labels. Answering this question could help to examine the effects of memorization in AT under the “extreme” circumstance and facilitate a deeper understanding of capacity, convergence, generalization, and robust overfitting of the adversarially trained models. In general, it is difficult for a classifier to memorize adversarial examples with random labels since the model entails a much more complicated decision boundary, as illustrated in Fig. 1. Even though the networks have sufficient capacity, AT may not necessarily converge. Therefore, we aim to comprehensively study this problem and explore how the analysis can motivate better algorithms.
16
+
17
+ ![](images/f81cfa7059d13b8361f9e9bbd507b80b17845c0da03ef1bde410fef37354cce1.jpg)
18
+ Figure 1: A conceptual illustration of decision boundaries learned via standard training and adversarial training with true and random labels, respectively. The model needs a significantly more complicated decision boundary to memorize adversarial examples of training data with random labels.
19
+
20
+ Our contributions. We first empirically investigate the memorization behavior in AT by performing PGD-AT (Madry et al., 2018) and TRADES (Zhang et al., 2019b) with random labels sampled uniformly over all classes. Different from standard training (ST) that can easily memorize random labels (Zhang et al., 2017), AT may fail to converge, with PGD-AT being a typical example. Nevertheless, TRADES can converge under this circumstance. It demonstrates that DNNs have sufficient capacity to memorize adversarial examples of training data with completely random labels. This phenomenon is commonly observed on multiple datasets, network architectures, and threat models.
21
+
22
+ The memorization analysis has further implications for understanding the convergence and generalization of AT. We conduct a convergence analysis on gradient magnitude and stability to explain the counter-intuitive different convergence properties of PGD-AT and TRADES with random labels since they behave similarly when trained on true labels (Rice et al., 2020). We corroborate that PGD-AT suffers from a gradient instability issue while the gradients of TRADES are relatively stable thanks to its adversarial loss. Moreover, by considering models trained on random labels, our generalization analysis indicates that several recently suggested complexity measures are inadequate to explain robust generalization, which is complementary to the findings in ST (Neyshabur et al., 2017). Accordingly, an appropriate explanation of robust generalization remains largely under-addressed.
23
+
24
+ Lastly, but most importantly, we identify a significant drawback of memorization in AT that it could result in robust overfitting (Rice et al., 2020). We argue that the cause of robust overfitting lies in the memorization of one-hot labels in the typical AT methods. The one-hot labels can be inappropriate or even noisy for some adversarial examples because some data naturally lies close to the decision boundary, and the corresponding adversarial examples should be assigned low predictive confidence (Stutz et al., 2020; Cheng et al., 2020). To solve this problem, we propose a new mitigation algorithm that impedes over-confident predictions by regularization for avoiding the excessive memorization of adversarial examples with possibly noisy labels. Experiments validate that our method can eliminate robust overfitting to a large extent across multiple datasets, network architectures, threat models, and AT methods, achieving better robustness under a variety of adversarial attacks than the baselines.
25
+
26
+ # 2 BACKGROUND
27
+
28
+ # 2.1 ADVERSARIAL TRAINING
29
+
30
+ Let $\mathbf { \mathcal { D } } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ denote a training dataset with $n$ samples, where $\mathbf { x } _ { i } \in \mathbb { R } ^ { d }$ is a natural example and $y _ { i } \in \{ 1 , . . . , C \}$ is its true label often encoded as an one-hot vector ${ \mathbf { 1 } } _ { y _ { i } }$ with totally $C$ classes. Adversarial training (AT) can be formulated as a robust optimization problem (Madry et al., 2018):
31
+
32
+ $$
33
+ \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { i = 1 } ^ { n } \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in S ( \mathbf { x } _ { i } ) } \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } ) ,
34
+ $$
35
+
36
+ where $f _ { \theta }$ is a DNN classifier with parameters $\pmb \theta$ that predicts probabilities over all classes, $\mathcal { L }$ is the classification loss (i.e., the cross-entropy loss as $\mathcal { L } ( f _ { \theta } ^ { \mathsf { ^ { * } } } ( \mathbf { x } ) , y ) \overset { \bullet } { = } - \mathbf { 1 } _ { y } ^ { \top } \log f _ { \theta } ( \mathbf { x } ) )$ , and $\begin{array} { r } S ( \mathbf { x } ) = \{ \mathbf { x } ^ { \prime } : \ \end{array}$ $\| \mathbf { x } ^ { \prime } - \mathbf { x } \| _ { p } \leq \epsilon \}$ is an adversarial region centered at $\mathbf { x }$ with radius $\epsilon > 0$ under the $\ell _ { p }$ -norm threat models (e.g., $\ell _ { 2 }$ and $\ell _ { \infty }$ norms that we consider). The robust optimization problem (1) is solved by using adversarial attacks to approximate the inner maximization and updating the model parameters $\pmb \theta$ via gradient descent. A typical method uses projected gradient descent (PGD) (Madry et al., 2018) for the inner problem, which starts at a randomly initialized point in $S ( \mathbf { x } _ { i } )$ and iteratively updates the adversarial example under the $\ell _ { \infty }$ -norm threat model by
37
+
38
+ $$
39
+ \mathbf { x } _ { i } ^ { \prime } = \Pi _ { S ( \mathbf { x } _ { i } ) } \big ( \mathbf { x } _ { i } ^ { \prime } + \alpha \cdot \mathrm { s i g n } \big ( \nabla _ { \mathbf { x } } \mathcal { L } \big ( f _ { \theta } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } \big ) \big ) \big ) ,
40
+ $$
41
+
42
+ where $\Pi ( \cdot )$ is the projection operator and $\alpha$ is the step size.
43
+
44
+ Besides PGD-AT, another typical AT method is TRADES (Zhang et al., 2019b), which balances the trade-off between robustness and natural accuracy by minimizing a different adversarial loss
45
+
46
+ $$
47
+ \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { i = 1 } ^ { n } \left\{ \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) , y _ { i } ) + \beta \cdot \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in S ( \mathbf { x } _ { i } ) } \mathcal { D } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) | | f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) ) \right\} ,
48
+ $$
49
+
50
+ where $\mathcal { L }$ is the clean cross-entropy loss on the natural example, $\mathcal { D }$ is the Kullback–Leibler divergence, and $\beta$ is a balancing parameter. The inner maximization of TRADES is also solved by PGD.
51
+
52
+ Recent progress of AT includes designing new adversarial losses (Mao et al., 2019; Qin et al., 2019; Pang et al., 2020; Wang et al., 2020; Dong et al., 2020a) and network architecture (Xie et al., 2019), training acceleration (Shafahi et al., 2019; Zhang et al., $2 0 1 9 \mathrm { a }$ ; Wong et al., 2020), and exploiting more training data (Hendrycks et al., 2019; Alayrac et al., 2019; Carmon et al., 2019; Zhai et al., 2019). Recent works highlight the training tricks in AT (Gowal et al., 2020; Pang et al., 2021).
53
+
54
+ # 2.2 RELATED WORK ON DNN MEMORIZATION
55
+
56
+ It has been observed that DNNs can easily memorize training data with random labels (Zhang et al., 2017), which requires “rethinking” of conventional techniques (e.g., VC dimension) to explain generalization. Arpit et al. (2017) identify qualitative differences between learning on true and random labels. Further works attempt to examine what and why DNNs memorize (Feldman, 2020; Feldman & Zhang, 2020; Maennel et al., 2020). Motivated by the memorization phenomenon in deep learning, convergence of training has been analyzed in the over-parameterized setting (Allen-Zhu et al., 2019; Du et al., 2019; Zou et al., 2020), while generalization has been studied with numerous theoretical and empirical complexity measures (Neyshabur et al., 2015; 2017; Bartlett et al., 2017; Novak et al., 2018; Arora et al., 2018; Cao & Gu, 2019; Jiang et al., 2020; Chen et al., 2020).
57
+
58
+ In contrast, the memorization behavior in AT has been less explored. The previous works demonstrate that DNNs can fit training data against an adversary (Madry et al., 2018; Schmidt et al., 2018; Rice et al., 2020), e.g., achieving nearly $1 0 0 \%$ robust training accuracy against a PGD adversary, but this behavior is not explored when trained on random labels. This paper is dedicated to investigating the memorization in AT under the extreme condition with random labels, while drawing connections to capacity, convergence, generalization, and robust overfitting, with the overarching goal of better understanding the AT working mechanism.
59
+
60
+ # 3 MEMORIZATION IN AT AND IMPLICATIONS
61
+
62
+ In this section, we first explore the memorization behavior in AT through an empirical study. Our analysis raises new questions about the convergence and generalization of AT, many of which cannot be answered by existing works. Thereafter, we provide further analytical studies on the convergence and generalization of AT by considering models trained on random labels particularly.
63
+
64
+ # 3.1 AT WITH RANDOM LABELS
65
+
66
+ We explore the memorization behavior of PGD-AT (Madry et al., 2018) and TRADES (Zhang et al., 2019b) as two studying cases. The experiments are conducted on CIFAR-10 (Krizhevsky & Hinton, 2009) with a Wide ResNet model (Zagoruyko & Komodakis, 2016) of depth 28 and widen factor 10 (WRN-28-10). Similar to Zhang et al. (2017), we train a network on the original dataset with true labels and on a copy of the dataset in which the true labels are corrupted by random ones. For training and robustness evaluation, a 10-step $\ell _ { \infty }$ PGD adversary with $\epsilon = 8 / 2 5 5$ and $\alpha = 2 / 2 5 5$ is adopted. For TRADES, the PGD adversary maximizes the KL divergence during training, while maximizes the cross-entropy loss for robustness evaluation, as common practice (Zhang et al., 2019b). We set $\beta = 6 . 0$ . In the sequel, we denote accuracy of a classifier against the 10-step PGD adversary as “robust accuracy”, and accuracy on natural examples as “natural accuracy”.
67
+
68
+ ![](images/22d77cfd65523e8b562391b0e65ab4b94592a9d15543c79d8df8cea09f6ac952.jpg)
69
+ Figure 2: (a) and (b) show the natural and robust training accuracies of PGD-AT and TRADES, respectively, when trained on true or random labels. (c) shows the generalization gap under varying levels of label noise.
70
+
71
+ Fig. 2(a) and Fig. 2(b) show the learning curves of PGD-AT and TRADES without explicit regularizations. Both methods achieve almost $\bar { 1 } 0 0 \%$ natural and robust training accuracies when trained on true labels. When the labels are random, we observe the totally different behaviors between PGDAT and TRADES—PGD-AT fails to converge while TRADES still reaches nearly $1 0 0 \%$ training accuracies. This phenomenon is somewhat striking because PGD-AT and TRADES perform similarly on true labels (Rice et al., 2020). We find that the different memorization behaviors between PGD-AT and TRADES when trained on random labels can commonly be observed across a variety of datasets, model architectures, and threat models (shown in Appendix A.1), indicating that it is a general phenomenon of memorization in the two AT methods. Therefore, our finding is:
72
+
73
+ DNNs have sufficient capacity to memorize adversarial examples of training data with completely random labels, but the convergence depends on the AT algorithms.
74
+
75
+ Partially corrupted labels. We then inspect the behavior of AT under varying levels of label noise from $0 \%$ (true labels) to $1 0 0 \%$ (completely random labels). The generalization gap (i.e., difference between training and test accuracies) presented in Fig. 2(c) grows steadily as we increase the noise rate before the network fails to converge. The learning curves are provided in Appendix A.1.
76
+
77
+ Explicit regularizations. We study the role of common regularizers in AT memorization, including data augmentation, weight decay, and dropout (Srivastava et al., 2014). We train TRADES on true and random labels with several combinations of regularizers. We observe the explicit regularizers do not significantly affect the model’s ability to memorize adversarial examples, similar to the finding in ST (Zhang et al., 2017; Arpit et al., 2017). The detailed results are provided in Appendix A.1.
78
+
79
+ # 3.2 CONVERGENCE ANALYSIS OF AT WITH RANDOM LABELS
80
+
81
+ Since we have observed a counter-intuitive fact that PGD-AT and TRADES exhibit different convergence properties with random labels, it is necessary to perform a convergence analysis to understand this phenomenon. Note that our finding can hardly be explained by previous works (Gao et al., 2019; Wang et al., 2019; Zhang et al., 2020).
82
+
83
+ We first study the effects of different training settings on PGD-AT with random labels. We conduct experiments to analyze each training factor individually, including network architecture, attack steps, optimizer, and perturbation budget. We find that tuning the training settings cannot make PGD-AT converge with random labels (Appendix A.2 details the results). Based on the analysis, we think that the convergence issue of PGD-AT could be a result of the adversarial loss function in Eq. (1) rather than other training configurations. Specifically, TRADES in Eq. (3) minimizes a clean cross-entropy (CE) loss on natural examples, making DNNs memorize natural examples with random labels before fitting adversarial examples. As seen in Fig. 2(b), at the very early stage of TRADES training (the first 25 epochs), the natural accuracy starts to increase while the robust accuracy does not. However, PGD-AT in Eq. (1) directly minimizes the CE loss on adversarial samples with random labels, which can introduce unstable gradients with large variance, making it fail to converge. To corroborate the above argument, we analyze the gradient magnitude and stability below.
84
+
85
+ Gradient magnitude. First, we calculate the average gradient norm of the adversarial loss in Eq. (1) w.r.t. model parameters over each training sample for PGD-AT, and similarly calculate the average gradient norm of the clean CE loss (the first term) and the KL loss (the second term) in Eq. (3) w.r.t. parameters for TRADES to analyze their effects, respectively. We present the gradient norm along with training in Fig. 3(a). We can see that at the initial training epochs, the gradient norm of the KL loss in TRADES is much smaller than that of the CE loss, which indicates that the CE loss dominates TRADES training initially. With the training progressing, the KL loss has a larger gradient norm, making the network memorize adversarial examples. However, it is still unclear why PGD-AT does not rely on a similar learning tactic for convergence. To make a direct comparison with TRADES, we rewrite the adversarial loss of PGD-AT in Eq. (1) as
86
+
87
+ ![](images/3d95aded5ce66adc65f626768cc2aa903a5da8dd130c8143836e938eb6eb27de.jpg)
88
+ Figure 3: (a): Gradient norm of PGD-AT and TRADES Figure 4: (a): The $\ell _ { 2 }$ distance between the gradients along the training process. (b): The ratio of the gra- at $\pmb { \theta }$ and $\pmb \theta + \lambda \mathbf d$ of different losses, where $\pmb { \theta }$ are inidient norm of PGD-AT and TRADES during the first tialized, $\lambda \in [ - 0 . 0 5 , 0 . 0 5 ]$ . (b): The cosine similarity 1000 training iterations. between the gradients in each two successive epochs.
89
+
90
+ $$
91
+ \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in S ( \mathbf { x } _ { i } ) } \mathcal { L } ( f _ { \theta } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } ) = \mathcal { L } ( f _ { \theta } ( \mathbf { x } _ { i } ) , y _ { i } ) + \mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb { \theta } ) ,
92
+ $$
93
+
94
+ where $\mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb \theta )$ denotes the difference between the CE loss on adversarial example $\mathbf { x } _ { i } ^ { \prime }$ and that on natural example $\mathbf { x } _ { i }$ . Hence we can separately calculate the gradient norm of $\mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) , y _ { i } )$ and $\mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb \theta )$ w.r.t. parameters $\pmb \theta$ to find out the effect of $\mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb \theta )$ on training. Specifically, we measure the relative gradient magnitude, i.e., in PGD-AT we calculate the ratio of the gradient norm $\begin{array} { r l } { { \frac { \| \nabla _ { \pmb { \theta } } \mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb { \theta } ) \| _ { 2 } } { \| \nabla _ { \pmb { \theta } } \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) , y _ { i } ) \| _ { 2 } } } \quad } & { } \end{array}$ ; while in TRADES, we similarly calculate the ratio of the gradient norm of the KL loss to that of the CE loss. Fig. 3(b) illustrates the ratio of PGD-AT and TRADES during the first 1000 training iterations. The ratio of PGD-AT is consistently higher than that of TRADES, meaning that $\mathcal { R } ( \mathbf { x } _ { i } , y _ { i } , \pmb \theta )$ has a non-negligible impact on training.
95
+
96
+ Gradient stability. Then, we analyze the gradient stability to explain why PGD-AT cannot converge. We denote the adversarial loss of PGD-AT as $\begin{array} { r } { \mathcal { I } ( \mathbf { x } , y , \theta ) \stackrel { - } { = } \operatorname* { m a x } _ { \mathbf { x } ^ { \prime } \in S ( \mathbf { x } ) } \mathcal { L } ( f _ { \theta } ( \mathbf { x } ^ { \prime } ) , y ) } \end{array}$ with the subscript $i$ omitted for notation simplicity. We have a theorem on gradient stability.
97
+
98
+ Theorem 1. Suppose the gradient of the clean cross-entropy loss is locally Lipschitz continuous as
99
+
100
+ $$
101
+ \begin{array} { r } { \| \nabla _ { \theta } \mathcal { L } \big ( f _ { \theta } ( \mathbf { x } ^ { \prime } ) , y \big ) - \nabla _ { \theta } \mathcal { L } \big ( f _ { \theta } ( \mathbf { x } ) , y \big ) \| _ { 2 } \leq K \| \mathbf { x } ^ { \prime } - \mathbf { x } \| _ { p } , } \end{array}
102
+ $$
103
+
104
+ any $\mathbf { x } \in \mathbb { R } ^ { d }$ , $\mathbf { x } ^ { \prime } \in S ( \mathbf { x } )$ , and any $\pmb \theta$ , where $K$ is the Lipschitz constant. Then we ha
105
+
106
+ $$
107
+ \begin{array} { r } { \| \nabla _ { \theta } \mathcal { I } ( \mathbf { x } , y , \theta _ { 1 } ) - \nabla _ { \theta } \mathcal { I } ( \mathbf { x } , y , \theta _ { 2 } ) \| _ { 2 } \leq \| \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( \mathbf { x } ) , y ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( \mathbf { x } ) , y ) \| _ { 2 } + 2 \epsilon K . } \end{array}
108
+ $$
109
+
110
+ We provide the proof in Appendix B, where we show the upper bound in Eq. (5) is tight. Theorem 1 indicates that the gradient of the adversarial loss $\mathcal { I } ( \mathbf { x } , y , \pmb { \theta } )$ of PGD-AT will change more dramatically than that of the clean CE loss $\mathcal { L } ( f _ { \theta } ( \mathbf { x } ) , y )$ . When $\pmb { \theta } _ { 1 }$ and $\pmb { \theta } _ { 2 }$ are close, the difference between the gradients of $\mathcal { L }$ at $\pmb { \theta } _ { 1 }$ and $\pmb { \theta } _ { 2 }$ is close to 0 due to the semi-smoothness of over-parameterized DNNs (Allen-Zhu et al., 2019), but that of $\mathcal { I }$ is relatively large due to $2 \epsilon K$ in Eq. (5). To validate this, we visualize the change of gradient when moving the parameters $\pmb { \theta }$ along a random direction $\mathbf { d }$ with magnitude $\lambda$ . In particular, we set $\pmb \theta$ as initialization, $\mathbf { d }$ is sampled from a Gaussian distribution and normalized filter-wise (Li et al., 2018). For PGD-AT and TRADES, we craft adversarial examples on-the-fly for the model with $\pm \lambda \mathbf { d }$ and measure the change of gradient by the $\ell _ { 2 }$ distance to gradient at $\pmb { \theta }$ averaged over all data samples. The curves on gradient change of PGD-AT, TRADES, and the clean CE loss are shown in Fig. 4(a). In a small neighborhood of $\pmb { \theta }$ (i.e., small $\lambda$ ), the gradient of PGD-AT changes abruptly while the gradients of TRADES and the clean CE loss are more continuous. The gradient instability leads to a lower cosine similarity between the gradient directions w.r.t. the same data in each two successive training epochs of PGD-AT, as illustrated in Fig. 4(b). Therefore, the training of PGD-AT would be rather unstable that the gradient exhibits large variance, making it fail to converge.
111
+
112
+ Clean CE loss helps PGD-AT converge. To further verify our argument, we add the clean CE loss into the PGD-AT objective to resemble the learning of TRADES with random labels, as
113
+
114
+ ![](images/0f3b904c9006568d1cb08aa0fa412d86aab5ac3e349857ac8558ac5b66161398.jpg)
115
+ Figure 5: AT by Eq. (6)
116
+
117
+ $$
118
+ \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { i = 1 } ^ { n } \left\{ ( 1 - \gamma ) \cdot \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) , y _ { i } ) + \gamma \cdot \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in S ( \mathbf { x } _ { i } ) } \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } ) \right\} ,
119
+ $$
120
+
121
+ ![](images/5d1ae9d9a6ebf5861669f883e38d9ba6c2fdd6d55fed8de7c66a2935cc0ee3f5.jpg)
122
+ Figure 6: The results on four complexity measures of the adversarially trained models w.r.t. robust generaliza tion gap. The training settings of these models are provided in Appendix A.3.
123
+
124
+ where $\gamma$ is gradually increased from 0 to 1. By using Eq. (6), the gradient would be stabler at the initial stage and training on random labels can successfully converge, as shown Fig. 5.
125
+
126
+ In summary, our convergence analysis identifies the gradient instability issue of PGD-AT, provides new insights on the differences between PGD-AT and TRADES, and partially explain the failures of AT under other realistic settings beyond the scope of this section as detailed in Appendix A.2.
127
+
128
+ # 3.3 GENERALIZATION ANALYSIS OF AT WITH RANDOM LABELS
129
+
130
+ As our study demonstrates DNNs’ ability to memorize adversarial examples with random labels, we raise the question of whether DNNs rely on a similar memorization tactic on true labels and how to explain/ensure robust generalization. Although many efforts have been devoted to studying robust generalization of AT theoretically or empirically (Yin et al., 2018; Schmidt et al., 2018; Bubeck et al., 2019; Tu et al., 2019; Wu et al., 2020), they do not take the models trained on random labels into consideration. As it is easy to show that the explicit regularizations are not the adequate explanation of generalization in ST (Zhang et al., 2017; Arpit et al., 2017) and AT (see Appendix A.3), people resort to complexity measures of a model to explain generalization (i.e., a lower complexity should imply a smaller generalization gap). Here we show how the recently proposed complexity measures fail to explain robust generalization when comparing models trained on true and random labels.
131
+
132
+ We consider several norm-based and sharpness/flatness-based measures. We denote the parameters of a network by $\pmb \theta : = \{ W _ { i } \} _ { i = 1 } ^ { m }$ . The norm-based measures include spectral norm $\begin{array} { r } { \frac { 1 } { \gamma _ { \mathrm { m a r g i n } } } \prod _ { i = 1 } ^ { m } \| W _ { i } \| _ { 2 } } \end{array}$ and $\ell _ { 1 }$ norm $\begin{array} { r } { \frac { 1 } { \gamma _ { \mathrm { m a r g i n } } } \sum _ { i = 1 } ^ { m } \| W _ { i } \| _ { 1 } } \end{array}$ of model parameters, where $\gamma _ { \mathrm { m a r g i n } }$ is a margin on model output to make them scale-insensitive (Neyshabur et al., 2017). The spectral norm appears in the theoretical robust generalization bounds (Yin et al., 2018; Tu et al., 2019) and is related to the Lipschitz constant of neural networks (Cisse et al., 2017). The $\ell _ { 1 }$ norm is adopted to reduce the robust generalization gap (Yin et al., 2018). The sharpness/flatness-based measures include the curvature of input loss landscape (Moosavi-Dezfooli et al., 2019) as the dominant eigenvalue of the Hessian matrix, as well as the flatness of weight loss landscape (Wu et al., 2020) related to the change of adversarial loss when moving the weights along a random direction. Fig. 6 plots the four complexity measures w.r.t. robust generalization gap of several models trained with various combinations of regularizations on true or random labels. The results show that the first three measures can hardly ensure robust generalization, that lower complexity does not necessarily imply smaller robust generalization gap, e.g., the models trained on random labels can even lead to lower complexity than those trained on true labels. Among them, the flatness of weight loss landscape (Wu et al., 2020) is more reliable.
133
+
134
+ In summary, the generalization analysis indicates that the previous approaches, especially various complexity measures, cannot adequately explain and ensure the robust generalization performance in AT. Our finding of robust generalization in AT is complementary to that of standard generalization in ST (Zhang et al., 2017; Neyshabur et al., 2017; Jiang et al., 2020). Accordingly, robust generalization of adversarially trained models remains an open problem for future research.
135
+
136
+ # 4 ROBUST OVERFITTING ANALYSIS
137
+
138
+ Rice et al. (2020) have identified robust overfitting as a dominant phenomenon in AT, i.e., shortly after the first learning rate decay, further training will continue to decrease the robust test accuracy. They further show that several remedies for overfitting, including explicit $\ell _ { 1 }$ and $\ell _ { 2 }$ regularizations, data augmentation, etc., cannot gain improvements upon early stopping. Although robust overfitting has been thoroughly investigated, there still lacks an explanation of why it occurs. In this section, we draw a connection between memorization and robust overfitting in AT by showing that robust overfitting is caused by excessive memorization of one-hot labels in the typical AT methods. Motivated by the analysis, we then propose an effective strategy to eliminate robust overfitting.
139
+
140
+ ![](images/2c2ebe3ba21b0fd0c69b97eb9a22e7f608815fec9e68d157cac0afe86e8aff46.jpg)
141
+ Figure 7: (a): The accuracy curves of PGD-AT with true labels to reproduce robust overfitting. (b): The robust test accuracy of PGD-AT under various perturbation budgets . (c): The adversarial loss of two independently trained networks by PGD-AT on 500 samples sorted by the loss of the first model.
142
+
143
+ # 4.1 EXPLAINING ROBUST OVERFITTING
144
+
145
+ The typical AT approaches (e.g., PGD-AT, TRADES) commonly adopt one-hot labels as the targets for training, as introduced in Sec. 2.1. The one-hot labels could be inappropriate for some adversarial examples because it is difficult for a network to assign high-confident one-hot labels for all perturbed samples within the perturbation budget $\epsilon$ (Stutz et al., 2020; Cheng et al., 2020). Intuitively, some examples may naturally lie close to the decision boundary and should be assigned lower predictive confidence for the worst-case adversarial examples. It indicates that one-hot labels of some training data may be noisy in $\mathsf { A T } ^ { 1 }$ . After a certain training epoch, the model memorizes these “hard” training examples with possibly noisy labels, leading to the reduction of test robustness, as shown in Fig. 7(a). Thus, we hypothesize the cause of robust overfitting lies in the memorization of one-hot labels.
146
+
147
+ Our hypothesis is well supported by two pieces of evidence. First, we find that when the perturbation budget $\epsilon$ is small, robust overfitting does not occur, as shown in Fig. 7(b). This observation implies that the one-hot labels are more appropriate as the targets for adversarial examples within a smaller neighborhood while become noisier under a larger perturbation budget and lead to overfitting. Second, we validate that the “hard” training examples with higher adversarial loss values are consistent across different models. We first train two independent networks (using the same architecture and different random seeds) by PGD-AT and calculate the adversarial loss for each training sample. We show the adversarial losses on 500 samples sorted by the loss of the first model in Fig. 7(c). It can be seen that the samples with lower adversarial losses of the first model also have relatively lower losses of the second one and vice versa. We further quantitatively measure the consistency of the adversarial losses of all training samples between the two models using the Kendall’s rank coefficient (Kendall, 1938), which is 0.85 in this case. A similar result can be observed for two different model architectures (see Appendix C.1). The results verify that the “hard” training examples with possibly noisy labels are intrinsic of a dataset, supporting our hypothesis on why robust overfitting occurs.
148
+
149
+ # 4.2 MITIGATING ROBUST OVERFITTING
150
+
151
+ Based on the above analysis, we resort to the methods that are less prone to overfit noisy labels for mitigating robust overfitting in AT. Although learning with noisy labels has been broadly studied in ST (Natarajan et al., 2013; Patrini et al., 2017; Jiang et al., 2018; Han et al., 2018; Zhang & Sabuncu, 2018), we find that most of these approaches are not suitable for AT. For example, a typical line of methods filter out noisy samples and train the models on the identified clean samples (Jiang et al., 2018; Han et al., 2018; Ren et al., 2018). However, they will neglect a portion of training data with noisy labels, which can lead to inferior results for AT due to the reduction of training data (Schmidt et al., 2018). Table 2 shows the results to validate this.
152
+
153
+ To address this problem, we propose to regularize the predictions of adversarial examples from being over-confident by integrating the temporal ensembling (TE) approach (Laine & Aila, 2017) into the AT frameworks. TE maintains an ensemble prediction of each data and penalizes the difference between the current prediction and the ensemble prediction, which is effective for semi-supervised learning and learning with noisy labels (Laine & Aila, 2017). We think that TE is suitable for AT since it enables to leverage all training samples and hinders the network from excessive memorization of one-hot labels with a regularization term. Specifically, we denote the ensemble prediction of a training sample $\mathbf { x } _ { i }$ as $\mathbf { p } _ { i }$ , which is updated in each training epoch as $\mathbf { p } _ { i } \eta \cdot \mathbf { p } _ { i } + ( 1 - \eta ) \cdot f _ { \pmb { \theta } } ( \mathbf { x } _ { i } )$ , where $\eta$ is the momentum term. The training objective of PGD-AT with TE can be expressed as
154
+
155
+ Table 1: Test accuracy $( \% )$ of several methods on CIFAR-10, CIFAR-100, and SVHN under the $\ell _ { \infty }$ norm with $\epsilon = 8 / 2 5 5$ based on the ResNet-18 architecture. We choose the best checkpoint according to the highest robust accuracy on the test set under PGD-10.
156
+
157
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Natural AccuracyBest Final Diff</td><td rowspan=1 colspan=1>PGD-10Best Final Diff</td><td rowspan=1 colspan=1>PGD-1000Best Final Diff</td><td rowspan=1 colspan=1>C&amp;W-1000Best Final Diff</td><td rowspan=1 colspan=1>AutoAttackBest Final Diff</td></tr><tr><td rowspan=1 colspan=1>PGD-ATPGD-AT+TE</td><td rowspan=1 colspan=1>83.75 84.82 -1.0782.35 82.79 -0.44</td><td rowspan=1 colspan=1>[52.64 44.92 7.7255.79 54.83 0.96</td><td rowspan=1 colspan=1>[51.22 42.74 8.4854.65 53.30 1.35</td><td rowspan=1 colspan=1>|50.11 43.63 7.4852.30 51.73 0.57</td><td rowspan=1 colspan=1>|47.74 41.84 5.9050.59 49.62 0.97</td></tr><tr><td rowspan=1 colspan=1>TRADESTRADES+TE</td><td rowspan=1 colspan=1>[81.19 82.48 -1.29|83.86 83.97 -0.11</td><td rowspan=1 colspan=1>[53.32 50.25 3.0755.15 54.42 0.73</td><td rowspan=1 colspan=1>[52.44 48.67 3.7753.74 53.03 0.71</td><td rowspan=1 colspan=1>|49.88 48.14 1.74|50.77 50.63 0.14</td><td rowspan=1 colspan=1>49.03 46.80 2.2349.77 49.20 0.57</td></tr><tr><td rowspan=1 colspan=6>(a) The evaluation results on CIFAR-10.</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Natural AccuracyBest FinalDiff</td><td rowspan=1 colspan=1>PGD-10Best Final Diff</td><td rowspan=1 colspan=1>PGD-1000Best Final Diff</td><td rowspan=1 colspan=1>C&amp;W-1000Best Final Diff</td><td rowspan=1 colspan=1>AutoAttackBest Final Diff</td></tr><tr><td rowspan=1 colspan=1>PGD-ATPGD-AT+TE</td><td rowspan=1 colspan=1>57.54 57.510.0356.45 57.12 -0.67</td><td rowspan=1 colspan=1>29.40 21.75 7.6531.74 30.24 1.50</td><td rowspan=1 colspan=1>28.54 20.63 7.9131.27 29.80 1.47</td><td rowspan=1 colspan=1>27.06 21.17 5.8928.27 27.36 0.91</td><td rowspan=1 colspan=1>24.72 19.34 5.3826.30 25.34 0.96</td></tr><tr><td rowspan=1 colspan=1>TRADESTRADES+TE</td><td rowspan=1 colspan=1>57.98 56.321.6659.35 58.72 0.63</td><td rowspan=1 colspan=1>|29.93 27.70 2.23|31.09 30.12 0.97</td><td rowspan=1 colspan=1>29.51 26.93 2.58|230.54 29.45 1.09</td><td rowspan=1 colspan=1>[25.46 24.42 1.04|26.61 25.94 0.67</td><td rowspan=1 colspan=1>24.6123.40 1.2125.27 24.55 0.72</td></tr><tr><td rowspan=1 colspan=6>(b) The evaluation results on CIFAR-100.</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Natural AccuracyBest Final Diff</td><td rowspan=1 colspan=1>PGD-10Best Final Diff</td><td rowspan=1 colspan=1>PGD-1000Best Final Diff</td><td rowspan=1 colspan=1>C&amp;W-1000Best Final Diff</td><td rowspan=1 colspan=1>AutoAttackBest Final Diff</td></tr><tr><td rowspan=1 colspan=1>PGD-ATPGD-AT+TE</td><td rowspan=1 colspan=1>89.00 90.55 -1.5590.09 90.91 -0.82</td><td rowspan=1 colspan=1>[54.51 46.97 7.5459.74 59.05 0.69</td><td rowspan=1 colspan=1>[52.22 42.85 9.3757.7156.46 1.25</td><td rowspan=1 colspan=1>48.66 44.13 4.5354.5553.94 0.61</td><td rowspan=1 colspan=1>46.61 38.24 8.3751.44 50.61 0.83</td></tr><tr><td rowspan=1 colspan=1>TRADESTRADES+TE</td><td rowspan=1 colspan=1>90.88 91.30 -0.4289.01 88.52 0.49</td><td rowspan=1 colspan=1>[59.50 57.04 2.4659.81 58.49 1.32</td><td rowspan=1 colspan=1>[52.78 50.17 2.6158.24 56.66 1.58</td><td rowspan=1 colspan=1>[52.76 50.53 2.2354.00 53.24 0.76</td><td rowspan=1 colspan=1>40.36 38.88 1.4851.45 50.16 1.29</td></tr></table>
158
+
159
+ (c) The evaluation results on SVHN.
160
+
161
+ $$
162
+ \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { i = 1 } ^ { n } \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in S ( \mathbf { x } _ { i } ) } \left\{ \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } ) + w \cdot | | f _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) - \hat { \mathbf { p } } _ { i } | | _ { 2 } ^ { 2 } \right\} ,
163
+ $$
164
+
165
+ where $\hat { { \bf p } } _ { i }$ is the normalization of $\mathbf { p } _ { i }$ as a probability vector and $w$ is a balancing weight. TE can be similarly integrated with TRADES with the same regularization term. The network would learn to fit relatively easy samples with one-hot labels in the initial training stage, as shown in Fig. 7(a). After the learning rate decays, the network can keep assigning low confidence for hard samples with the regularization term in Eq. (7) and avoid fitting one-hot labels. Therefore, the proposed algorithm enables to learn under label noise in AT and alleviates the robust overfitting problem.
166
+
167
+ # 5 EMPIRICAL EVALUATION ON MITIGATING ROBUST OVERFITTING
168
+
169
+ In this section, we provide the experimental results on CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009), and SVHN (Netzer et al., 2011) datasets to validate the effectiveness of our proposed method. Code is available at https://github.com/dongyp13/memorization-AT.
170
+
171
+ Training details. We adopt the common setting that the perturbation budget is $\epsilon = 8 / 2 5 5$ under the $\ell _ { \infty }$ norm in most experiments. We consider PGD-AT and TRADES as two typical AT baselines and integrate the proposed TE approach into them, respectively. We use the ResNet-18 (He et al., 2016) model as the classifier in most experiments. In training, we use the 10-step PGD adversary with $\alpha = 2 / 2 5 5$ . The models are trained via the SGD optimizer with momentum 0.9, weight decay 0.0005, and batch size 128. For CIFAR-10/100, we set the learning rate as 0.1 initially which is decayed by 0.1 at 100 and 150 epochs with totally 200 training epochs. For SVHN, the learning rate starts from 0.01 with a cosine annealing schedule for a total number of 80 training epochs. In our method, We set $\eta = 0 . 9$ and $w = 3 0$ along a Gaussian ramp-up curve (Laine & Aila, 2017).
172
+
173
+ Evaluation results. We adopt PGD-10, PGD-1000, C&W-1000 (Carlini & Wagner, 2017), and AutoAttack (Croce & Hein, 2020b) for evaluating adversarial robustness rigorously. AutoAttack is a strong attack to evaluate model robustness, which is composed of an ensemble of diverse attacks, including APGD-CE (Croce & Hein, 2020b), APGD-DLR (Croce & Hein, 2020b), FAB (Croce & Hein, 2020a), and Square attack (Andriushchenko et al., 2020). To show the performance of robust overfitting, we report the test accuracy on the best checkpoint that achieves the highest robust test accuracy under PGD-10 and the final checkpoint, as well as the difference between these two checkpoints. The results of PGD-AT, TRADES, and the combinations of them with our proposed approach (denoted as PGD- $\mathbf { A T + T E }$ and TRADES ${ \bf \nabla } + { \bf T } { \bf E }$ ) on the CIFAR-10, CIFAR-100, and SVHN datasets are shown in Table 1.
174
+
175
+ We can observe that the differences between best and final test accuracies of our method are reduced to around $1 \%$ , while the accuracy gaps of PGDAT and TRADES are much larger. It indicates that our method largely eliminates robust overfitting. Due to being less affected by robust overfitting, our method achieves higher robust accuracies than the baselines. We also show the learning curves of these methods in Fig. 8. We consistently demonstrate the effectiveness of our method on different network architectures (including WRN-34-10
176
+
177
+ ![](images/60741a322624e7a344d48dd39e648d3bdbec90b00204725405a64e566413b5ab.jpg)
178
+ Figure 8: The natural and robust test accuracy curves (under PGD10) of PGD-AT, TRADES, and their extensions by integrating the proposed TE approach. The models are trained on CIFAR-10 under the $\ell _ { \infty }$ norm with $\epsilon = 8 / 2 5 5$ based on the ResNet-18 architecture.
179
+
180
+ and VGG-16) and threat models (including $\ell _ { 2 }$ norm), which will be shown in Appendix C.2.
181
+
182
+ Discussion and comparison with related works. Our method is kind of similar to the label smoothing (LS) technique, which is studied in AT (Pang et al., 2021). Recent works have also introduced the smoothness in training labels and model weights (Chen et al., 2021; Huang et al., 2020), which can alleviate robust overfitting to some extent. The significant difference between our work and them is that we provide a reasonable explanation for robust overfitting—one-hot labels are noisy for AT, while previous methods did not give such an explanation and could be viewed as solutions to our identified problem. To empirically compare with these methods, we conduct experiments on CIFAR-10 with the ResNet-18 network. Under the PGD-AT framework, we compare with the baseline PGD-AT, PGD-AT+LS, self-adaptive training (SAT) (Huang et al., 2020), and knowledge distillation with stochastic weight averaging (KD-SWA) (Chen et al., 2021). We also adopt the $C o$ - teaching approach (Han et al., 2018) adapted to PGD-AT, which jointly trains two models using the filtered samples given by each other. The results under the adopted attacks are presented in Table 2. Although various techniques can alleviate robust overfitting, our method achieves better robustness than the others, validating its effectiveness. For Co-teaching, though robust overfitting is alleviated, the performance is worse than our proposed method due to the reduction of training data.
183
+
184
+ Table 2: Test accuracy $( \% )$ of the proposed method and other methods on CIFAR-10 under the $\ell _ { \infty }$ norm with $\epsilon = 8 / 2 5 5$ based on the ResNet-18 architecture.
185
+
186
+ <table><tr><td>Method</td><td>Natural Accuracy Best Final 1Diff</td><td>PGD-10 Best</td><td>Final Diff</td><td>PGD-1000 Best Final Diff</td><td></td><td>C&amp;W-1000 Best</td><td>Final Diff</td><td>AutoAttack Best Final Diff</td></tr><tr><td>PGD-AT</td><td>83.75 84.82 -1.07</td><td>52.64 44.92</td><td>7.72</td><td>51.22</td><td>42.74 8.48</td><td></td><td>[50.11 43.63 7.48</td><td>47.74 41.84 5.90</td></tr><tr><td>PGD-AT+LS</td><td>82.68 85.16 -2.48</td><td>53.70 48.90 4.80</td><td></td><td>52.564 46.31</td><td>6.25</td><td></td><td>50.41 46.06 4.35</td><td>49.02 44.39 4.63</td></tr><tr><td>SAT</td><td>82.81 81.86 0.95</td><td>53.81 53.31</td><td>0.50</td><td>52.41 52.00</td><td>0.41</td><td>51.99 51.71</td><td></td><td>50.214</td></tr><tr><td>KD-SWA</td><td>84.84 85.26 -0.42</td><td>54.89</td><td></td><td></td><td></td><td></td><td>0.28</td><td>49.73 0.48</td></tr><tr><td>Co-teaching</td><td></td><td>53.80</td><td>1.09</td><td>53.31 52.45</td><td>0.86</td><td>51.48 50.91</td><td>0.57</td><td>50.42 49.83 0.59</td></tr><tr><td></td><td>81.94 82.22 -0.28</td><td>51.27 50.52</td><td>0.75</td><td>50.15 49.12</td><td>1.03</td><td></td><td>50.85 49.86 0.99</td><td>49.60 48.49 1.11</td></tr><tr><td>PGD-AT+TE</td><td>82.35 82.79 -0.44</td><td>55.79</td><td>54.83 0.96</td><td>54.65 53.30 1.35</td><td></td><td></td><td>52.30 51.73 0.57</td><td>50.59 49.62 0.97</td></tr></table>
187
+
188
+ # 6 CONCLUSION
189
+
190
+ In this paper, we demonstrate the capacity of DNNs to fit adversarial examples with random labels by exploring memorization in adversarial training, which also poses open questions on the convergence and generalization of adversarially trained models. We validate that some AT methods suffer from a gradient instability issue and robust generalization can hardly be explained by complexity measures. We further identify a significant drawback of memorization in AT related to the robust overfitting phenomenon—robust overfitting is caused by memorizing one-hot labels in adversarial training. We propose a new mitigation algorithm to address this issue, with the effectiveness validated extensively.
191
+
192
+ # ACKNOWLEDGEMENTS
193
+
194
+ This work was supported by the National Key Research and Development Program of China (2020AAA0106000, 2020AAA0104304, 2020AAA0106302), NSFC Projects (Nos. 61620106010, 62061136001, 61621136008, 62076147, U19B2034, U1811461, U19A2081), Beijing NSF Project (No. JQ19016), Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Alibaba Joint Research Program, Tsinghua Institute for Guo Qiang, Tsinghua-OPPO Joint Research Center for Future Terminal Technology.
195
+
196
+ # ETHICS STATEMENT
197
+
198
+ The existence of adversarial examples can pose severe security threats to machine learning and deep learning models when they are deployed to real-world applications. The vulnerability to adversarial examples could also lower the confidence of the public on machine learning techniques. Therefore, it is important to develop more robust models. As the most effective method for promoting model robustness, adversarial training (AT) has not been fully investigated. This paper aims to investigate the memorization effect of AT to facilitate a better understanding of its working mechanism. Some findings in this paper can be analyzed more deeply, including theoretical analysis of AT convergence, generalization, etc., which we leave to future work.
199
+
200
+ # REPRODUCIBILITY STATEMENT
201
+
202
+ Most of the experiments are easily reproducible. We provide the code for reproducing the results at https://github.com/dongyp13/memorization-AT.
203
+
204
+ # REFERENCES
205
+
206
+ Jean-Baptiste Alayrac, Jonathan Uesato, Po-Sen Huang, Alhussein Fawzi, Robert Stanforth, and Pushmeet Kohli. Are labels required for improving adversarial robustness? In Advances in Neural Information Processing Systems (NeurIPS), pp. 12214–12223, 2019.
207
+
208
+ Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning (ICML), pp. 242–252, 2019.
209
+
210
+ Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search. In European Conference on Computer Vision (ECCV), pp. 484–501, 2020.
211
+
212
+ Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. In International Conference on Machine Learning (ICML), pp. 254–263, 2018.
213
+
214
+ Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning (ICML), pp. 233–242, 2017.
215
+
216
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning (ICML), pp. 274–283, 2018.
217
+
218
+ Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems (NIPS), pp. 6240–6249, 2017.
219
+
220
+ Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machinelearning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849–15854, 2019.
221
+
222
+ Sébastien Bubeck, Yin Tat Lee, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. In International Conference on Machine Learning (ICML), pp. 831–840, 2019.
223
+
224
+ Yuan Cao and Quanquan Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
225
+
226
+ Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy $( S P )$ , pp. 39–57, 2017.
227
+
228
+ Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems (NeurIPS), pp. 11192–11203, 2019.
229
+
230
+ Tianlong Chen, Zhenyu Zhang, Sijia Liu, Shiyu Chang, and Zhangyang Wang. Robust overfitting may be mitigated by properly learned smoothening. In International Conference on Learning Representations (ICLR), 2021.
231
+
232
+ Zixiang Chen, Yuan Cao, Difan Zou, and Quanquan Gu. How much over-parameterization is sufficient to learn deep relu networks? In International Conference on Learning Representations (ICLR), 2020.
233
+
234
+ Minhao Cheng, Qi Lei, Pin-Yu Chen, Inderjit Dhillon, and Cho-Jui Hsieh. Cat: Customized adversarial training for improved robustness. arXiv preprint arXiv:2002.06789, 2020.
235
+
236
+ Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning (ICML), pp. 854–863, 2017.
237
+
238
+ Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning (ICML), pp. 1310–1320, 2019.
239
+
240
+ Francesco Croce and Matthias Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. In International Conference on Machine Learning (ICML), pp. 2196–2205, 2020a.
241
+
242
+ Francesco Croce and Matthias Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In International Conference on Machine Learning (ICML), pp. 2206–2216, 2020b.
243
+
244
+ Yinpeng Dong, Zhijie Deng, Tianyu Pang, Jun Zhu, and Hang Su. Adversarial distributional training for robust deep learning. In Advances in Neural Information Processing Systems (NeurIPS), pp. 8270–8283, 2020a.
245
+
246
+ Yinpeng Dong, Qi-An Fu, Xiao Yang, Tianyu Pang, Hang Su, Zihao Xiao, and Jun Zhu. Benchmarking adversarial robustness on image classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 321–331, 2020b.
247
+
248
+ Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning (ICML), pp. 1675–1685, 2019.
249
+
250
+ Vitaly Feldman. Does learning require memorization? a short tale about a long tail. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pp. 954–959, 2020.
251
+
252
+ Vitaly Feldman and Chiyuan Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2881–2891, 2020.
253
+
254
+ Ruiqi Gao, Tianle Cai, Haochuan Li, Cho-Jui Hsieh, Liwei Wang, and Jason D Lee. Convergence of adversarial training in overparametrized neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 13029–13040, 2019.
255
+
256
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
257
+
258
+ Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593, 2020.
259
+
260
+ Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems (NeurIPS), pp. 8527–8537, 2018.
261
+
262
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
263
+
264
+ Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning (ICML), pp. 2712–2721, 2019.
265
+
266
+ Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4700–4708, 2017.
267
+
268
+ Lang Huang, Chao Zhang, and Hongyang Zhang. Self-adaptive training: beyond empirical risk minimization. In Advances in Neural Information Processing Systems (NeurIPS), pp. 19365– 19376, 2020.
269
+
270
+ Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning (ICML), pp. 2304–2313, 2018.
271
+
272
+ Yiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. In International Conference on Learning Representations (ICLR), 2020.
273
+
274
+ Maurice G Kendall. A new measure of rank correlation. Biometrika, 30(1/2):81–93, 1938.
275
+
276
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
277
+
278
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
279
+
280
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In International Conference on Learning Representations (ICLR), 2017.
281
+
282
+ Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In International Conference on Learning Representations (ICLR), 2017.
283
+
284
+ Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems (NeurIPS), pp. 6389–6399, 2018.
285
+
286
+ Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1778–1787, 2018.
287
+
288
+ Chen Liu, Mathieu Salzmann, Tao Lin, Ryota Tomioka, and Sabine Süsstrunk. On the loss landscape of adversarial training: Identifying challenges and how to overcome them. In Advances in Neural Information Processing Systems (NeurIPS), 2020a.
289
+
290
+ Shengchao Liu, Dimitris Papailiopoulos, and Dimitris Achlioptas. Bad global minima exist and sgd can reach them. In Advances in Neural Information Processing Systems (NeurIPS), 2020b.
291
+
292
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations (ICLR), 2018.
293
+
294
+ Hartmut Maennel, Ibrahim Alabdulmohsin, Ilya Tolstikhin, Robert JN Baldock, Olivier Bousquet, Sylvain Gelly, and Daniel Keysers. What do neural networks learn when trained with random labels? In Advances in Neural Information Processing Systems (NeurIPS), pp. 19693–19704, 2020.
295
+
296
+ Chengzhi Mao, Ziyuan Zhong, Junfeng Yang, Carl Vondrick, and Baishakhi Ray. Metric learning for adversarial robustness. In Advances in Neural Information Processing Systems (NeurIPS), pp. 480–491, 2019.
297
+
298
+ Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Jonathan Uesato, and Pascal Frossard. Robustness via curvature regularization, and vice versa. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9078–9086, 2019.
299
+
300
+ Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in Neural Information Processing Systems (NIPS), pp. 1196–1204, 2013.
301
+
302
+ Yurii E Nesterov. A method for solving the convex programming problem with convergence rate o $( 1 / \mathrm { k } ^ { \cdot } 2 )$ . In Dokl. akad. nauk Sssr, volume 269, pp. 543–547, 1983.
303
+
304
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
305
+
306
+ Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Conference on Learning Theory (COLT), pp. 1376–1401, 2015.
307
+
308
+ Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nati Srebro. Exploring generalization in deep learning. In Advances in Neural Information Processing Systems (NIPS), pp. 5947–5956, 2017.
309
+
310
+ Roman Novak, Yasaman Bahri, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Sensitivity and generalization in neural networks: an empirical study. In International Conference on Learning Representations (ICLR), 2018.
311
+
312
+ Tianyu Pang, Kun Xu, Chao Du, Ning Chen, and Jun Zhu. Improving adversarial robustness via promoting ensemble diversity. In International Conference on Machine Learning (ICML), pp. 4970–4979, 2019.
313
+
314
+ Tianyu Pang, Kun Xu, Yinpeng Dong, Chao Du, Ning Chen, and Jun Zhu. Rethinking softmax crossentropy loss for adversarial robustness. In International Conference on Learning Representations (ICLR), 2020.
315
+
316
+ Tianyu Pang, Xiao Yang, Yinpeng Dong, Hang Su, and Jun Zhu. Bag of tricks for adversarial training. In International Conference on Learning Representations (ICLR), 2021.
317
+
318
+ Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1944–1952, 2017.
319
+
320
+ Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Krishnamurthy Dvijotham, Alhussein Fawzi, Soham De, Robert Stanforth, and Pushmeet Kohli. Adversarial robustness through local linearization. In Advances in Neural Information Processing Systems (NeurIPS), pp. 13847– 13856, 2019.
321
+
322
+ Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In International Conference on Machine Learning (ICML), pp. 4334–4343, 2018.
323
+
324
+ Leslie Rice, Eric Wong, and Zico Kolter. Overfitting in adversarially robust deep learning. In International Conference on Machine Learning (ICML), pp. 8093–8104, 2020.
325
+
326
+ Amartya Sanyal, Puneet K. Dokania, Varun Kanade, and Philip Torr. How benign is benign overfitting ? In International Conference on Learning Representations (ICLR), 2021.
327
+
328
+ Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In Advances in Neural Information Processing Systems (NeurIPS), pp. 5014–5026, 2018.
329
+
330
+ Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! In Advances in Neural Information Processing Systems (NeurIPS), pp. 3358–3369, 2019.
331
+
332
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
333
+
334
+ David Stutz, Matthias Hein, and Bernt Schiele. Confidence-calibrated adversarial training: Generalizing to unseen attacks. In International Conference on Machine Learning (ICML), pp. 9155– 9166, 2020.
335
+
336
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations (ICLR), 2014.
337
+
338
+ Zhuozhuo Tu, Jingwei Zhang, and Dacheng Tao. Theoretical analysis of adversarial learning: A minimax approach. In Advances in Neural Information Processing Systems (NeurIPS), pp. 12280–12290, 2019.
339
+
340
+ Yisen Wang, Xingjun Ma, James Bailey, Jinfeng Yi, Bowen Zhou, and Quanquan Gu. On the convergence and robustness of adversarial training. In International Conference on Machine Learning (ICML), pp. 6586–6595, 2019.
341
+
342
+ Yisen Wang, Difan Zou, Jinfeng Yi, James Bailey, Xingjun Ma, and Quanquan Gu. Improving adversarial robustness requires revisiting misclassified examples. In International Conference on Learning Representations (ICLR), 2020.
343
+
344
+ Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning (ICML), pp. 5286–5295, 2018.
345
+
346
+ Eric Wong, Leslie Rice, and J. Zico Kolter. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations (ICLR), 2020.
347
+
348
+ Dongxian Wu, Shu-Tao Xia, and Yisen Wang. Adversarial weight perturbation helps robust generalization. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2958–2969, 2020.
349
+
350
+ Cihang Xie and Alan Yuille. Intriguing properties of adversarial training. In International Conference on Learning Representations (ICLR), 2020.
351
+
352
+ Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 501–509, 2019.
353
+
354
+ Dong Yin, Kannan Ramchandran, and Peter Bartlett. Rademacher complexity for adversarially robust generalization. In International Conference on Machine Learning (ICML), pp. 7085–7094, 2018.
355
+
356
+ Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2403– 2412, 2018.
357
+
358
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference (BMVC), 2016.
359
+
360
+ Runtian Zhai, Tianle Cai, Di He, Chen Dan, Kun He, John Hopcroft, and Liwei Wang. Adversarially robust generalization just requires more unlabeled data. arXiv preprint arXiv:1906.00555, 2019.
361
+
362
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations (ICLR), 2017.
363
+
364
+ Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Painless adversarial training using maximal principle. In Advances in Neural Information Processing Systems (NeurIPS), pp. 227–238, 2019a.
365
+
366
+ Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning (ICML), pp. 7472–7482, 2019b.
367
+
368
+ Yi Zhang, Orestis Plevrakis, Simon S Du, Xingguo Li, Zhao Song, and Sanjeev Arora. Overparameterized adversarial training: An analysis overcoming the curse of dimensionality. In Advances in Neural Information Processing Systems (NeurIPS), pp. 679–688, 2020.
369
+
370
+ Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in Neural Information Processing Systems (NeurIPS), pp. 8778– 8788, 2018.
371
+
372
+ Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep relu networks. Machine Learning, 109(3):467–492, 2020.
373
+
374
+ # A ADDITIONAL EXPERIMENTS ON MEMORIZATION IN AT
375
+
376
+ In this section, we provide additional experiments on the memorization behavior in AT. All of the experiments are conducted on NVIDIA 2080 Ti GPUs. The source code of this paper is submitted as the supplementary material, and will be released after the review process.
377
+
378
+ # A.1 MEMORIZATION OF PGD-AT AND TRADES
379
+
380
+ # A.1.1 DIFFERENT TRAINING SETTINGS
381
+
382
+ We first demonstrate that the different memorization behaviors between PGD-AT and TRADES can be generally observed under various settings.
383
+
384
+ ![](images/f19db38b34f9d21f917d4e7209797991e6d8022a18684aa1716a72f9d5bb1b70.jpg)
385
+ Figure A.1: The natural and robust training accuracies of PGD-AT and TRADES on CIFAR-100 when trained on true or random labels.
386
+
387
+ ![](images/ab43ab6fdf6a00ae48be8412a6bf692a54f127080bef5aa0f6acc1017767cdf9.jpg)
388
+ Figure A.2: The natural and robust training accuracies of PGD-AT and TRADES on SVHN when trained on true or random labels.
389
+
390
+ Datasets. Similar to Fig. 2, we show the accuracy curves of PGD-AT and TRADES when trained on true or random labels on CIFAR-100 (Krizhevsky & Hinton, 2009) in Fig. A.1 and on SVHN (Netzer et al., 2011) in Fig. A.2. We consistently observe that PGD-AT fails to converge with random labels, while TRADES can successfully converge, although it does not reach $1 0 0 \%$ accuracy on SVHN.
391
+
392
+ Model architectures. We then consider other network architectures, including the DenseNet-121 model (Huang et al., 2017) and the deep layer aggregation (DLA) model (Yu et al., 2018). The corresponding results are shown in Fig. A.3. The similar results can be observed, although it may take more training epochs to make TRADES converge with the smaller DenseNet-121 network.
393
+
394
+ ![](images/d5eda5387f2599f593cc865fb51b857942018ca28c5b08dc4d08e7ea117e0822.jpg)
395
+ Figure A.3: The natural and robust training accuracies of PGD-AT and TRADES on CIFAR-10 with different architectures when trained on random labels.
396
+
397
+ ![](images/0dd2be9978c8615aa93dca9fe22a4a57d6426eb8bbad4886efdf4abf22fbf040.jpg)
398
+ Figure A.4: The natural and robust training accuracies of PGD-AT and TRADES on CIFAR-10 under the $\ell _ { 2 }$ -norm threat model when trained on random labels.
399
+
400
+ Threat models. We further consider the $\ell _ { 2 }$ -norm threat model, in which we set $\epsilon = 1 . 0$ and $\alpha =$ 0.25 in the 10-step PGD adversary. The learning curves of PGD-AT and TRADES are shown in Fig. A.4, which also exhibit similar results.
401
+
402
+ Perturbation budget. We study the memorization behavior in AT with different perturbation budgets $\epsilon$ . In Fig. A.5, we show that when the perturbation budget is $\epsilon = 1 6 / 2 5 5$ $\ell _ { \infty }$ norm), TRADES trained on random labels can still converge. But when we set a larger budget (e.g., $\epsilon = 3 2 / 2 5 5 )$ , both PGD-AT and TRADES cannot obtain near $100 \%$ robust training accuracy. We also find under this condition, even AT trained on true labels cannot get $100 \%$ robust training accuracy, indicating that the gradient instability issue discussed in Sec. 3.2 results in the convergence problem.
403
+
404
+ In summary, our empirical observation that PGD-AT and TRADES perform differently when trained on random labels is general across multiple datasets, network architectures, and threat models.
405
+
406
+ # A.1.2 LEARNING CURVES UNDER DIFFERENT NOISE RATES
407
+
408
+ We show the learning curves of PGD-AT and TRADES under varying levels of label noise in Fig. A.6 and Fig. A.7, respectively. In this experiment, we adopt the weight decay and data augmentation for regularizations. We can see that the network achieves maximum accuracy on the test set before fitting the noisy training set. Thus the model learns easy and simple patterns first before fitting the noise, similar to the finding in ST (Arpit et al., 2017). It can also be observed that under $8 0 \%$ noise rate, PGD-AT fails to converge. Note that when the noise rate is $0 \%$ , the network is trained on true labels, but the robust test accuracy also decreases after a certain epoch. This phenomenon is called robust overfitting (Rice et al., 2020), which is studied in Sec. 4.
409
+
410
+ ![](images/b8f2b90ad7da75a795de9b520b62604bec856d992ebf18e5834ea338369802a7.jpg)
411
+ Figure A.5: The natural and robust training accuracies of PGD-AT and TRADES on CIFAR-10 with $\epsilon =$ 16/255 when trained on true or random labels.
412
+
413
+ ![](images/c0d0ee5a98572dca3b5f5568437605b62988ed77e18e50ccb84f76991a4b749a.jpg)
414
+ Figure A.6: Accuracy curves of PGD-AT under different noise rates on CIFAR-10.
415
+
416
+ ![](images/288d2a0eb84f973a11b7f0ea2c84c7f1928c3f415d17776a18ce7d82c06cbc5b.jpg)
417
+ Figure A.7: Accuracy curves of TRADES under different noise rates on CIFAR-10.
418
+
419
+ # A.1.3 EXPLICIT REGULARIZATIONS
420
+
421
+ We consider three common regularizers, including data augmentation, weight decay, and dropout (Srivastava et al., 2014). We train the models based on TRADES on true and random labels with several combinations of explicit regularizers. As shown in Table A.1, the explicit regularizations do not significantly affect the model’s ability to memorize adversarial examples with random labels.
422
+
423
+ # A.2 MORE RESULTS ON THE CONVERGENCE OF AT
424
+
425
+ # A.2.1 TRAINING CONFIGURATIONS
426
+
427
+ We study different training configurations on PGD-AT with random labels. We consider various factors as follows. These experiments are conducted on CIFAR-10.
428
+
429
+ • Model capacity. Recent work suggests that model size is a critical factor to obtain better robustness (Madry et al., 2018; Xie & Yuille, 2020). A possible reason why PGD-AT fails to converge with random labels may also be the insufficient model capacity. Therefore, we try to use larger models, including WRN-34-20 (which is used in Rice et al. (2020)) and WRN-70-16 (which is used in Gowal et al. (2020)). However, using larger models under this setting cannot solve the convergence problem.
430
+
431
+ Table A.1: The training accuracy, test accuracy, and generalization gap $( \% )$ of TRADES when trained on true or random labels, with and without explicit regularizations, including data augmentation (random crop and flip), weight decay (0.0002), and dropout (0.2).
432
+
433
+ <table><tr><td>Labels</td><td>Data Augmentation</td><td>Weight Decay</td><td>Dropout</td><td>Training Accuracy Natural</td><td>Robust</td><td>Test Accuracy Natural I</td><td>Robust</td><td>Generalization Gap Natural</td><td>Robust</td></tr><tr><td>true</td><td></td><td>X</td><td>X</td><td>99.73</td><td>99.65</td><td>77.53</td><td>37.47</td><td>22.20</td><td>62.18</td></tr><tr><td>true</td><td>X</td><td></td><td>×</td><td>99.57</td><td>97.03</td><td>82.91</td><td>45.37</td><td>16.93</td><td>51.66</td></tr><tr><td>true</td><td>×</td><td>X</td><td>×</td><td>99.59</td><td>99.53</td><td>77.31</td><td>38.94</td><td>22.28</td><td>60.59</td></tr><tr><td>true</td><td>X</td><td>X</td><td>√</td><td>99.65</td><td>99.40</td><td>79.96</td><td>39.86</td><td>19.69</td><td>59.54</td></tr><tr><td>true</td><td>√</td><td>√</td><td>X</td><td>99.50</td><td>97.28</td><td>84.26</td><td>49.16</td><td>15.24</td><td>48.12</td></tr><tr><td>true</td><td>X</td><td>√</td><td>√</td><td>99.41</td><td>99.20</td><td>80.28</td><td>41.64</td><td>19.13</td><td>57.56</td></tr><tr><td>random</td><td></td><td>X</td><td>×</td><td>99.80</td><td>99.55</td><td>9.79</td><td>0.15</td><td>90.01</td><td>99.40</td></tr><tr><td>random</td><td>X</td><td>X</td><td>X</td><td>99.36</td><td>86.10</td><td>9.71</td><td>0.24</td><td>89.65</td><td>85.86</td></tr><tr><td>random</td><td>X</td><td>√</td><td>X</td><td>99.84</td><td>99.53</td><td>10.13</td><td>0.23</td><td>89.71</td><td>99.30</td></tr><tr><td>random</td><td>X</td><td>X</td><td>√</td><td>99.15</td><td>92.23</td><td>9.04</td><td>0.17</td><td>90.11</td><td>92.06</td></tr><tr><td>random</td><td>√</td><td></td><td>X</td><td>99.25</td><td>69.62</td><td>9.67</td><td>0.24</td><td>89.58</td><td>69.38</td></tr><tr><td>random</td><td>×</td><td>【</td><td>√</td><td>99.38</td><td>81.57</td><td>9.54</td><td>0.19</td><td>89.84</td><td>81.38</td></tr></table>
434
+
435
+ • Attack steps. We adopt the weaker FGSM adversary (Goodfellow et al., 2015) for training. We also adopt the random initialization trick as argued in Wong et al. (2020) and adjust the step size as $\alpha = 1 0 / 2 5 5$ , yielding the fast adversarial training method (Wong et al., 2020). However, fast AT still cannot converge.
436
+
437
+ • Optimizer. We try to use various optimizers, including the SGD momentum optimizer, the Adam optimizer (Kingma & Ba, 2015), and the nesterov optimizer (Nesterov, 1983); different learning rate schedules, including the piecewise decay and cosine schedules, and different learning rates (0.1 and 0.01), but none of these attempts make PGD-AT converge.
438
+
439
+ • Perturbation budget. The perturbation budget $\epsilon$ is an important factor to affect the convergence of PGD-AT. When $\epsilon$ approaches 0, PGD-AT would degenerate into standard training, which can easily converge (Zhang et al., 2017). Hence we try different values of $\epsilon$ , and find that PGD-AT can converge with a smaller $\epsilon$ (e.g., $\epsilon = 1 / 2 5 5 )$ but cannot converge when $\epsilon \geq 2 / 2 5 5$ .
440
+
441
+ # A.2.2 GRADIENT STABILITY UNDER COSINE SIMILARITY
442
+
443
+ In Fig. 4(a), we show the gradient change of PGD-AT, TRADES, and the clean CE loss under the $\ell _ { 2 }$ distance. We further show the cosine similarity between the gradients at $\pmb { \theta }$ and $\pm \lambda \mathbf { d }$ in Fig. A.8. The cosine similarity is also averaged over all data samples. The results based on cosine similarity are consistent with the results based on the $\ell _ { 2 }$ distance, showing that the gradient of PGD-AT changes more abruptly.
444
+
445
+ # A.2.3 THE FAILURES OF AT UNDER REALISTIC SETTINGS
446
+
447
+ We find that some AT methods (e.g., PGD-AT) suffer from a gradient instability issue, which results in the convergence problem when trained on random labels. Under other realistic setting, our analysis may also be valuable.
448
+
449
+ First, PGD-AT fails to converge under $80 \%$ noise rate. We think that the unstable gradients can overwhelm the useful gradients given by clean examples. To prove it, we train the models under $80 \%$ uniform label noise, by either PGD-AT or standard training (ST) on natural examples. We then select 100 training images with wrong labels and another 100 training images with true labels for evaluation. Similarly, we calculate the gradient norm of the cross-entropy loss w.r.t. model parameters of each method. We show the results in Fig. A.9. For AT, the gradient norm of clean examples is larger than that of noisy examples at beginning, which makes the model learn to classify. However, for PGD-AT, the gradient norm of clean examples is almost the same as that of noisy examples (the two curves overlap together). And the unstable gradients provided by noisy examples would overwhelm the useful gradients given by clean examples, making the network fail to converge.
450
+
451
+ ![](images/f021ae54520ee3adda29ecf24637ed8b28ffaf88f6e7e183a2961d84a72d1b2d.jpg)
452
+ Figure A.8: The cosine similarity between the gradients at $\pmb \theta$ and $\pmb \theta + \lambda \mathbf d$ of different losses, where $\pmb { \theta }$ are initialized, $\lambda \in [ - 0 . 0 5 , 0 . 0 5 ]$ .
453
+
454
+ ![](images/0901b0009d3d3b6dec3a4207d30e08d232049dda50c62a32a48a055c282f2f6a.jpg)
455
+ Figure A.9: The gradient norm of PGD-AT and ST given clean examples or noisy examples, when trained on $80 \%$ uniform label noise.
456
+
457
+ Second, when the perturbation budget is large (e.g., $\epsilon = 6 4 / 2 5 5 )$ , PGD-AT cannot converge with true labels, while TRADES can achieve about $5 0 \%$ training accuracies. This can also be explained by our convergence analysis that the gradient is very unstable in PGD-AT with a larger perturbation budget, making it fail to converge.
458
+
459
+ # A.3 MORE DISCUSSIONS ON THE GENERALIZATION OF AT
460
+
461
+ As shown in Table A.1, when trained on true labels, although the regularizers can help to reduce the generalization gap, the model without any regularization can still generalize non-trivially. The three explicit regularizations do not significantly affect the model’s ability to memorize adversarial examples with random labels. In consequence, the explicit regularizers are not the adequate explanation of generalization. By inspecting the learning dynamics of AT under different noise rates in Fig. A.6 and Fig. A.7, the network achieves maximum accuracy on the test set before fitting the noisy training set, meaning that the model learns simple patterns (i.e., clean data) before memorizing the hard examples with wrong labels, similar to the observation in standard training (Arpit et al., 2017). The results suggest that optimization by itself serves as an implicit regularizer to find a model with good generalization performance.
462
+
463
+ ![](images/3dbf668e1cf92664ba56b407dece84d8e78f9d83e2f3c78c5793e23d3a2af1a1.jpg)
464
+ Figure A.10: The natural and robust testing accuracies of TRADES on CIFAR-10 with different initialization strategies and training methods.
465
+
466
+ A recent work (Liu et al., 2020b) points out that in standard training, pre-training on random labels can lead to substantial performance degeneration of subsequent SGD training on true labels, while adding regularizations can overcome the bad initialization caused by pre-training with random labels. In this paper, we further investigate whether this finding can generalize to adversarial training.
467
+
468
+ As PGD-AT cannot converge with random labels, we adopt TRADES to conduct experiments. Following Liu et al. (2020b), we consider two initialization strategies — random initialization and adversarial initialization generated by training on random labeling of the training data. We also consider two training methods — vanilla SGD training and SOTA SGD training with data augmentation (random crops and flips), weight decay, and momentum. The results are shown in Fig. A.10. It can be seen that with vanilla SGD, the adversarial initialization can lead to worse performance than the random initialization. But with the regularization techniques, the models with different initializations converge to nearly the same test accuracy. The results are consistent with the findings in Liu et al. (2020b).
469
+
470
+ # B PROOF OF THEOREM 1
471
+
472
+ Proof. Recall that $\begin{array} { r } { \mathcal { I } ( \mathbf { x } , y , \pmb { \theta } ) = \operatorname* { m a x } _ { \mathbf { x } ^ { \prime } \in S ( \mathbf { x } ) } \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) , y ) } \end{array}$ is the adversarial loss of PGD-AT. First, we have
473
+
474
+ $$
475
+ \begin{array} { r l } & { \quad \| \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 1 } ) - \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 2 } ) \| _ { 2 } } \\ & { = \| \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 1 } ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( { \bf x } ) , y ) - } \\ & { \quad \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 2 } ) + \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( { \bf x } ) , y ) + } \\ & { \quad \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( { \bf x } ) , y ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( { \bf x } ) , y ) \| _ { 2 } } \\ & { \le \| \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 1 } ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( { \bf x } ) , y ) \| _ { 2 } + } \\ & { \quad \| \nabla _ { \theta } \mathcal { I } ( { \bf x } , y , \theta _ { 2 } ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( { \bf x } ) , y ) \| _ { 2 } + } \\ & { \quad \| \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( { \bf x } ) , y ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( { \bf x } ) , y ) \| _ { 2 } . } \end{array}
476
+ $$
477
+
478
+ From the assumption, for any $\mathbf { x } \in \mathbb { R } ^ { d }$ and $\mathbf { x } ^ { \prime } \in { \mathcal { S } } ( \mathbf { x } )$ , we have
479
+
480
+ $$
481
+ \| \nabla _ { \pmb { \theta } } \mathcal { L } \big ( f _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) , y \big ) - \nabla _ { \pmb { \theta } } \mathcal { L } \big ( f _ { \pmb { \theta } } ( \mathbf { x } ) , y \big ) \| _ { 2 } \leq K \| \mathbf { x } ^ { \prime } - \mathbf { x } \| _ { p } \leq \epsilon K ,
482
+ $$
483
+
484
+ due to the definition of $\boldsymbol { S } ( \mathbf { x } )$ . We also note that $\mathcal { I } ( \mathbf { x } , y , \pmb { \theta } )$ is the maximal cross-entropy loss $\mathcal { L }$ within $\boldsymbol { S } ( \mathbf { x } )$ , such that we have
485
+
486
+ $$
487
+ \begin{array} { r } { \| \nabla _ { \theta } \mathcal { I } ( \mathbf { x } , y , \pmb { \theta } ) - \nabla _ { \theta } \mathcal { L } ( f _ { \pmb { \theta } } ( \mathbf { x } ) , y ) \| _ { 2 } \le \epsilon K . } \end{array}
488
+ $$
489
+
490
+ Combining Eq. (B.1) and Eq. (B.2), we can obtain Eq. (5).
491
+
492
+ Note that the bound is tight since the all the equalities can be reached.
493
+
494
+ Remark 1. We note that a recent work (Liu et al., 2020a) gives a similar result on gradient stability. The difference is that they assume the loss function satisfies an additional Lipschitzian smoothness condition as
495
+
496
+ $$
497
+ \begin{array} { r } { \| \nabla _ { \pmb \theta } \mathcal { L } \big ( f _ { \pmb \theta _ { 1 } } ( \mathbf { x } ) , y \big ) - \nabla _ { \pmb \theta } \mathcal { L } \big ( f _ { \pmb \theta _ { 2 } } ( \mathbf { x } ) , y \big ) \| _ { 2 } \leq K _ { \pmb \theta } \| \pmb \theta _ { 1 } - \pmb \theta _ { 2 } \| _ { 2 } , } \end{array}
498
+ $$
499
+
500
+ where $K _ { \theta }$ is another constant. Then they prove that
501
+
502
+ $$
503
+ \begin{array} { r } { \| \nabla _ { \pmb { \theta } } \mathcal { I } ( \mathbf { x } , y , \pmb { \theta } _ { 1 } ) - \nabla _ { \pmb { \theta } } \mathcal { I } ( \mathbf { x } , y , \pmb { \theta } _ { 2 } ) \| _ { 2 } \leq K _ { \pmb { \theta } } \| \pmb { \theta } _ { 1 } - \pmb { \theta } _ { 2 } \| _ { 2 } + 2 \epsilon K . } \end{array}
504
+ $$
505
+
506
+ It can be noted that with this new assumption, we can simply obtain this result by Theorem 1.
507
+ Therefore, Theorem 1 is a more general result of the previous one.
508
+
509
+ # B.1 THEORETICAL ANALYSIS FOR TRADES
510
+
511
+ Note that TRADES adopts the $\mathrm { K L }$ divergence in its adversarial loss. The KL divergence is defined on two predicted probability distributions over all classes, as
512
+
513
+ $$
514
+ \mathcal { D } ( f _ { \pmb { \theta } } ( \mathbf { x } ) \| f _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) ) = \sum _ { y \in \{ 1 , \dots , C \} } f _ { \pmb { \theta } } ( \mathbf { x } ) _ { y } \cdot \log \frac { f _ { \pmb { \theta } } ( \mathbf { x } ) _ { y } } { f _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) _ { y } } .
515
+ $$
516
+
517
+ However, based on the local Lipschitz continuity assumption of the clean cross-entropy loss (which is only concerned with the predicted probability of the true class) in Eq. (4), we cannot derive a similar theoretical bound on the gradient stability of TRADES as in Eq. (5). Therefore, we need to make a different assumption on the KL divergence. For example, suppose the gradient of the KL divergence satisfies
518
+
519
+ $$
520
+ \begin{array} { r } { \| \nabla _ { \theta } \mathcal { D } \big ( f _ { \pmb { \theta } } ( \mathbf { x } ) \| f _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) \big ) \| _ { 2 } \leq K ^ { \prime } \| \mathbf { x } ^ { \prime } - \mathbf { x } \| _ { p } , } \end{array}
521
+ $$
522
+
523
+ for any $\mathbf { x } \in \mathbb { R } ^ { d }$ , $\mathbf { x } ^ { \prime } \in S ( \mathbf { x } )$ , and any $\pmb \theta$ , where $K ^ { \prime }$ is another constant. We denote the adversarial loss of TRADES as $\mathcal { I } ^ { \prime } ( \mathbf { x } , y , \pmb { \theta } )$ , then we have
524
+
525
+ $$
526
+ \begin{array} { r l } & { \quad \| \nabla _ { \theta } \mathcal { I } ^ { \prime } ( \mathbf { x } , y , \theta _ { 1 } ) - \nabla _ { \theta } \mathcal { I } ^ { \prime } ( \mathbf { x } , y , \theta _ { 1 } ) \| _ { 2 } } \\ & { { \le } \| \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( \mathbf { x } ) , y ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( \mathbf { x } ) , y ) \| _ { 2 } + } \\ & { \quad \beta \| \nabla _ { \theta } \underset { \mathbf { x } ^ { \prime } \in S ( \mathbf { x } ) } { \operatorname* { m a x } } \mathcal { D } ( f _ { \theta _ { 1 } } ( \mathbf { x } ) \| f _ { \theta _ { 1 } } ( \mathbf { x } ^ { \prime } ) ) \| _ { 2 } + } \\ & { \quad \beta \| \nabla _ { \theta } \underset { \mathbf { x } ^ { \prime } \in S ( \mathbf { x } ) } { \operatorname* { m a x } } \mathcal { D } ( f _ { \theta _ { 2 } } ( \mathbf { x } ) \| f _ { \theta _ { 2 } } ( \mathbf { x } ^ { \prime } ) ) \| _ { 2 } } \\ & { { \le } \| \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 1 } } ( \mathbf { x } ) , y ) - \nabla _ { \theta } \mathcal { L } ( f _ { \theta _ { 2 } } ( \mathbf { x } ) , y ) \| _ { 2 } + 2 \beta \epsilon K ^ { \prime } . } \end{array}
527
+ $$
528
+
529
+ Although we can derive a similar bound on gradient stability of TRADES, this bound is not directly comparable to Eq. (5) since we cannot find the relationship between $K$ and $K ^ { \prime }$ . However, our empirical analysis on gradient magnitude in Sec. 3.2 has shown that TRADES is dominated by the clean cross-entropy loss at the initial training epochs, thus the gradient stability of the TRADES loss will be similar to that of the clean cross-entropy loss, as also revealed in Fig. 4(a). Therefore, the gradient of TRADES would be relatively stable.
530
+
531
+ # C FULL EXPERIMENTS ON ROBUST OVERFITTING
532
+
533
+ ![](images/13c0aeac5b6d6469ab512f780639816145991fbdb77d1644892db2a745a00257.jpg)
534
+
535
+ ![](images/cb7c1c3999c2c48ccfdd8bcf6e61ae9ce9ad5790e205e2f5ab4fbf7138569af3.jpg)
536
+ Figure C.1: The robust test accuracy of TRADES under various perturbation budgets $\epsilon$ .
537
+ Figure C.2: The adversarial loss of WRN-28-10 and ResNet-18 trained by PGD-AT on 500 samples sorted by the loss of the first model (i.e., WRN-28-10).
538
+
539
+ First, we show the robust test accuracy curves of TRADES under various perturbation budgets in Fig. C.1. It can also be observed that when the perturbation budget is small, robust overfitting does not occur.
540
+
541
+ Second, we show that the “hard” training examples with higher adversarial loss values are consistent across different model architectures. We train one WRN-28-10 model and one ResNet-18 model based on PGD-AT. We then calculate the adversarial loss for each training sample for these two models. We show the adversarial loss on 500 samples sorted by the loss of the first model (i.e., WRN28-10) in Fig. C.2. It can be seen that the samples with lower adversarial losses of the first model also have relatively lower losses of the second one and vice versa. The Kendall’s rank coefficient of the adversarial loss between the two models is 0.78 in this case.
542
+
543
+ Third, we visualize the hard training examples with high adversarial loss values in Fig. C.3. It can be seen that these examples are difficult to recognize and their labels may be wrong. Therefore, the one-hot labels for these hard training examples can be noisy for AT, leading to the robust overfitting problem.
544
+
545
+ ![](images/92f5d7ecf2d3f0f41009d2c4475fa2744d7e8de93bfef4dd3f1014653692e336.jpg)
546
+ Figure C.3: The hard training examples with high adversarial loss values.
547
+
548
+ Table C.1: Test accuracy $( \% )$ of several methods using different model architectures and threat models. We choose the best checkpoint according to the highest robust accuracy on the test set under PGD-10.
549
+
550
+ <table><tr><td rowspan="2">Methods</td><td rowspan="2">Networks</td><td rowspan="2">Norms</td><td colspan="3">Natural Accuracy</td><td colspan="3">PGD-10</td></tr><tr><td>Best</td><td>Final</td><td>Diff</td><td>Best</td><td>Final</td><td>Diff</td></tr><tr><td>PGD-AT PGD-AT+TE PGD-AT</td><td>WRN-34-10 WRN-34-10 VGG-16</td><td>lo (∈=8/255)</td><td>86.58 85.43 79.60</td><td>86.83 85.10</td><td>-0.25 0.33</td><td>55.83 59.30</td><td>49.52 56.63</td><td>6.31 2.67</td></tr><tr><td>PGD-AT+TE PGD-AT</td><td>VGG-16</td><td></td><td>78.19 88.82</td><td>81.26 79.13</td><td>-1.66 -0.94</td><td>48.52 52.06</td><td>43.02 51.29</td><td>5.50 0.77</td></tr><tr><td></td><td></td><td></td><td></td><td>88.96</td><td>-0.14</td><td>69.05</td><td>65.96</td><td>3.09</td></tr><tr><td>PGD-AT+TE</td><td></td><td></td><td>87.95</td><td>88.20</td><td></td><td></td><td></td><td>0.65</td></tr><tr><td></td><td>ResNet-18</td><td>l2 (∈ =128/255)</td><td></td><td></td><td>-0.25</td><td>72.58</td><td>71.93</td><td></td></tr><tr><td>TRADES</td><td></td><td></td><td>86.50</td><td>86.57</td><td>-0.07</td><td>70.22</td><td>66.07</td><td>4.15</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>TRADES+TE</td><td></td><td></td><td>88.42</td><td>88.60</td><td>-0.18</td><td>72.72</td><td>72.43</td><td>0.29</td></tr></table>
551
+
552
+ # C.2 ADDITIONAL EXPERIMENTS ON MITIGATING ROBUST OVERFITTING
553
+
554
+ We show the results of our proposed methods on other network architectures (including WRN34-10 and VGG-16) and threat models (including $\ell _ { 2 }$ norm) in Table C.1. The results consistently demonstrate the effectiveness of the proposed method.
555
+
556
+ We further show the results of PGD-AT, PGD- $\mathbf { A T + T E }$ , TRADES, and TRADES ${ \bf \nabla } + { \bf T } { \bf E }$ on CIFAR-10 over 3 runs in Table C.2.
557
+
558
+ Table C.2: Test accuracy $( \% )$ of several methods on CIFAR-10 under the $\ell _ { \infty }$ norm with $\epsilon = 8 / 2 5 5$ based on the ResNet-18 architecture. We show the mean/std of the results over 3 runs.
559
+
560
+ <table><tr><td rowspan="2">Method</td><td colspan="3">Natural Accuracy</td></tr><tr><td>Best</td><td>Final</td><td>Diff</td></tr><tr><td>PGD-AT</td><td>83.76 ± 0.02</td><td>84.93 ± 0.26</td><td>-1.17 ± 0.29</td></tr><tr><td>PGD-AT+TE</td><td>82.36 ± 0.18</td><td>82.69 ± 0.14</td><td>-0.33 ± 0.31</td></tr><tr><td>TRADES</td><td>81.34 ± 0.15</td><td>82.70 ± 0.21</td><td>-1.36 ± 0.36</td></tr><tr><td>TRADES+TE</td><td>83.66 ± 0.19</td><td>83.89 ± 0.09</td><td>-0.23 ± 0.21</td></tr><tr><td rowspan="2">Method</td><td></td><td>PGD-10</td><td></td></tr><tr><td>Best</td><td>Final</td><td>Diff</td></tr><tr><td>PGD-AT</td><td>52.62 ± 0.10</td><td>44.91 ± 0.01</td><td>7.71 ± 0.11</td></tr><tr><td>PGD-AT+TE</td><td>55.74 ± 0.17</td><td>54.82 ± 0.23</td><td>0.92 ± 0.07</td></tr><tr><td>TRADES</td><td>53.25 ± 0.07</td><td>50.48 ± 0.23</td><td>2.77 ± 0.16</td></tr><tr><td>TRADES+TE</td><td>54.93 ± 0.16</td><td>54.04 ± 0.19</td><td>0.89 ± 0.13</td></tr><tr><td rowspan="2">Method</td><td></td><td>PGD-1000</td><td></td></tr><tr><td>Best</td><td>Final</td><td>Diff</td></tr><tr><td>PGD-AT</td><td>51.26 ± 0.03</td><td>42.72 ± 0.06</td><td>8.54 ± 0.06</td></tr><tr><td>PGD-AT+TE</td><td>54.54 ± 0.27</td><td>53.01 ± 0.34</td><td>1.53 ± 0.24</td></tr><tr><td>TRADES</td><td>52.24 ± 0.20</td><td>48.74 ± 0.17</td><td>3.50 ± 0.13</td></tr><tr><td>TRADES+TE</td><td>53.55 ± 0.16</td><td>52.93 ± 0.07</td><td>0.62 ± 0.11</td></tr><tr><td rowspan="2">Method</td><td></td><td>C&amp;W-1000</td><td></td></tr><tr><td>Best</td><td>Final</td><td>Diff</td></tr><tr><td>PGD-AT PGD-AT+TE</td><td>50.24 ± 0.12</td><td>43.59 ± 0.07</td><td>6.65 ± 0.19</td></tr><tr><td></td><td>52.31 ± 0.01</td><td>51.67 ± 0.12</td><td>0.64 ± 0.11</td></tr><tr><td>TRADES</td><td>49.83 ± 0.05</td><td>48.11 ± 0.04</td><td>1.72 ± 0.02</td></tr><tr><td>TRADES+TE</td><td>50.80 ± 0.02</td><td>50.61 ± 0.07</td><td>0.19 ± 0.08</td></tr><tr><td rowspan="2">Method</td><td>Best</td><td>AutoAttack Final</td><td>Diff</td></tr><tr><td></td><td></td><td></td></tr><tr><td>PGD-AT PGD-AT+TE</td><td>47.85 ± 0.17 50.37 ± 0.22</td><td>41.62 ± 0.16 49.36 ± 0.24</td><td>6.23 ± 0.26 1.01 ± 0.03</td></tr><tr><td>TRADES</td><td>48.86 ± 0.18</td><td>46.73 ± 0.07</td><td>2.13 ± 0.11</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>TRADES+TE</td><td>49.40 ± 0.27</td><td>48.77 ± 0.21</td><td>0.63 ± 0.05</td></tr></table>
parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/7gE9V9GBZaI/7gE9V9GBZaI_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/KwmPfARgOTD/KwmPfARgOTD.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/KwmPfARgOTD/KwmPfARgOTD_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/KwmPfARgOTD/KwmPfARgOTD_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/KwmPfARgOTD/KwmPfARgOTD_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/OgCcfc1m0TO/OgCcfc1m0TO.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO PROMPT FOR VISION-LANGUAGE MODELS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Vision-language pre-training has recently emerged as a promising alternative for representation learning. It shifts from the tradition of using images and discrete labels for learning a fixed set of weights, seen as visual concepts, to aligning images and raw text for two separate encoders. Such a paradigm benefits from a broader source of supervision and allows zero-shot transfer to downstream tasks since visual concepts can be diametrically generated from natural language, known as prompt. In this paper, we identify that a major challenge of deploying such models in practice is prompt engineering. This is because designing a proper prompt, especially for context words surrounding a class name, requires domain expertise and typically takes a significant amount of time for words tuning since a slight change in wording could have a huge impact on performance. Moreover, different downstream tasks require specific designs, further hampering the efficiency of deployment. To overcome this challenge, we propose a simple approach named context optimization $( C o O p )$ . The main idea is to model context in prompts using continuous representations and perform end-to-end learning from data while keeping the pre-trained parameters fixed. In this way, the design of task-relevant prompts can be fully automated. Experiments on 11 datasets show that CoOp effectively turns pre-trained vision-language models into data-efficient visual learners, requiring as few as one or two shots to beat hand-crafted prompts with a decent margin and able to gain significant improvements when using more shots (e.g., at 16 shots the average gain is around $17 \%$ with the highest reaching over $5 0 \%$ ). CoOp also exhibits strong robustness to distribution shift.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The traditional approach for visual representation learning is to train vision models to predict for a fixed set of object categories using discrete labels (He et al., 2016; Dosovitskiy et al., 2021). However, this approach limits visual recognition systems to closed-set visual concepts defined during training, making them unable to handle new categories once deployed in target environments, since additional data are required for learning a new classifier. Recently, vision-language pre-training such as CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021) has emerged as a promising alternative. The main idea is to align images and raw text using two separate encoders—one for each modality. Through large-scale pre-training, vision-language models are allowed to learn open-set visual concepts and can readily be transferred to downstream tasks. In particular, for each new classification task, one can synthesize the classification weights by feeding natural language describing classes of interest to the text encoder, and compare them with image features produced by the image encoder.
12
+
13
+ We observe that for pre-trained vision-language models, the text input, known as prompt, plays a key role in downstream datasets. However, identifying the right prompt is a non-trivial task, which often takes a significant amount of time for words tuning—since a slight change in wording could make a huge difference in performance. For instance, for Caltech101 (Figure 1(a), 2nd vs. 3rd prompt), adding “a” before the class token brings more than $5 \%$ increase in accuracy. Moreover, prompt engineering also requires expertise about the task and ideally the language model’s underlying mechanism. This is exemplified in Figure 1(b-d) where adding task-relevant context can lead to significant improvements, i.e., “flower” for Flowers102, “texture” for DTD and “satellite” for EuroSAT. Tuning the sentence structure could bring further improvements, e.g., putting “a type of flower” after the class token for Flowers102, keeping only “texture” in the context for DTD, and adding “centered” before “satellite photo” for EuroSAT. However, even with extensive tuning, the resulting prompts are by no means guaranteed to be optimal for these downstream tasks.
14
+
15
+ ![](images/6eeee6523dc87811b455ff6d6a2200c6220898cd79558bf59e027edd9bbd6a1d.jpg)
16
+ Figure 1: Prompt engineering vs. context optimization $\bf ( C o O p )$ . The latter uses only 16 shots for learning in these examples.
17
+
18
+ Inspired by recent prompt learning research in NLP (Shin et al., 2020; Jiang et al., 2020; Zhong et al., 2021), we propose context optimization $( C o O p ) ^ { 1 }$ to automate prompt engineering to allow more efficient and task-specific transfer for pre-trained vision-language models. Specifically, we model a prompt’s context using continuous representations which are essentially initialized with random vectors with the same dimension as word embeddings (see Figure 2). The context could be shared among all classes or designed to be class-specific. During training, we simply minimize the prediction error using the cross-entropy loss with respect to the learnable context vectors, while keeping the pre-trained parameters fixed. The gradients can be back-propagated all the way through the text encoder, distilling the rich knowledge encoded in the parameters for learning task-relevant context.
19
+
20
+ To demonstrate the effectiveness of $\mathrm { C o O p }$ , we benchmark on 11 datasets, which cover a diverse set of visual recognition tasks including classification on generic objects, scenes, actions and fine-grained categories, as well as specialized tasks like recognizing textures and satellite imagery. The results show that CoOp can effectively turn pre-trained vision-language models into data-efficient visual learners, requiring as few as one or two shots to beat hand-crafted prompts with a decent margin. The performance can also be further boosted by using more shots, e.g., at 16 shots the margin over hand-crafted prompts averages at around $17 \%$ and reaches over $50 \%$ for the highest. CoOp also outperforms the linear probe alternative known as a strong few-shot learning baseline (Tian et al., 2020), and crucially, demonstrates much stronger robustness to distribution shift. Extensive analysis is also conducted to offer a comprehensive picture on how to apply $\mathrm { C o O p }$ in practice. The source code for reproducing the experiments will be released to facilitate future research.
21
+
22
+ # 2 METHODOLOGY
23
+
24
+ # 2.1 VISION-LANGUAGE PRE-TRAINING
25
+
26
+ We briefly introduce vision-language pre-training with a particular focus on CLIP (Radford et al., 2021). Our approach is applicable to broader CLIP-like vision-language models.
27
+
28
+ Models CLIP consists of two encoders, one for images and the other for text. The image encoder aims to map high-dimensional images into a low-dimensional embedding space. The architecture of the image encoder can take the form of a CNN like ResNet-50 (He et al., 2016) or a ViT (Dosovitskiy et al., 2021). On the other hand, the text encoder is built on top of a Transformer (Vaswani et al., 2017) and aims to generate text representations from natural language.
29
+
30
+ ![](images/d2e38be7e5da6fc4ee2ef679849eed58bd900feae21b53f307ebcaa459be26d1.jpg)
31
+ Figure 2: Overview of context optimization $( \mathrm { C o O p } )$ .
32
+
33
+ Specifically, given a sequence of words (tokens), such as “a photo of a dog.”, CLIP first converts each one of the token (including punctuation) into a lower-cased byte pair encoding (BPE) representation (Sennrich et al., 2016), which is essentially a unique numeric ID. The vocabulary size in CLIP is 49,152. To facilitate minibatch processing, each text sequence is encompassed with the [SOS] and [EOS] tokens and capped at a fixed length of 77. After that, the IDs are mapped to 512-D word embedding vectors, which are then passed on to the Transformer. Finally, the features at the [EOS] token position are layer normalized and further processed by a linear projection layer.
34
+
35
+ Training CLIP is trained to align the two embedding spaces learned for images and text respectively. Specifically, the learning objective is formulated as a contrastive loss. Given a batch of image-text pairs, CLIP maximizes the cosine similarity for matched pairs while minimizes the cosine similarity for all other unmatched pairs. To learn diverse visual concepts that are more transferable to downstream tasks, CLIP’s team collects a large training dataset consisting of 400 million image-text pairs.
36
+
37
+ Zero-Shot Inference Since CLIP is pre-trained to predict whether an image matches a textual description, it naturally fits zero-shot recognition. This is achieved by comparing image features with the classification weights synthesized by the text encoder, which takes as input textual descriptions specifying classes of interest. Formally, let $f$ be image features extracted by the image encoder for an image $_ { \textbf { \em x } }$ and $\{ { w } _ { i } \} _ { i = 1 } ^ { K }$ a set of weight vectors generated by the text encoder. $K$ denotes the number of classes and each ${ \pmb w } _ { i }$ is derived from a prompt that could have the form of “a photo of a [CLASS].” where the class token is replaced by the specific class name, such as “cat”, “dog” or “car”. The prediction probability is then computed as
38
+
39
+ $$
40
+ p ( y = i | \pmb { x } ) = \frac { \exp ( < \pmb { w } _ { i } , \pmb { f } > / \tau ) } { \sum _ { j = 1 } ^ { K } \exp ( < \pmb { w } _ { j } , \pmb { f } > / \tau ) } ,
41
+ $$
42
+
43
+ where $\tau$ is a temperature parameter learned by CLIP and $< \cdot , \cdot >$ denotes cosine similarity.
44
+
45
+ # 2.2 CONTEXT OPTIMIZATION
46
+
47
+ We propose context optimization $\left( \mathbf { C o O p } \right)$ , which avoids manual prompt tuning by modeling context words with continuous vectors that are end-to-end learned from data. An overview is shown in Figure 2. Specifically, the prompt given to the text encoder $g ( \cdot )$ is designed with the following form,
48
+
49
+ $$
50
+ { \pmb t = [ \mathsf { V } ] _ { 1 } [ \mathsf { V } ] _ { 2 } \ldots [ \mathsf { V } ] _ { M } [ \mathsf { C L A S S } ] , }
51
+ $$
52
+
53
+ where each $[ \mathsf { V } ] _ { m } \ ( m \in \{ 1 , \dots , M \} )$ is a vector with the same dimension as word embeddings (i.e., 512 for CLIP), and $M$ is a hyperparameter specifying the number of context tokens. Note that the
54
+
55
+ context here is shared among all classes, which is called unified context and different from classspecific context that is introduced later.
56
+
57
+ By forwarding a prompt $\pmb { t }$ to the text encoder $g ( \cdot )$ , we can obtain a classification weight vector representing a visual concept. The prediction probability is computed as
58
+
59
+ $$
60
+ p ( \boldsymbol { y } = i | \boldsymbol { x } ) = \frac { \exp ( < g ( t _ { i } ) , f > / \tau ) } { \sum _ { j = 1 } ^ { K } \exp ( < g ( t _ { j } ) , f > / \tau ) } ,
61
+ $$
62
+
63
+ where the class token within each prompt $\mathbf { \Delta } _ { t _ { i } }$ is replaced by the corresponding word embedding vector(s) of the $i$ -th class name.
64
+
65
+ Training is performed to minimize the standard classification loss based on the cross-entropy, and the gradients can be back-propagated all the way through the text encoder $g ( \cdot )$ , making use of the rich knowledge encoded in the parameters to optimize the context. The design of continuous representations also allows full exploration in the word embedding space, which facilitates the learning of task-relevant context.
66
+
67
+ Other Variants Other than placing the class token at the end of a sequence as in Equation (2), we can also put it in the middle like
68
+
69
+ $$
70
+ \mathbf { \partial } t = [ \mathbf { V } ] _ { 1 } \ldots [ \mathbf { V } ] _ { \frac { M } { 2 } } [ \mathbf { C L A S S } ] [ \mathbf { V } ] _ { \frac { M } { 2 } + 1 } \ldots [ \mathbf { V } ] _ { M } ,
71
+ $$
72
+
73
+ which increases flexibility for learning—theoretically, the prompt is allowed to either fill the latter cells with supplementary descriptions or cut off the sentence earlier by using a termination signal such as full stop.
74
+
75
+ Another option is to design class-specific context (CSC) where context vectors are independent to each class, i.e., $[ \mathbf { V } ] _ { 1 } ^ { i } [ \mathbf { V } ] _ { 2 } ^ { i } \dot { \mathbf { \Omega } } . . . [ \mathbf { V } ] _ { M } ^ { i } \dot { \neq } [ \mathbf { V } ] _ { 1 } ^ { j } [ \mathbf { V } ] _ { 2 } ^ { j } \dot { \mathbf { \Omega } } . . . [ \mathbf { V } ] _ { M } ^ { j }$ for $i \neq j$ and $i , j \in \{ 1 , \dots , K \}$ . As an alternative to unified context, we find that CSC is particularly useful for some fine-grained classification tasks.
76
+
77
+ # 3 EXPERIMENTS
78
+
79
+ # 3.1 FEW-SHOT LEARNING
80
+
81
+ Datasets We select 11 publicly available image classification datasets used in CLIP: ImageNet (Deng et al., 2009), Caltech101 (Fei-Fei et al., 2004), OxfordPets (Parkhi et al., 2012), StanfordCars (Krause et al., 2013), Flowers102 (Nilsback & Zisserman, 2008), Food101 (Bossard et al., 2014), FGVCAircraft (Maji et al., 2013), SUN397 (Xiao et al., 2010), DTD (Cimpoi et al., 2014), EuroSAT (Helber et al., 2019) and UCF101 (Soomro et al., 2012) (see Appendix A for their statistics). These datasets constitute a comprehensive benchmark, which covers a diverse set of vision tasks including classification on generic objects, scenes, actions and fine-grained categories, as well as specialized tasks like recognizing textures and satellite imagery. We follow the few-shot evaluation protocol adopted in CLIP (Radford et al., 2021), using 1, 2, 4, 8 and 16 shots for training respectively and deploying models in the full test sets. The average results over three runs are reported for comparison.
82
+
83
+ Training Details CoOp has four versions: positioning the class token in the end or middle; unified context vs. CSC. Unless otherwise stated, ResNet-50 (He et al., 2016) is used as the image encoder’s backbone and the number of context tokens $M$ is set to 16. Investigations on other design choices are discussed in Section 3.3. All models are built on top of the open-sourced CLIP.2 CoOp’s context vectors are randomly initialized by drawing from a zero-mean Gaussian distribution with standard deviation equal to 0.02. Training is done with SGD and an initial learning rate of 0.002, which is decayed by the cosine annealing rule. The maximum epoch is set to 200 for 16/8 shots, 100 for 4/2 shots, and 50 for 1 shot (except for ImageNet where the maximum epoch is fixed to 50). To mitigate explosive gradients observed in the early training iterations, we use the warmup trick by fixing the learning rate to $1 e - 5$ during the first epoch.
84
+
85
+ ![](images/ac5b5e3af8e643f6365c510dc971b79d4470f7d68c1a365e0582f84185a398b8.jpg)
86
+ Figure 3: Main results of few-shot learning on the 11 datasets. Overall, $\mathrm { C o O p }$ effectively turns CLIP into a strong few-shot learner (solid lines), achieving significant improvements over zero-shot CLIP (stars) and performing favorably against the linear probe alternative (dashed lines). $M$ denotes the context length. “end” or “mid” means putting the class token in the end or middle. CSC means class-specific context.
87
+
88
+ Baseline Methods We compare CoOp with two baseline methods. The first is zero-shot CLIP, which is based on hand-crafted prompts. We follow the guideline of prompt engineering introduced by Radford et al. (2021). For generic objects and scenes, “a photo of a [CLASS].” is adopted. For fine-grained categories, task-relevant context is added like “a type of pet” for OxfordPets and “a type of food” for Food101. When it comes to specialized tasks such as recognizing textures in DTD, the prompt is customized as “[CLASS] texture.” where the class names are adjectives like “bubbly” and “dotted”. See Appendix A for the details. The second baseline is linear probe CLIP. As suggested by Radford et al. (2021) and a recent study on few-shot learning (Tian et al., 2020), training a linear classifier on top of high-quality pre-trained models’ features (like CLIP) can easily achieve performance that is on a par with that of state-of-the-art few-shot learning methods, which are often much more sophisticated. We follow the same training method used by Radford et al. (2021) to train linear probe CLIP.
89
+
90
+ Comparison with Hand-Crafted Prompts Figure 3 summarizes the results. Our default model is $\mathrm { C L I P { + } C o O p }$ with the class token positioned in the end. The two different ways of positioning the class token achieve similar performance as their curves highly overlap. From the average performance displayed in the top-left corner, we observe that $\mathrm { C L I P { + } C o O p }$ is a strong few-shot learner, requiring only two shots on average to obtain a decent margin over zero-shot CLIP. Given 16 shots for training, the average gap brought by $\mathrm { C o O p }$ can be further increased to around $17 \%$ .
91
+
92
+ Figure 4 ranks the absolute improvements obtained by $\mathrm { C o O p }$ at 16 shots over hand-crafted prompts. Huge improvements are observed on specialized tasks namely EuroSAT and DTD where the increase in performance reaches over $50 \%$ and $20 \%$ respectively. The jumps in performance are also significant (those more than $10 \%$ ) on most fine-grained datasets including Flowers102, StanfordCars and FGVCAircraft, as well as on scene and action recognition datasets (SUN397 & UCF101). Since ImageNet is a challenging dataset that contains 1,000 classes, the $5 . 0 5 \%$ improvement is also noteworthy. In contrast, the increases on the two fine-grained datasets, OxfordPets and Food101, are less appealing. By digging into $\mathrm { C L I P { + } C o O p }$ ’s curves on these two datasets in Figure 3, we find there is a loss of momentum in performance improvements even with more shots used, seemingly an overfitting problem. A potential solution is to impose higher regularizations like increasing the weight decay. Nonetheless, the overall results are strong enough to serve as evidence of CoOp’s capability of learning task-relevant prompts in a data-efficient way.
93
+
94
+ Comparison with Linear Probe CLIP In terms of the overall performance (Figure 3, topleft), $\mathrm { C L I P { + } C o O p }$ demonstrates clear advantages over linear probe CLIP. The latter requires 4 shots on average to match the zero-shot’s performance while $\mathrm { C o O p }$ ’s average gains at 4 shots are already more than $10 \%$ . It is also clear that the gaps in the extreme low-data regime such as one or two shots are much larger, suggesting that $\mathrm { C o O p }$ is much more effective than learning a linear classifier from scratch for fewshot learning. We also observe that linear probe CLIP is comparable to $\mathrm { C L I P { + } C o O p }$ on the two specialized tasks (DTD & EuroSAT) as well as on a couple of fine-grained datasets (Flowers102 & FGVCAircraft)—this is not too surprising as the pre-trained CLIP space has been
95
+
96
+ ![](images/46a412dabce93f3d30b2c503d1d179bed564359fe33170e59b995e92be2edcad.jpg)
97
+ Figure 4: Comparison with hand-crafted prompts.
98
+
99
+ proved powerful, making the linear probe model a strong competitor. Nevertheless, CoOp’s CSC version can beat linear probe CLIP on the aforementioned datasets, and moreover, shows much better potential when more shots become available.
100
+
101
+ Unified vs. Class-Specific Context On average, using unified context leads to better performance. In terms of when to apply CSC and when not to, we have the following suggestions. For generic objects (ImageNet & Caltech101), scenes (SUN397) and actions (UCF101), using unified context is clearly better. Unified context also works better on some fine-grained datasets including OxfordPets and Food101, but on others like StanfordCars, Flowers102 and FGVCAircraft the CSC version is preferred. CSC also yields better performance on the two specialized tasks, DTD and EuroSAT, at 16 shots in particular. However, CSC mostly underperforms unified context in challenging low-data scenarios (fewer than 8 shots), which makes sense because CSC has more parameters than unified context and needs more data for training.
102
+
103
+ # 3.2 ROBUSTNESS TO DISTRIBUTION SHIFT
104
+
105
+ Since CoOp requires training on a specific data distribution, it risks learning spurious correlations that are detrimental to generalization in unseen distributions (domains), as suggested in recent studies (Taori et al., 2020; Zhou et al., 2021). On the contrary, zero-shot CLIP is not tied to a specific data distribution and has exhibited strong robustness to distribution shift (Radford et al., 2021). In this section, we aim to unveil how robust CoOp is to distribution shift, in comparison to zero-shot CLIP and the linear probe model.
106
+
107
+ Table 1: Evaluation on robustness to distribution shift. $M$ : $\mathrm { C o O p }$ ’s context length.
108
+
109
+ <table><tr><td rowspan="3"></td><td>Source</td><td colspan="4">Target</td></tr><tr><td>ImageNet</td><td>ImageNetV2</td><td>ImageNet-Sketch</td><td>ImageNet-A</td><td>ImageNet-R</td></tr><tr><td>Zero-Shot CLIP</td><td>55.41</td><td>48.08</td><td>31.67</td><td>18.63</td><td>53.45</td></tr><tr><td>Linear Probe CLIP</td><td>53.44</td><td>43.40</td><td>17.63</td><td>11.66</td><td>32.63</td></tr><tr><td>CLIP + CoOp (M=16)</td><td>60.46</td><td>52.17</td><td>31.14</td><td>19.62</td><td>53.31</td></tr><tr><td>CLIP + CoOp (M=8)</td><td>60.90</td><td>52.53</td><td>31.73</td><td>19.97</td><td>54.34</td></tr><tr><td>CLIP + CoOp (M=4)</td><td>60.85</td><td>53.02</td><td>32.99</td><td>20.69</td><td>55.57</td></tr></table>
110
+
111
+ Table 2: Comparison with prompt ensembling.
112
+
113
+ <table><tr><td></td><td>ImageNet</td></tr><tr><td>Prompt engineering</td><td>55.41</td></tr><tr><td>Prompt ensembling</td><td>57.81</td></tr><tr><td>CoOp</td><td>60.46</td></tr></table>
114
+
115
+ Table 3: Random vs. manual initialization.
116
+
117
+ <table><tr><td></td><td>Avg %</td></tr><tr><td>[V][V]2[V]3[V]4</td><td>71.26</td></tr><tr><td>&quot;a photo of a&quot;</td><td>71.51</td></tr></table>
118
+
119
+ Datasets The source dataset is ImageNet. The target datasets are ImageNetV2 (Recht et al., 2019), ImageNet-Sketch (Wang et al., 2019), ImageNet-A (Hendrycks et al., 2021b) and ImageNetR (Hendrycks et al., 2021a), all of which have compatible class names with ImageNet allowing seamless transfer for the prompts learned by CoOp. ImageNetV2 is a reproduced test set using different sources while following ImageNet’s data collection process. ImageNet-Sketch contains sketch images belonging to the same 1,000 ImageNet classes. Both ImageNet-A and -R contain 200 classes derived from a subset of ImageNet’s 1,000 classes. The former consists of real-world adversarially filtered images that cause current ImageNet classifiers to produce low results, whereas the latter features a rendition of the ImageNet classes in diverse image styles such as paintings, cartoons and sculptures.
120
+
121
+ Results Table 1 summarizes the results. It is surprising that $\mathrm { C L I P { + } C o O p }$ exhibits stronger robustness than zero-shot CLIP to distribution shift, despite exposure to the source dataset. This suggests that the learned prompts are also generalizable. Moreover, it is interesting to see that using fewer context tokens leads to better robustness. More results with different vision backbones are provided in Appendix B.1 where the conclusion remains the same. In contrast, linear probe CLIP obtains much worse results on these target datasets, exposing its weakness in domain generalization.
122
+
123
+ # 3.3 FURTHER ANALYSIS
124
+
125
+ Comparison with Prompt Ensembling Radford et al. (2021) have suggested that additional improvements can be obtained by ensembling over multiple zero-shot classifiers generated using different hand-crafted prompts, such as “a photo of the large [CLASS].”, “a bad photo of the [CLASS].” and “a origami [CLASS].”, which reflect a different scale, view and abstraction respectively for an image. We are interested to know whether the prompts learned by $\mathrm { C o O p }$ can still maintain advantages when compared with prompt ensembling. For fair comparison, we use the select prompts from Radford et al. (2021), which have been extensively tuned on ImageNet, to construct the ensemble classifier. Table 2 presents the results of prompt engineering (i.e., using a single hand-crafted prompt), prompt ensembling and CoOp, confirming that $\mathrm { C o O p }$ is still the best performing method. Additional results are provided in Appendix B.2 to show that $\mathrm { C o O p }$ also beats prompt ensembling when more advanced vision backbones are used. Given the potential of prompt ensembling, future work could investigate how to improve CoOp from the ensembling perspective.
126
+
127
+ Context Length How many context tokens should be used? And is it better to have more context tokens? The results in Section 3.2 suggest having shorter context length benefits domain generalization. Here we study this hyperparameter for source datasets. Specifically, we repeat experiments on the 11 datasets by varying the context length from 4 to 8 to 16. The average results are shown in Figure 5(a), which indicate that having more context tokens leads to better performance and that positioning the class token in the middle gains more momentum with longer context length. To sum up, there is no golden rule for selecting perfect context length since one needs to balance between performance and robustness to distribution shift. See Appendix B.3 for the dataset-specific results.
128
+
129
+ ![](images/519f0153c8ecc9cc7177d00f1acf28c5ca44154e86714b6beefc33ff40b1b1dd.jpg)
130
+ Figure 5: Investigations on CoOp’s context length and various vision backbones.
131
+
132
+ Vision Backbones Figure 5(b) summarizes the results on the 11 datasets using a variety of vision backbones covering both CNNs and ViTs. The results are expected: the more advanced the backbone, the better the performance. The gap between CoOp and hand-crafted prompts is significant across all architectures. See Appendix B.4 for the dataset-specific results.
133
+
134
+ Initialization We compare random initialization with manual initialization. The latter uses the embeddings of “a photo of a” to initialize the context vectors for the 11 datasets. For fair comparison, we also set the context length to 4 when using random initialization. Table 3 suggests a “good” initialization only brings a small improvement. Though further tuning of the initialization words might help, in practice we suggest using the simple random initialization method.
135
+
136
+ Interpreting the Learned Prompts is difficult because the context vectors are optimized in a continuous space. We resort to an indirect way by searching within the vocabulary for words that are closest to the learned vectors based on the Euclidean distance. Note that CLIP (Radford et al., 2021) uses the BPE representation (Sennrich et al., 2016) for tokenization, so the vocabulary includes subwords that frequently appear in text, such as “hu” (subsumed by many words like “hug” and “human”). Table 4 shows the searched results on some datasets. We observe that a few words are somewhat relevant to the tasks, such as “enjoyed” for Food101, “fluffy” and “paw” for OxfordPets, and “pretty” for DTD. But when connecting all the nearest words together, the prompts do not make much sense. We also observe that when using manual initialization (like “a photo of a”), the nearest words for the converged vectors are mostly the ones used for initialization. We conjecture that the learned vectors might encode meanings that are beyond the existing vocabulary. Overall, we are unable to draw any firm conclusion based on the observations because using nearest words to interpret the learned prompts could be inaccurate—the semantics of the vectors is not necessarily correlated with the nearest words.
137
+
138
+ # 4 RELATED WORK
139
+
140
+ Vision-Language Models have recently demonstrated great potential in learning generic visual representations and allowing zero-shot transfer to a variety of downstream classification tasks (Radford et al., 2021; Jia et al., 2021; Zhang et al., 2020). To our knowledge, the recent developments in vision-language learning, particularly CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021), are largely driven by advances in the following three areas: i) text representation learning with Transformers (Vaswani et al., 2017), ii) large-minibatch contrastive representation learning (Chen et al., 2020; He et al., 2020; Henaff et al. ´ , 2020), and iii) web-scale training datasets—CLIP benefits from 400 million curated image-text pairs while ALIGN exploits 1.8 billion noisy image-text pairs.
141
+
142
+ The idea of mapping images and text onto a common embedding space has been studied since nearly a decade ago (Socher et al., 2013; Frome et al., 2013; Elhoseiny et al., 2013), but with drastically different technologies. For text features extraction, early work has mainly utilized pre-trained word vectors (Socher et al., 2013; Frome et al., 2013) or the hand-crafted TF-IDF features (Elhoseiny et al., 2013; Lei Ba et al., 2015). Matching images and text features has been formulated as metric learning (Frome et al., 2013), multi-label classification (Joulin et al., 2016; Gomez et al., 2017), n-gram language learning (Li et al., 2017), and the recently proposed captioning (Desai & Johnson, 2021). Our work is orthogonal to recent research in vision-language models, aiming to facilitate the deployment of such models in downstream datasets.
143
+
144
+ Table 4: The nearest words for each of the 16 context vectors learned by $\mathrm { C o O p }$ , with their distances shown in parentheses. N/A means non-Latin characters.
145
+
146
+ <table><tr><td>#</td><td>ImageNet|</td><td>Food101</td><td>OxfordPets|</td><td>DTD|</td><td>UCF101</td></tr><tr><td>1</td><td>potd (1.7136)</td><td>lc (0.6752)</td><td>tosc (2.5952)</td><td>boxed (0.9433)</td><td>|meteorologist (1.5377)</td></tr><tr><td>2</td><td>that (1.4015)</td><td>enjoyed (0.5305)</td><td>judge (1.2635)</td><td>seed (1.0498)</td><td>exe (0.9807)</td></tr><tr><td>3</td><td>filmed (1.2275)</td><td>beh (0.5390)</td><td>fluffy (1.6099)</td><td>anna (0.8127)</td><td>parents (1.0654)</td></tr><tr><td>4</td><td>fruit (1.4864)</td><td>matches (0.5646)</td><td>cart (1.3958)</td><td>mountain (0.9509)</td><td>masterful (0.9528)</td></tr><tr><td></td><td>.,.. (1.5863)</td><td>nytimes (0.6993)</td><td>harlan (2.2948)</td><td>eldest (0.7111)</td><td>fe (1.3574)</td></tr><tr><td></td><td>(1.7502)</td><td>prou (0.5905)</td><td>paw (1.3055)</td><td>pretty (0.8762)</td><td>thof (1.2841)</td></tr><tr><td></td><td>excluded (1.2355)</td><td>lower r(0.5390)</td><td>incase (1.2215)</td><td>faces (0.7872)</td><td>where (0.9705)</td></tr><tr><td></td><td>cold (1.4654)</td><td>N/A</td><td>bie (1.5454)</td><td>honey (1.8414)</td><td>kristen (1.1921)</td></tr><tr><td></td><td>stery (1.6085)</td><td>minute (0.5672)</td><td>snuggle (1.1578)</td><td>series (1.6680)</td><td>imam (1.1297)</td></tr><tr><td></td><td>warri (1.3055)</td><td>~ (0.5529)</td><td>along (1.8298)</td><td>coca (1.5571)</td><td>near (0.8942)</td></tr><tr><td>11</td><td>marvelcomics (1.5638)</td><td>well (0.5659)</td><td>lenjoyment (2.3495)</td><td>moon (1.2775)</td><td>tummy (1.4303)</td></tr><tr><td>12</td><td>.: (1.7387)</td><td>ends (0.6113)</td><td>jt (1.3726)</td><td>1h (1.0382)</td><td>hel (0.7644)</td></tr><tr><td>13</td><td>N/A</td><td>mis (0.5826)</td><td>improving (1.3198)</td><td>won (0.9314)</td><td>boop (1.0491)</td></tr><tr><td>14</td><td>lation (1.5015)</td><td>somethin (0.6041)</td><td>srsly (1.6759)</td><td>replied (1.1429)</td><td>N/A</td></tr><tr><td>15</td><td>muh (1.4985)</td><td>seminar (0.5274)</td><td>asteroid (1.3395)</td><td>sent (1.3173)</td><td>facial (1.4452)</td></tr><tr><td>16</td><td>.# (1.9340)</td><td>N/A</td><td>N/A</td><td>piedmont (1.5198)</td><td>during (1.1755)</td></tr></table>
147
+
148
+ Prompt Learning in NLP Knowledge probing for large pre-trained language models, formally defined by Petroni et al. (2019) as “fill-in-the-blank” cloze tests, has recently sparked interest in prompt learning research in NLP (Shin et al., 2020; Jiang et al., 2020; Li & Liang, 2021; Zhong et al., 2021; Lester et al., 2021; Gao et al., 2020; Liu et al., 2021b). The basic idea of knowledge probing is to induce pre-trained language models to generate answers given cloze-style prompts, which can benefit a number of downstream tasks, such as sentiment analysis. Jiang et al. (2020) propose to generate candidate prompts through text mining and paraphrasing, and identify the optimal ones that give the highest training accuracy. Shin et al. (2020) introduce a gradient-based approach, which searches for tokens with the largest gradient changes in the label likelihood. Most related to our work are continuous prompt learning methods (Zhong et al., 2021; Li & Liang, 2021; Lester et al., 2021) which optimize continuous vectors in the word embedding space. A drawback of such methods compared to searching discrete tokens is the lack of a clear way to visualize what “words” are learned for the vectors. We refer readers to Liu et al. (2021a) for a comprehensive survey in the topic of prompt learning in NLP.
149
+
150
+ # 5 CONCLUSION
151
+
152
+ We present $\mathrm { C o O p }$ , a differentiable approach that focuses on continuous prompt learning to facilitate the deployment of pre-trained vision-language models in downstream datasets. The results on the 11 datasets serve as strong evidence of CoOp’s effectiveness in data-efficient learning. The learned prompts are proved much more task-relevant than hand-crafted prompts reflected by the huge improvements in performance, as well as stronger in robustness to distribution shift. In terms of limitation, CoOp requires explicit access to the pre-trained model parameters, which might be unavailable when only the APIs of pre-trained models are provided. An interesting future direction is thus to investigate “black-box” prompt learning.
153
+
154
+ # REFERENCES
155
+
156
+ Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In ECCV, 2014.
157
+
158
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020.
159
+
160
+ Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In CVPR, 2014.
161
+
162
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
163
+
164
+ Karan Desai and Justin Johnson. Virtex: Learning visual representations from textual annotations. In CVPR, 2021.
165
+
166
+ Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
167
+
168
+ Mohamed Elhoseiny, Babak Saleh, and Ahmed Elgammal. Write a classifier: Zero-shot learning using purely textual descriptions. In ICCV, 2013.
169
+
170
+ Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In CVPR-W, 2004.
171
+
172
+ Andrea Frome, Greg Corrado, Jonathon Shlens, Samy Bengio, Jeffrey Dean, Marc’Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. In NeurIPS, 2013.
173
+
174
+ Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723, 2020.
175
+
176
+ Lluis Gomez, Yash Patel, Marc¸al Rusinol, Dimosthenis Karatzas, and CV Jawahar. Self-supervised ˜ learning of visual features through embedding images into text topic spaces. In CVPR, 2017.
177
+
178
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
179
+
180
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
181
+
182
+ Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2019.
183
+
184
+ Olivier J. Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, S. M. Ali Eslami,´ and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. In ¨ ICML, 2020.
185
+
186
+ Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV, 2021a.
187
+
188
+ Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In CVPR, 2021b.
189
+
190
+ Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021.
191
+
192
+ Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. How can we know what language models know? ACL, 2020.
193
+
194
+ Armand Joulin, Laurens Van Der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016.
195
+ Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In ICCV-W, 2013.
196
+ Jimmy Lei Ba, Kevin Swersky, Sanja Fidler, et al. Predicting deep zero-shot convolutional neural networks using textual descriptions. In ICCV, 2015.
197
+ Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021.
198
+ Ang Li, Allan Jabri, Armand Joulin, and Laurens van der Maaten. Learning visual n-grams from web data. In ICCV, 2017.
199
+ Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021.
200
+ Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021a.
201
+ Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021b.
202
+ Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
203
+ Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In ICVGIP, 2008.
204
+ Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In CVPR, 2012.
205
+ Fabio Petroni, Tim Rocktaschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, ¨ and Sebastian Riedel. Language models as knowledge bases? In EMNLP, 2019.
206
+ Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
207
+ Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In ICML, 2019.
208
+ Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, 2016.
209
+ Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. In EMNLP, 2020.
210
+ Richard Socher, Milind Ganjoo, Hamsa Sridhar, Osbert Bastani, Christopher D Manning, and Andrew Y Ng. Zero-shot learning through cross-modal transfer. In NeurIPS, 2013.
211
+ Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
212
+ Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. In NeurIPS, 2020.
213
+ Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: a good embedding is all you need? In ECCV, 2020.
214
+
215
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
216
+
217
+ Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In NeurIPS, 2019.
218
+
219
+ Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In CVPR, 2010.
220
+
221
+ Yuhao Zhang, Hang Jiang, Yasuhide Miura, Christopher D Manning, and Curtis P Langlotz. Contrastive learning of medical visual representations from paired images and text. arXiv preprint arXiv:2010.00747, 2020.
222
+
223
+ Zexuan Zhong, Dan Friedman, and Danqi Chen. Factual probing is [mask]: Learning vs. learning to recall. In NAACL, 2021.
224
+
225
+ Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization in vision: A survey. arXiv preprint arXiv:2103.02503, 2021.
226
+
227
+ # APPENDIX
228
+
229
+ # A DATASETS DETAILS
230
+
231
+ The detailed statistics of the 11 datasets, as well as the four variants of ImageNet, are shown in Table 5. The hand-crafted prompts used for zero-shot CLIP are also detailed in the table. For Caltech101, the “BACKGROUND Google” and “Faces easy” classes are discarded. For the video dataset, UCF101, the middle frame of each video is used as input to the image encoder.
232
+
233
+ Table 5: Datasets statistics.
234
+
235
+ <table><tr><td>Dataset</td><td>Classes</td><td>Train</td><td>Val</td><td>Test</td><td>Hand-crafted prompt</td></tr><tr><td>ImageNet</td><td>1,000</td><td>1.28M</td><td>N/A</td><td>50.000</td><td>“a photo of a [CLASS].&quot;</td></tr><tr><td>Caltech101</td><td>100</td><td>4,128</td><td>1,649</td><td>2,465</td><td>“a photo of a [CLASS].”</td></tr><tr><td>OxfordPets</td><td>37</td><td>2.944</td><td>736</td><td>3,669</td><td>“a photo of a[CLASS], a type of pet.”</td></tr><tr><td>StanfordCars</td><td>196</td><td>6,509</td><td>1,635</td><td>8,041</td><td>“a photo of a [CLASS].”</td></tr><tr><td>Flowers102</td><td>102</td><td>4.093</td><td>1,633</td><td>2.463</td><td>“a photo of a [CLASS],a type of flower.”</td></tr><tr><td>Food101</td><td>101</td><td>50,500</td><td>20,200</td><td>30,300</td><td>“a photo of [CLASS], a type of food.”</td></tr><tr><td>FGVCAircraft</td><td>100</td><td>3,334</td><td>3,333</td><td>3,333</td><td>“a photo of a [CLASS],a type of aircraft.&quot;”</td></tr><tr><td>SUN397</td><td>397</td><td>15,880</td><td>3,970</td><td>19,850</td><td>“a photo of a [CLASS].”</td></tr><tr><td>DTD</td><td>47</td><td>2,820</td><td>1,128</td><td>1,692</td><td>&quot;[CLASS] texture.&quot;</td></tr><tr><td>EuroSAT</td><td>10</td><td>13,500</td><td>5,400</td><td>8,100</td><td>“a centered satelite photo of [CLASS].&quot;</td></tr><tr><td>UCF101</td><td>101</td><td>7,639</td><td>1,898</td><td>3,783</td><td>“a photo of a person doing [CLASS].&quot;</td></tr><tr><td>ImageNetV2</td><td>1,000</td><td>N/A</td><td>N/A</td><td>10.000</td><td>“a photo of a [CLASS].”</td></tr><tr><td>ImageNet-Sketch</td><td>1,000</td><td>N/A</td><td>N/A</td><td>50,889</td><td>“a photo of a [CLASS].”</td></tr><tr><td>ImageNet-A</td><td>200</td><td>N/A</td><td>N/A</td><td>7,500</td><td>“a photo of a [CLASS].”</td></tr><tr><td>ImageNet-R</td><td>200</td><td>N/A</td><td>N/A</td><td>30,000</td><td>“a photo of a [CLASS].”</td></tr></table>
236
+
237
+ # B ADDITIONAL RESULTS
238
+
239
+ # B.1 ROBUSTNESS EXPERIMENTS
240
+
241
+ In addition to ResNet-50, we further experiment with more advanced architectures including ResNet-101, ViT-B/32 and ViT-B/16, all of which have pre-trained weights available from CLIP’s GitHub repository. The results are shown in Table 6 where we can draw the same conclusion as the main paper: CoOp offers stronger robustness than hand-crafted prompts and using fewer context tokens benefits domain generalization.
242
+
243
+ # B.2 PROMPT ENGINEERING, PROMPT ENSEMBLING AND COOP
244
+
245
+ Table 7 provides more comprehensive comparisons covering a variety of vision backbones. The observations are similar to those discussed in the main paper: prompt ensembling is clearly better than prompt engineering; and CoOp demonstrates consistent advantages over prompt ensembling.
246
+
247
+ # B.3 CONTEXT LENGTH
248
+
249
+ Figure 6 shows detailed results of using different context lengths for CoOp on each of the 11 datasets. The average performance, displayed in the top-left corner, suggests that using more context tokens is better. There are three exceptions: on ImageNet, OxfordPets, and Food101, the performance is saturated and the improvements diminish when the context length is increased. As discussed in the main paper, selecting a proper length needs to balance between performance on source datasets and robustness to distribution shift in unseen domains. We suggest practitioners use a validation set to identify the optimal context length for their applications.
250
+
251
+ Table 6: Comparison with zero-shot CLIP on robustness to distribution shift using different vision backbones. $M$ : CoOp’s context length.
252
+
253
+ <table><tr><td rowspan="3">Method</td><td rowspan="2">Source</td><td colspan="4">Target</td></tr><tr><td>ImageNetV2</td><td>ImageNet-Sketch</td><td>ImageNet-A</td><td>ImageNet-R</td></tr><tr><td colspan="7">ResNet-50</td></tr><tr><td>Zero-Shot CLIP</td><td>55.41</td><td>48.08</td><td>31.67</td><td>18.63</td><td>53.45</td></tr><tr><td>CLIP + CoOp (M=16)</td><td>60.46</td><td>52.17</td><td>31.14</td><td>19.62</td><td>53.31</td></tr><tr><td>CLIP + CoOp (M=4)</td><td>60.85</td><td>53.02</td><td>32.99</td><td>20.69</td><td>55.57</td></tr><tr><td colspan="7">ResNet-101</td></tr><tr><td>Zero-Shot CLIP</td><td>58.72</td><td>51.57</td><td>36.73</td><td>25.11</td><td>62.15</td></tr><tr><td>CLIP + CoOp (M=16)</td><td>64.39</td><td>55.00</td><td>37.54</td><td>26.31</td><td>61.73</td></tr><tr><td>CLIP + CoOp (M=4)</td><td>63.99</td><td>55.45</td><td>39.11</td><td>27.25</td><td>63.58</td></tr><tr><td colspan="7">ViT-B/32</td></tr><tr><td>Zero-Shot CLIP</td><td>59.88</td><td>51.98</td><td>39.22</td><td>27.44</td><td>63.79</td></tr><tr><td>CLIP + CoOp (M=16)</td><td>64.92</td><td>55.90</td><td>38.79</td><td>28.77</td><td>63.45</td></tr><tr><td>CLIP + CoOp (M=4)</td><td>64.88</td><td>56.21</td><td>40.17</td><td>29.64</td><td>64.60</td></tr><tr><td colspan="7">ViT-B/16</td></tr><tr><td>Zero-Shot CLIP</td><td>64.71</td><td>58.71</td><td>44.77</td><td>43.37</td><td>72.49</td></tr><tr><td>CLIP + CoOp (M=16)</td><td>70.13</td><td>62.23</td><td>44.82</td><td>44.30</td><td>72.98</td></tr><tr><td>CLIP + CoOp (M=4)</td><td>70.11</td><td>62.66</td><td>46.27</td><td>45.46</td><td>74.33</td></tr></table>
254
+
255
+ Table 7: Comparison with prompt engineering and prompt ensembling on ImageNet using different vision backbones.
256
+
257
+ <table><tr><td>Method</td><td>ResNet-50</td><td>ResNet-101</td><td>ViT-B/32</td><td>ViT-B/16</td></tr><tr><td>Prompt engineering</td><td>55.41</td><td>58.72</td><td>59.88</td><td>64.71</td></tr><tr><td>Prompt ensembling</td><td>57.81</td><td>60.49</td><td>62.01</td><td>67.31</td></tr><tr><td>CoOp</td><td>60.46</td><td>64.39</td><td>64.92</td><td>70.13</td></tr></table>
258
+
259
+ # B.4 VISION BACKBONES
260
+
261
+ Figure 7 provides the detailed per-dataset results for various vision backbones. The more advanced the backbone, the better the performance.
262
+
263
+ ![](images/7bd083dec703f717d056c6706bed8b2e87c884e465d2647b4592bc7ac32f4f49.jpg)
264
+ Figure 6: Dataset-specific results of using different context lengths for $\mathrm { C o O p }$
265
+
266
+ ![](images/e376adee1533442b59570843ade271ec904fdfa6b43683581ebb382ccfbce32e.jpg)
267
+ Figure 7: Results on the 11 datasets using a variety of vision backbones.
parse/dev/OgCcfc1m0TO/OgCcfc1m0TO_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RA7ND878XP/RA7ND878XP.md ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Segment Anything in High Quality
2
+
3
+ Lei $\mathbf { K e } ^ { * 1 , 2 }$ Mingqiao Ye∗1 Martin Danelljan1 Yifan Liu1 Yu-Wing Tai3 Chi-Keung Tang2 Fisher Yu1 1ETH Zürich 2HKUST 3Dartmouth College
4
+
5
+ # Abstract
6
+
7
+ The recent Segment Anything Model (SAM) represents a big leap in scaling up segmentation models, allowing for powerful zero-shot capabilities and flexible prompting. Despite being trained with 1.1 billion masks, SAM’s mask prediction quality falls short in many cases, particularly when dealing with objects that have intricate structures. We propose HQ-SAM, equipping SAM with the ability to accurately segment any object, while maintaining SAM’s original promptable design, efficiency, and zero-shot generalizability. Our careful design reuses and preserves the pre-trained model weights of SAM, while only introducing minimal additional parameters and computation. We design a learnable High-Quality Output Token, which is injected into SAM’s mask decoder and is responsible for predicting the high-quality mask. Instead of only applying it on mask-decoder features, we first fuse them with early and final ViT features for improved mask details. To train our introduced learnable parameters, we compose a dataset of 44K fine-grained masks from several sources. HQ-SAM is only trained on the introduced detaset of 44k masks, which takes only 4 hours on 8 GPUs. We show the efficacy of HQ-SAM in a suite of 10 diverse segmentation datasets across different downstream tasks, where 8 out of them are evaluated in a zero-shot transfer protocol. Our code and pretrained models are at https://github.com/SysCV/SAM-HQ.
8
+
9
+ # 1 Introduction
10
+
11
+ Accurate segmentation of diverse objects is fundamental for a wide range of scene understanding applications, including image/video editing, robotic perception, and AR/VR. Trained with billionscale mask labels, the Segment Anything Model (SAM) [21] was recently released as a foundational vision model for general image segmentation. SAM is capable of segmenting a wide range of objects, parts, and visual structures in diverse scenarios, by taking a prompt consisting of points, a bounding box, or a coarse mask as input. Its zero-shot segmentation abilities have led to a rapid paradigm shift, as it can be transferred to numerous applications through simple prompting.
12
+
13
+ While SAM has achieved impressive performance, its segmentation results are still unsatisfactory in many cases. In particular, SAM suffers from two key problems: 1) Coarse mask boundaries, often even neglecting the segmentation of thin object structures, as shown in Figure 1. 2) Incorrect predictions, broken masks, or large errors in challenging cases. This is often related to SAM misinterpreting thin structures, such as the kite lines in the rightmost column of Figure 1. These types of failures severely limit the applicability and effectiveness of foundational segmentation models, such as SAM, in particular for automated annotation and image/video editing tasks, where highly accurate image masks are crucial.
14
+
15
+ We propose HQ-SAM, which can predict highly accurate segmentation masks, even in very challenging cases (see Figure 1), without compromising the strong zero-shot capabilities and flexibility of the original SAM. To preserve the efficiency and zero-shot performance, we propose a minimal adaptation of SAM, adding less than $0 . 5 \%$ parameters, to extend its capability to high-quality segmentation.
16
+
17
+ ![](images/407a1726493e2a258b5fdbedad4aa251a2c8caa2f4685673275f9117f4959218.jpg)
18
+ Figure 1: The predicted masks of SAM vs. our HQ-SAM, given the same red box or several points on the object as input prompts. HQ-SAM produces significantly more detailed results with very accurate boundaries. In the rightmost column, SAM misinterprets the thin structure of the kite lines, and produces a large portion of errors with broken holes for the input box prompt.
19
+
20
+ Directly fine-tuning the SAM decoder or introducing a new decoder module severely degrades the general zero-shot segmentation performance. We therefore propose the HQ-SAM architecture, which tightly integrates with and re-uses the existing learned SAM structure, in order to fully preserve the zero-shot performance. First, we design a learnable HQ-Output Token that is input to SAM’s mask decoder, alongside the original prompt and output tokens. Unlike the original output tokens, our HQ-Output Token and its associated MLP layers are trained to predict a high-quality segmentation mask. Second, instead of only re-using the SAM’s mask decoder features, our HQ-Output Token operates on a refined feature set to achieve accurate mask details. In particular, we use both global semantic context and local fine-grained features by fusing SAM’s mask decoder features with early and late feature maps from its ViT encoder. During training, we freeze the entire pre-trained SAM parameters, while only updating our HQ-Output Token, its associated three-layer MLPs, and a small feature fusion block.
21
+
22
+ Learning accurate segmentation requires a dataset with accurate mask annotations of diverse objects with complex and detailed geometries. SAM is trained on the SA-1B dataset, which contains 11M images with 1.1 billion masks automatically generated by a SAM-like model. However, using this extensive dataset presents significant cost implications and falls short of achieving the desired high-quality mask generations pursued in our work, as evident by SAM’s performance in Figure 1. Consequently, we compose a new dataset, called HQSeg-44K, which contains 44K extremely fine-grained image mask annotations. HQSeg44K is constructed by merging six existing image datasets [35, 29, 26, 38, 8, 46] with highly accurate mask labels, covering over 1,000 diverse semantic classes. Thanks to the smaller-scale dataset and our minimal integrated architecture, HQ-SAM can be trained in only 4 hours on 8 RTX 3090 GPUs.
23
+
24
+ ![](images/9e22ac4bdc3810019eab898b37d1b0278a0511dec8ff33f337ff25a25cb40fc0.jpg)
25
+ Figure 2: Performance vs. speed vs. model size for an array of SAM variants [21, 52].
26
+
27
+ To validate the effectiveness of HQ-SAM, we perform extensive quantitative and qualitative experimental analysis. We provide a comprehensive performance-speed-model size comparison on SAM variants [21, 52] in Figure 2. We compare HQ-SAM with SAM on a suite of 10 diverse segmentation datasets across different downstream tasks, where 8 out of them are under a zero-shot transfer protocol, including COCO [31], UVO [42], SGinW [58], LVIS [14], HQ-YTVIS [20], BIG [6], COIFT [29] and HR-SOD [51]. This rigorous evaluation demonstrates that the proposed HQ-SAM can produce higher-quality masks while maintaining the zero-shot capability compared with SAM.
28
+
29
+ # 2 Related Work
30
+
31
+ High-quality Segmentation Existing works for high-quality segmentation are mostly trained for a specific segmentation task, like image and video instance segmentation [22, 19, 20, 40, 44], semantic segmentation [30, 54, 39, 50] or panoptic segmentation [9], in a close-world paradigm. Some of them focus on post-segmentation refinement using with graphical models such as CRF [23] or region growing [10]. However, the CRF-based refinement is adhere to low-level color boundaries without fully utilizing high-level semantic context and cannot fix large segmentation errors. While some refinement-based works adopt separate deep networks for cascade iterative refinement [6, 37], they are prone to overfitting as shown by our experiment. Compared to these high-quality segmentation [19, 22, 33] or segmentation refinement methods, we focus on accurately segmenting diverse objects on new data with flexible prompting, and build a high-quality zero-shot segmentation model that generalizes to various segmentation tasks and domains. Unlike the post segmentation refinement works [6, 37], to preserve the zero-shot segmentation capability of SAM, HQ-SAM predicts the new high-quality mask directly by reusing the image encoder and mask decoder of SAM, instead of taking the coarse mask and images as the input and feeding it into a separate refinement network. The model architecture of HQ-SAM builds upon SAM with negligible overhead, where we propose efficient token learning for accurate mask predictions. This is completely different from previous high-quality segmentation works, and we show its effectiveness across a wide range of zero-shot experiments.
32
+
33
+ Fine-tuning and Prompt Tuning for Foundation Models Foundation models [2, 1] first appear in the NLP community, where large language models such as GPT series [2] show strong zero-shot generalization to unseen tasks and data. Then, some prompt-based learning works [16, 27, 17] are proposed to help these pre-trained models generalize to the downstream tasks instead of fine-tuning the internal model parameters [15] for better transfer learning. For vision-based foundation models [21, 43, 59], prompt engineering [56, 45, 49, 57] that freezes the pre-trained model is first explored in vision-language models, such as CLIP [36]. These prompts with learnable parameters are designed to help downstream tasks with better context optimization. Different from the existing prompt-based or finetuning works, we focus on the minimal adaptation of SAM toward high-quality segmentation. We directly use the proposed HQ-Output Token output for accurate mask prediction, instead of only leveraging some learnable parameters [56] to help context learning and better generalization.
34
+
35
+ # 3 Method
36
+
37
+ We propose HQ-SAM to upgrade SAM for high-quality zero-shot segmentation. HQ-SAM is lightweight and only introduces two important adaptations to the SAM model. In Sec 3.1, we first briefly review the architecture of SAM on which HQ-SAM is built. Then, in Sec 3.2, we introduce our HQ-SAM with High-Quality Token (HQ-Output Token) and Global-local Feature Fusion, which are the key components to achieve better segmentation quality for SAM while preserving its zero-shot capability. Finally, in Sec 3.3, we describe the training and inference process of HQ-SAM, which is both data and computationally efficient.
38
+
39
+ # 3.1 Preliminaries: SAM
40
+
41
+ SAM [21] is composed of three modules: (a) Image encoder: a heavy ViT-based backbone for image feature extraction, resulting in image embedding in spatial size $6 4 \times 6 4$ . (b) Prompt encoder: encoding the interactive positional information from the input points/boxes/masks to provide for the mask decoder. (c) Mask decoder: a two-layer transformer-based decoder takes both the extracted image embedding with the concatenated output and prompt tokens for final mask prediction. The released SAM model is trained on the large-scale SA-1B dataset, which contains over 1 billion automatically generated masks $4 0 0 \times$ more masks than any existing segmentation datasets [14, 24]) and 11 million images. Thus, SAM shows valuable strong zero-shot generalization to new data without the necessity for additional training. However, we also note that SAM training is very expensive, where distributively training ViT-H-based SAM for 2 epochs on SA-1B requires 256 GPUs with a large batch size of 256 images. For more SAM method details, we refer readers to [21].
42
+
43
+ ![](images/4e828903d98d1c98ee300a042bb3f9054e815e3f7dbe43ceaae583eb665cb4b3.jpg)
44
+ Figure 3: HQ-SAM introduces HQ-Output Token and Global-local Feature Fusion to SAM for high-quality mask prediction. To keep the zero-shot capability of SAM, the lightweight HQ-Output Token reuses SAM’s mask decoder, and generates new MLP layers for performing point-wise product with fused HQ-Features. During training, only a few learnable parameters in HQ-SAM are trainable while we fix the model parameters of the pre-trained SAM. The prompt encoder is omitted here for clarity. Error correction is simply used as a direct element-wise sum between the predicted logits of the SAM’s Output Token and the HQ-Output Token during inference.
45
+
46
+ # 3.2 Ours: HQ-SAM
47
+
48
+ In this section, we describe the architecture of the HQ-SAM network. To preserve the zero-shot transfer capability of SAM, while preventing model overfitting or catastrophic forgetting, instead of directly finetuning SAM or adding a new heavy decoder network, we take a minimal adaptation approach as much as possible. To this end, HQ-SAM reuses the pre-trained model weights of SAM as much as possible with only two new key components, namely, High-Quality Output Token and Global-local Feature Fusion, as illustrated in Figure 3. HQ-SAM can thus be regarded as a highquality zero-shot segmentation model evolved from SAM with negligible extra model parameters and computation cost.
49
+
50
+ # 3.2.1 High-Quality Output Token
51
+
52
+ We propose efficient token learning for improving the mask quality of SAM. As shown in Figure 3, in SAM’s original mask decoder design, the output token (similar to object query in DETR [3]) is adopted for mask prediction, which predicts dynamic MLP weights and then performs point-wise product with the mask features. To promote SAM’s mask quality in HQ-SAM, instead of directly taking SAM’s coarse masks as input, we introduce the HQ-Output token and a new mask prediction layer for high-quality mask prediction.
53
+
54
+ In Figure 3, by reusing and fixing SAM’s mask decoder, a new learnable HQ-Output Token (size of $1 \times 2 5 6 ,$ is concatenated with SAM’s output tokens (size of $4 \times 2 5 6$ and prompt tokens (size of $\mathrm { N _ { p r o m p t } } { \times } 2 5 6 $ ) as the input to the SAM’s mask decoder. Similar to the original output token, in each attention layer, HQ-Output Token first performs self-attention with other tokens and then conducts both token-to-image and the reverse image-to-token attention for its feature updating. Note that HQ-Output Token uses the point-wise MLP shared by the other tokens in each decoder layer. After passing through two decoder layers, the updated HQ-Output Token has access to the global image context, the critical geometric/type information of prompt tokens as well as hidden mask information of the other output tokens. Finally, we add a new three-layer MLP to generate dynamic convolutional kernels from the updated HQ-Output Token, which then performs spatially point-wise product with the fused HQ-feature for high-quality mask generation.
55
+
56
+ Instead of directly finetuning SAM or further adding a heavy post-refinement network, we only allow the HQ-Output Token and its associated three-layer MLPs to be trained for correcting the mask errors of SAM’s output token. This is completely different from existing high-quality segmentation models [19, 6, 20, 22]. We identify two main advantages of our efficient token learning through extensive experiments: 1) This strategy significantly improves SAM’s mask quality while only introducing negligible parameters compared to original SAM, making HQ-SAM training extremely time and data-efficient; 2) The learned token and MLP layers do not overfit to mask the annotation bias of a specific dataset, thus keeping SAM’s strong zero-shot segmentation capability on new images without catastrophic knowledge forgetting.
57
+
58
+ # 3.2.2 Global-local Fusion for High-quality Features
59
+
60
+ Very accurate segmentation also requires input image feature with both rich global semantic context and local boundary details. To further promote mask quality, we enrich both the high-level object context and low-level boundary/edge information in the mask decoder features of SAM. Instead of directly using SAM’s mask decoder feature, we compose the new high-quality features (HQFeatures) by extracting and fusing features from different stages of the SAM model: 1) The early layer local feature of SAM’s ViT encoder with spatial shape $6 4 \times 6 4$ , which captures more general image edge/boundary details [12]. Concretely, we extract the feature after the first global attention block of the ViT encoder, and for ViT-Large based SAM, this is the 6th block output for the 24 blocks in total; 2) The final layer global feature of SAM’s ViT encoder with shape $6 4 \times 6 4$ , which has more global image context information; 3) The mask feature in SAM’s mask decoder with size $2 5 6 \times 2 5 6$ , which is also shared by the output tokens, contains strong mask shape information.
61
+
62
+ As shown in Figure 3, to obtain the input HQ-Features, we first upsample the early-layer and finallayer encoder features to the spatial size $2 5 6 \times 2 5 6$ by transposed convolution. Then, we sum up these three types of features in an element-wise manner after simple convolutional processing. We show that this global-local feature fusion is simple while effective, yielding detail-preserving segmentation results with a small memory footprint and computation burden. We also perform detailed ablation on the effect of each feature source in the experimental section (Table 3).
63
+
64
+ # 3.3 Training and Inference of HQ-SAM
65
+
66
+ Training Data Construction To train HQ-SAM in a data-efficient manner, instead of further training on SA-1B [21], we compose a new training dataset HQSeg-44K which contains 44,320 extremely accurate image mask annotations. We note that the released SA-1B dataset only contains automatically generated mask labels, missing very accurate manual annotation on objects with complex structures. Due to the annotation difficulty, HQSeg-44K leverages a collection of six existing image datasets including DIS [35] (train set), ThinObject-5K [29] (train set), FSS-1000 [26], ECSSD [38], MSRA10K [8], DUT-OMRON [46] with extremely fine-grained mask labeling, where each of them contains 7.4K mask labels on average. To make HQ-SAM robust and generalizable to new data, HQSeg-44K contains diverse semantic classes of more than 1,000. We show the advantage of using HQSeg-44K by comparing HQ-SAM training with 44K randomly sampled images and masks from SA-1B [21] in our supplemental analysis.
67
+
68
+ HQ-SAM Training During training, we fix the model parameters of the pre-trained SAM model while only making the proposed HQ-SAM learnable. The learnable parameters thus only include the HQ-Output Token, its associated three-layer MLP and three simple convolutions for HQ-Features fusion. Since SAM is designed for flexible segmentation prompts, we train HQ-SAM by sampling mixed types of prompts including bounding boxes, randomly sampled points, and coarse masks input. We generate these degraded masks by adding random Gaussian noise in the boundary regions of the GT masks. For generalizability to different object scales, we use large-scale jittering [13]. We use a learning rate of 0.001 and train our HQ-SAM for 12 epochs, with a learning rate drop after 10 epochs. We train on 8 Nvidia GeForce RTX 3090 GPUs with a total batch size of 32, which takes 4 hours to train for 16.6K iterations. Please refer to our supplemental file for more details.
69
+
70
+ HQ-SAM Inference We follow the same inference pipeline of SAM but use the mask prediction from HQ-Output token as high-quality mask prediction. During inference, we sum the predicted logits of the SAM mask (by Output Token) and our predicted mask (by HQ-Output Token) for mask correction on spatial resolution $2 5 6 \times 2 5 6$ . Then we up-sample the corrected mask to the original resolution $1 0 2 4 \times 1 0 2 4$ as our output.
71
+
72
+ SAM vs. HQ-SAM on Training and Inference In Table 1, we report detailed training and inference comparisons between our HQ-SAM and SAM. While HQ-SAM produces substantially better segmentation quality, its training is very quick and affordable, which only takes 4 hours with 8 RTX3090 GPUs. HQ-SAM is also lightweight and efficient, introducing negligible increases in model parameters, GPU memory usage, and inference time per image.
73
+
74
+ Table 1: Training and inference comparison between ViT-L [11] based SAM and HQ-SAM. HQ-SAM brings negligible extra computation burden to SAM, with less than $0 . 5 \%$ increase in model parameters and reaching $96 \%$ of its original speed. SAM-L is trained on 128 A100 GPUs for 180k iterations. Based on SAM-L, we only need to train our HQ-SAM on 8 RTX3090 GPUs for 4 hours.
75
+
76
+ <table><tr><td rowspan="2">Method</td><td colspan="4">Training</td><td colspan="2">Inference</td></tr><tr><td>Learnable Params (M)</td><td># GPU</td><td>Batch Size</td><td>Time (h)</td><td>FPS</td><td>Mem.</td></tr><tr><td>SAM [21]</td><td>1191</td><td>128</td><td>128</td><td>N/A</td><td>5.0</td><td>7.6G</td></tr><tr><td>HQ-SAM</td><td>5.1</td><td>8</td><td>32</td><td>4</td><td>4.8</td><td>7.6G</td></tr></table>
77
+
78
+ # 4 Experiments
79
+
80
+ # 4.1 Experimental Setup
81
+
82
+ Datasets For training we use the compiled HQSeg-44K, described in Section 3.3. For a comprehensive evaluation of the segmentation performance of HQ-SAM, we perform experiments on a wide range of datasets, including four extremely fine-grained segmentation datasets: DIS [35] (validation set), ThinObject-5K [29] (test set), COIFT [29] and HR-SOD [51]. Besides, we experiment on popular and challenging benchmarks across various image/video-based segmentation tasks in zero-shot settings, such as COCO [31], SGinW [58], UVO [42], LVIS [14], HQ-YTVIS [20] and BIG [6].
83
+
84
+ Evaluation Metrics To accurately quantify improvements in mask quality, instead of only employing the standard mask AP or mask mIoU, we also adopt boundary metrics mBIoU and boundary $\mathsf { A P } _ { B }$ [5]. We also evaluate on stricter $\mathsf { A P } _ { B } ^ { \mathrm { s t r i c t } }$ by adjusting the default dilation ratio from 0.02 to 0.01 on UVO [42] and LVIS [14]. For evaluation on the four fine-grained segmentation datasets [35, 29, 51], we also report the averaged boundary and mask IoU among them. For video instance segmentation evaluation on HQ-YTVIS [20], we use both Tube Boundary $\mathsf { A P } ^ { B }$ and Tube Mask $\mathsf { A P } ^ { M }$ .
85
+
86
+ # 4.2 Ablation Experiments
87
+
88
+ We conduct detailed ablation studies on the proposed HQ-SAM using ViT-Large as the backbone, analyzing the impact of the proposed HQ-Output Token and HQ-Features on segmentation quality especially in zero-shot cases. For ablation experiments, we use the four aforementioned extremely accurate segmentation datasets, namely, DIS (val) [35], ThinObject-5K (test) [29], COIFT [29] and HR-SOD [51] as well as the COCO validation set.
89
+
90
+ Effect of the High-Quality Output Token . HQ-SAM employs HQ-Output Token for high-quality mask prediction. Table 2 compares our HQ-Output Token to the baseline SAM and other existing prompt/token learning strategies, such as adding an additional three context tokens [56] as learnable vectors into the SAM’s mask decoder for better context learning. Compared to using context tokens, the HQ-Output token consistently brings larger performance gains on four high-quality datasets, with 13.2 mBIoU on DIS and 2.7 mBIoU on COIFT datasets. We also perform other ablation experiment variants, such as computing the scaled dot product [18] between the original SAM’s output token and our HQ-Output token or restricting the mask loss to only inside the boundary regions, and find they slightly decrease the averaged performance on the four evaluation datasets. Compared to SAM, HQ-SAM significantly improves the mBIoU on DIS benchmark from 52.8 to 70.4 and also promotes the mBIoU on the HRSOD dataset for 3.8 points.
91
+
92
+ Ablation on the Global-local Fusion for HQ-Features Table 3 tabulates the effect of global-local fusion, where the importance of each feature component is analyzed in HQ-Features during the fusion process. Compared to directly using the mask decoder feature of SAM, the entire HQ-Features bring an obvious advantage of $2 . 6 \ \mathrm { m B I o U }$ on four highly accurate segmentation datasets. The final-layer ViT encoder feature with global context increases the mBIoU from 80.1 to 81.3. while the early-layer feature with local details further promotes the mBIoU to 81.8. We also replace the proposed global-local fusion with the conventional FPN to build a feature pyramid for fusion, and found this brought an inferior performance, decreasing from 89.1 to 87.4 mIoU.
93
+
94
+ Comparison to SAM finetuning or post-refinement . In Table 4, we compare our efficient token adaptation strategy to adding an extra post-refinement network [6] and model finetuning, including directly finetuning SAM’s mask decoder or only finetuning its output token for mask prediction. Adding an extra heavy post-refinement network brings limited averaged performance increase on four HQ datasets but leads to very poor performance on COCO, indicating strong overfitting. We also observe a similar phenomenon when directly finetuning SAM’s mask decoder. Only finetuning SAM’s output token can address the catastrophic forgetting problem with improvement on the four HQ datasets and COCO. However, the incremental improvement is still much smaller compared to ours. HQ-SAM improves 1.1 $\mathsf { A P } _ { B }$ on COCO while output token finetuning only gives an increase of $0 . 4 \ : \mathrm { A P } _ { B }$ . This shows the advantage of HQ-SAM in data-efficient learning while preserving the zero-shot capability of SAM.
95
+
96
+ Table 2: Ablation study of the HQ-Output Token on four extremely fine-grained segmentation datasets. We adopt the boxes converted from their GT masks as the box prompt input. By default, we train the predicted mask of HQ Output-Token by computing full GT mask loss.
97
+
98
+ <table><tr><td rowspan="2">Model</td><td colspan="2">DIS [35]</td><td colspan="2">COIFT [29]</td><td colspan="2">HRSOD [51]</td><td colspan="2">ThinObject [29]</td><td colspan="2">Average</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td></tr><tr><td>SAM (baseline)</td><td>62.0</td><td>52.8</td><td>92.1</td><td>86.5</td><td>90.2</td><td>83.1</td><td>73.6</td><td>61.8</td><td>79.5</td><td>71.1</td></tr><tr><td>Using SAM&#x27;s mask decoder feature:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SAM+Context Token [56]</td><td>71.5</td><td>62.2</td><td>93.0</td><td>87.7</td><td>91.8</td><td>85.0</td><td>84.5</td><td>73.1</td><td>85.2</td><td>77.0</td></tr><tr><td>SAM + HQ-Output Token (× Output Token)</td><td>75.1</td><td>65.8 66.4</td><td>93.9</td><td>88.9</td><td>93.0</td><td>86.1</td><td>86.1</td><td>74.6</td><td>87.0</td><td>78.9</td></tr><tr><td>SAM + HQ-Output Token (Boundary Loss) SAM + HQ-Output Token</td><td>75.2 75.3</td><td>66.0</td><td>94.0 94.2</td><td>88.9 89.2</td><td>92.1 93.0</td><td>85.7 86.1</td><td>87.3 86.8</td><td>76.0 75.4</td><td>87.2 87.3</td><td>79.3</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>79.2</td></tr><tr><td>Using Our HQ-Feature:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SAM + HQ-Output Token (+ Context Token)</td><td>78.5</td><td>70.4</td><td>94.6</td><td>89.6</td><td>93.6</td><td>87.0</td><td>88.9 89.5</td><td>79.3</td><td>88.9 89.1</td><td>81.6</td></tr><tr><td>SAM+ HQ-Output Token</td><td>78.6</td><td>70.4</td><td>94.8</td><td>90.1</td><td>93.6</td><td>86.9</td><td></td><td>79.9</td><td></td><td>81.8</td></tr></table>
99
+
100
+ Table 3: Ablation study on the HQ-Features sources. Early-layer denotes the feature after the first global attention block of the ViT encoder, while final-layer denotes the output of the last ViT block. Four HQ datasets denote DIS (val) [35], ThinObject-5K (test) [29], COIFT [29] and HR-SOD [51].
101
+
102
+ <table><tr><td>Model</td><td>Fusion conv</td><td>Decoder Mask feature</td><td>ViT Encoder Final-layer Early-layer</td><td>mIoU</td><td>Four HQ datasets mBIoU</td></tr><tr><td>SAM [21]</td><td></td><td>√</td><td></td><td>79.5</td><td>71.1</td></tr><tr><td rowspan="5">HQ-SAM (Ours)</td><td rowspan="5">广</td><td>√</td><td></td><td></td><td>87.3 79.2</td></tr><tr><td>√</td><td></td><td>87.8</td><td>80.1</td></tr><tr><td></td><td></td><td>15.1</td><td>9.0</td></tr><tr><td>√ √</td><td>广</td><td></td><td>88.6 81.3</td></tr><tr><td>√ √</td><td>√ √ √ 丁</td><td>88.6 89.1</td><td>81.1 81.8</td></tr></table>
103
+
104
+ ![](images/bbcd16187a66390c4705bad3e39d81e9e20ed9ae9461c2d432578811e25a09dc.jpg)
105
+ Figure 4: Recall rate comparison between COIFT [29] and HRSOD [51] under the zero-shot protocol, using BIoU thresholds ranging from loose to strict. The performance gap between SAM and our HQ-SAM increases significantly when we vary from a loose BIoU threshold of 0.5 to a very strict threshold of 0.9, showing the advantage of HQ-SAM in predicting very accurate segmentation masks.
106
+
107
+ Accuracy analysis at different BIoU thresholds Figure 4 compares SAM and HQ-SAM from loose to strict BIoU thresholds. We plot the percentage of mask predictions that have a BIoU larger than the threshold indicated on the $\mathbf { X }$ -axis. The large performance gap with strict IoU thresholds on both COIFT [29] and HRSOD [51] clearly validates the advantage of HQ-SAM in predicting very accurate masks. However, even at the loose threshold of 0.5, HQ-SAM reduces the number of incorrect predictions by SAM by $81 \%$ for COIFT and $69 \%$ for HRSOD. This shows that HQ-SAM predictions are not only substantially more accurate but also more robust in challenging cases.
108
+
109
+ Table 4: Comparison with model finetuning or extra post-refinement [6]. For the COCO dataset, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator.
110
+
111
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Four HQ datasets mIoU mBIoU</td><td rowspan="2"></td><td colspan="5">CoCo</td></tr><tr><td>APB</td><td>AP</td><td>APL</td><td>APm</td><td>APs</td></tr><tr><td>SAM (baseline)</td><td>79.5</td><td>71.1</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td></tr><tr><td>Training the whole SAM</td><td>38.0</td><td>12.2</td><td>0.2</td><td>5.5</td><td>1</td><td>-</td><td>1</td></tr><tr><td>Add Context Token [56]</td><td>85.2</td><td>77.0</td><td>31.9</td><td>47.2</td><td>65.1</td><td>51.2</td><td>31.9</td></tr><tr><td>CascadePSP Post-refinement [6]</td><td>80.9</td><td>74.6</td><td>2.8</td><td>13.4</td><td>43.4</td><td>9.4</td><td>0.0</td></tr><tr><td>CRM Post-refinement [37]</td><td>81.4</td><td>75.4</td><td>15.9</td><td>28.7</td><td>=</td><td>-</td><td>-</td></tr><tr><td>Finetune SAM&#x27;s decoder</td><td>87.6</td><td>79.5</td><td>9.0</td><td>19.5</td><td>45.2</td><td>15.8</td><td>4.7</td></tr><tr><td>Finetune SAM&#x27;s output token</td><td>87.6</td><td>79.7</td><td>33.7</td><td>48.7</td><td>66.0</td><td>52.3</td><td>33.6</td></tr><tr><td>HQ-SAM (Ours)</td><td>89.1</td><td>81.8</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td></tr></table>
112
+
113
+ Table 5: Zero-shot open-world instance segmentation results comparison on UVO [42]. We use FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. $* ^ { s t r i c t }$ denotes the boundary region with a tighter threshold.
114
+
115
+ <table><tr><td>Model</td><td>APsict</td><td>AP</td><td>AP6</td><td>APB</td><td>APB75</td><td>APB50</td><td>AP</td></tr><tr><td>SAM</td><td>8.6</td><td>3.7</td><td>25.6</td><td>17.3</td><td>14.4</td><td>37.7</td><td>29.7</td></tr><tr><td>HQ-SAM</td><td>9.9</td><td>5.0</td><td>28.2</td><td>18.5</td><td>16.3</td><td>38.6</td><td>30.1</td></tr></table>
116
+
117
+ Table 6: Zero-shot segmentation result comparison on the test set of high-quality BIG [6] benchmark using various types of input prompts. We employ PSPNet [55] to generate the coarse mask prompt.
118
+
119
+ <table><tr><td>Model</td><td>GT Box Prompt mIoU</td><td>mBIoU</td><td>Mask Prompt mIoU</td><td>mBIoU</td></tr><tr><td>SAM</td><td>81.1</td><td>70.4</td><td>66.6</td><td>41.8</td></tr><tr><td>HQ-SAM</td><td>86.0</td><td>75.3</td><td>86.9</td><td>75.1</td></tr></table>
120
+
121
+ # 4.3 Zero-shot Comparison with SAM
122
+
123
+ We perform extensive zero-shot transfer comparisons between our HQ-SAM and SAM on 7 benchmarks, including SGinW [58], COCO [31], UVO [42], LVIS [14], HQ-YTVIS [20], BIG [6], COIFT [29] and HR-SOD [51], where HQ-SAM outperforms SAM without bells and whistles, demonstrating its efficacy and kept generalization ability even trained with a small-scale dataset.
124
+
125
+ Results on the SGinW Benchmark Equipped with the same Grounding-DINO [32] as box prompts, we also performed experiments by replacing SAM with HQ-SAM in Grounded-SAM, and obtained the first place in the Segmentation in the Wild (SGinW) competition1 on the zero-shot track. Note that SGinW contains 25 zero-shot in-the-wild segmentation datasets for evaluation, and GroundedHQ-SAM with 49.6 mean AP and outperforms Grounded-SAM obviously using the same detector.
126
+
127
+ Zero-Shot Open-world Segmentation To evaluate the zero-shot segmentation results in the openworld environment, in Table 5, we compare SAM and our HQ-SAM on the challenging UVO [42] benchmark with diverse and dense objects mask annotations. By taking the same pre-trained object detector [53] as box prompt input, our HQ-SAM improves for $1 . 3 \mathrm { A P } _ { B } ^ { \mathrm { s t r i c t } }$ t and 2.6 APstrictB50 over SAM.
128
+
129
+ Zero-Shot Segmentation on High-resolution BIG Dataset In Table 6, we compare the zero-shot segmentation quality between SAM and HQ-SAM on the high-resolution BIG benchmark [6] with two types of prompts, including using GT object boxes or the provided coarse masks input. HQ-SAM consistently surpasses SAM, with obvious advantages using different types of prompts, and is much more robust to coarse masks prompts with partial boundary errors (provided by PSPNet [55]).
130
+
131
+ Zero-shot Instance Segmentation on COCO and LVIS In Table 7, we also evaluate HQ-SAM on the popular COCO and LVIS benchmarks respectively by feeding box prompts generated by the trained detectors of these two datasets. HQ-SAM consistently outperforms SAM by $1 . 1 \mathrm { \ A P } _ { B }$ on COCO and $0 . 7 \mathrm { A P } _ { B 7 5 } ^ { \mathrm { s t r i c t } }$ on LVIS, showing the improved mask quality and well-preserved zero-shot segmentation ability during the HQ-SAM training process.
132
+
133
+ Table 7: Zero-shot instance segmentation results comparison on COCO [31] and LVISv1 [14]. For the COCO dataset, we use FocalNet-DINO [53] detector trained on COCO. For LVIS, we adopt ViTDet-H [28] trained on the LVIS dataset as our box prompt generator. For SAM, we use the ViT-L backbone and box prompt. We maintain the zero-shot segmentation capability of the original SAM while improving the mask quality on the boundary region.
134
+
135
+ <table><tr><td rowspan="2">Model</td><td colspan="2">COCO</td><td colspan="5">LVIS</td></tr><tr><td>APB</td><td>AP</td><td>APsiet</td><td>AP</td><td>APB</td><td>APB75</td><td>AP</td></tr><tr><td>SAM</td><td>33.3</td><td>48.5</td><td>32.1</td><td>32.8</td><td>38.5</td><td>40.9</td><td>43.6</td></tr><tr><td>HQ-SAM</td><td>34.4</td><td>49.5</td><td>32.5</td><td>33.5</td><td>38.8</td><td>41.2</td><td>43.9</td></tr></table>
136
+
137
+ ![](images/3e2a649cbc6fa87420afe8afb381fa3922fca11a2410a55b3b7cc6cc7d1af28c.jpg)
138
+ Figure 5: Interactive segmentation results comparison using a varying number of input points on the COIFT [29] (zero-shot) and DIS [35] val set. HQ-SAM consistently outperforms SAM with various point numbers, and the relative improvement is more obvious with less prompt ambiguity.
139
+
140
+ Table 8: Zero-shot Video Instance Segmentation comparison on the test set of the very accurately labeled HQ-YTVIS [20] benchmark. We utilize pre-trained Swin-L-based Mask2Fromer [4] on YTVIS [47] as our box prompt input while reusing its object association prediction.
141
+
142
+ <table><tr><td>Model</td><td>APB</td><td>AP</td><td>AP5</td><td>APM</td><td>AP</td><td>AP</td></tr><tr><td>SAM</td><td>30.2</td><td>19.1</td><td>72.9</td><td>60.7</td><td>68.1</td><td>90.5</td></tr><tr><td>HQ-SAM</td><td>34.0</td><td>24.3</td><td>79.5</td><td>63.6</td><td>70.5</td><td>91.1</td></tr></table>
143
+
144
+ Point-based Interactive Segmentation Comparison To investigate the segmentation performance of HQ-SAM with interactive point prompts, in Figure 5, we compare HQ-SAM to SAM with varying numbers of input points on COIFT [29] (zero-shot) and DIS [35] val set. HQ-SAM consistently outperforms SAM with different point prompts on both two datasets. We note that the relative performance increase is more significant when the prompt contains less object ambiguity with more input points information (increasing from 1 positive point to 10 positive points $+ 5$ negative points).
145
+
146
+ Zero-shot High-quality Video Instance Segmentation Besides conducting image-based segmentation evaluation, we also perform video instance segmentation results comparison on the accurately annotated HQ-YTVIS benchmark [20]. We take the pre-trained Mask2Former [4] as our video box prompts and feed it into SAM and our HQ-SAM for mask prediction. In Table 8, HQ-SAM achieves remarkable gains of 3.8 points in Tube Boundary $\mathsf { A P } ^ { B }$ and 2.9 Tube Mask $\mathsf { A P } ^ { M }$ .
147
+
148
+ Visualization of HQ-Output Token In Figure 6, we provide visual comparison of our HQ-Output Token vs. SAM’s common output token for their cross-attention maps in the last token-to-image layer of the mask decoder. We observe that our HQ-Output Token attends to the boundary and thin structure regions that are missed by the common token.
149
+
150
+ Zero-shot Visual Results Comparison In Figure 7, we compare HQ-SAM to SAM qualitatively in a zero-shot transfer setting, where HQ-SAM significantly promotes the mask details of SAM and also improves the masks of broken holes or large portion errors by the enriched semantic context. Refer to the supplemental file for more visual comparisons.
151
+
152
+ Comparison with Adapter Tuning Strategy In Table 9, we also compare our efficient token adaptation strategy to the recent Adapter Tuning [48] and LoRA [17]. We introduce lightweight adapters to ViT layers of SAM’s encoder for encoder tuning and identify that this strategy leads to overfitting and its zero-shot performance on COCO decreases from 33.3 to 29.6. This validates our design choice to freeze SAM’s encoder, and mainly focus on SAM’s decoder.
153
+
154
+ ![](images/eea1ab449769a73f49fe2b291298358cea5af95b5d5850d38bcc06c26ef6abd8.jpg)
155
+
156
+ ![](images/a74317947cf626e16a1796294afa6276b45cb3ed3a71f30829443bdd89401bd5.jpg)
157
+ Figure 6: Cross-attention of SAM’s original token vs. HQ-Output Token in the last decoder layer. HQ-Token attends to the boundary and thin structure regions that are missed by the original token.
158
+ Figure 7: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) in a zero-shot transfer setting, given the same red box or point prompt. HQ-SAM produces significantly more detailed-preserving results and also addresses the mask errors with broken holes.
159
+
160
+ Table 9: Comparison to Adapter Tuning [48] or using LoRA [17] in SAM’s encoder using ViT-L based SAM and the same HQSeg-44K. For the COCO dataset, we use the SOTA detector FocalNetDINO [53] trained on the COCO dataset as our box prompt generator.
161
+
162
+ <table><tr><td rowspan="2">Model</td><td colspan="5">CoCo</td><td colspan="2">Model Params (MB)</td></tr><tr><td>APB</td><td>AP</td><td>APL</td><td>APM</td><td>APs</td><td>Total</td><td>Trainable</td></tr><tr><td>SAM</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td><td>1191</td><td>1</td></tr><tr><td>SAM+LoRA[17]</td><td>28.6</td><td>43.7</td><td>-</td><td>-</td><td>-</td><td>1192.5</td><td>1.5</td></tr><tr><td>SAM + Encoder Adapter [48]</td><td>29.6</td><td>44.8</td><td>63.9</td><td>47.8</td><td>29.0</td><td>1203</td><td>12.0</td></tr><tr><td>HQ-SAM</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td><td>1196.1</td><td>5.1</td></tr></table>
163
+
164
+ Mobile Efficiency Although HQ-SAM significantly boosts SAM’s mask quality with negligible overhead, it shares the heavy ViT encoder of SAM, and thus cannot achieve a real-time speed in video processing. For efficient mobile deployment, we propose Light HQ-SAM based on the tiny ViT image encoder provided by MobileSAM [52]. In Figure 2, achieving running speed of $4 1 . 2 \ : \mathrm { F P S }$ , Light HQ-SAM improves the zero-shot COCO AP of MobileSAM from 44.3 to 45.0 with negligible additional cost, i.e., 1.7MB increase in model parameters.
165
+
166
+ # 5 Conclusion
167
+
168
+ We propose HQ-SAM, the first high-quality zero-shot segmentation model by introducing negligible overhead to the original SAM. We propose a lightweight High-quality Output Token in HQ-SAM to replace the original SAM’s output token for high-quality mask prediction. After training only on 44K highly-accurate masks, HQ-SAM significantly boosts the mask prediction quality of SAM, which was trained on 1.1 billion masks. The zero-shot transfer evaluation is performed on 8 segmentation benchmarks across both image and video tasks, spanning diverse objects and scenes. Our research offers timely insights into how to leverage and extend SAM-like foundational segmentation models in a data-efficient and computation-affordable manner.
169
+
170
+ # References
171
+
172
+ Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. [2] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020.
173
+ [3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
174
+ [4] Bowen Cheng, Anwesa Choudhuri, Ishan Misra, Alexander Kirillov, Rohit Girdhar, and Alexander G Schwing. Mask2former for video instance segmentation. arXiv preprint arXiv:2112.10764, 2021.
175
+ [5] Bowen Cheng, Ross Girshick, Piotr Dollár, Alexander C. Berg, and Alexander Kirillov. Boundary IoU: Improving object-centric image segmentation evaluation. In CVPR, 2021.
176
+ [6] Ho Kei Cheng, Jihoon Chung, Yu-Wing Tai, and Chi-Keung Tang. CascadePSP: Toward class-agnostic and very high-resolution segmentation via global and local refinement. In CVPR, 2020.
177
+ [7] Ho Kei Cheng and Alexander G. Schwing. XMem: Long-term video object segmentation with an atkinson-shiffrin memory model. In ECCV, 2022.
178
+ [8] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, Philip HS Torr, and Shi-Min Hu. Global contrast based salient region detection. TPAMI, 37(3):569–582, 2014. [9] Daan de Geus and Gijs Dubbelman. Intra-batch supervision for panoptic segmentation on high-resolution images. In WACV, 2023.
179
+ [10] Philipe Ambrozio Dias and Henry Medeiros. Semantic segmentation refinement by monte carlo region growing of high confidence detections. In ACCV, 2019.
180
+ [11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
181
+ [12] Amin Ghiasi, Hamid Kazemi, Eitan Borgnia, Steven Reich, Manli Shu, Micah Goldblum, Andrew Gordon Wilson, and Tom Goldstein. What do vision transformers learn? a visual exploration. arXiv preprint arXiv:2212.06727, 2022.
182
+ [13] Golnaz Ghiasi, Yin Cui, Aravind Srinivas, Rui Qian, Tsung-Yi Lin, Ekin D Cubuk, Quoc V Le, and Barret Zoph. Simple copy-paste is a strong data augmentation method for instance segmentation. In CVPR, 2021.
183
+ [14] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In CVPR, 2019.
184
+ [15] Stefan Hinterstoisser, Vincent Lepetit, Paul Wohlhart, and Kurt Konolige. On pre-trained image features and synthetic images for deep learning. In ECCV Workshops, 2018.
185
+ [16] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019.
186
+ [17] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In ICLR, 2022.
187
+ [18] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In ECCV, 2022.
188
+ [19] Lei Ke, Martin Danelljan, Xia Li, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Mask transfiner for high-quality instance segmentation. In CVPR, 2022.
189
+ [20] Lei Ke, Henghui Ding, Martin Danelljan, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Video mask transfiner for high-quality video instance segmentation. In ECCV, 2022.
190
+ [21] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C. Berg, Wan-Yen Lo, Piotr Dollár, and Ross Girshick. Segment anything. In ICCV, 2023.
191
+ [22] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, 2020.
192
+ [23] Philipp Krähenbühl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge potentials. In NeurIPS, 2011.
193
+ [24] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. IJCV, 128(7):1956–1981, 2020.
194
+ [25] Feng Li, Hao Zhang, Shilong Liu, Jian Guo, Lionel M Ni, and Lei Zhang. Dn-detr: Accelerate detr training by introducing query denoising. In CVPR, 2022.
195
+ [26] Xiang Li, Tianhan Wei, Yau Pun Chen, Yu-Wing Tai, and Chi-Keung Tang. Fss-1000: A 1000-class dataset for few-shot segmentation. In CVPR, 2020. preprint arXiv:2101.00190, 2021.
196
+ [28] Yanghao Li, Hanzi Mao, Ross Girshick, and Kaiming He. Exploring plain vision transformer backbones for object detection. In ECCV, 2022.
197
+ [29] Jun Hao Liew, Scott Cohen, Brian Price, Long Mai, and Jiashi Feng. Deep interactive thin object selection. In WACV, 2021.
198
+ [30] Guosheng Lin, Anton Milan, Chunhua Shen, and Ian Reid. Refinenet: Multi-path refinement networks for high-resolution semantic segmentation. In CVPR, 2017.
199
+ [31] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
200
+ [32] Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. arXiv preprint arXiv:2303.05499, 2023.
201
+ [33] Qi Lu, Jason Kuen, Guo Weidong, Shen Tiancheng, Gu Jiuxiang, Li Wenbo, Jia Jiaya, Lin Zhe, and Yang Ming-Hsuan. Fine-grained entity segmentation. arXiv preprint arxiv:2211.05776, 2022.
202
+ [34] Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alexander Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. arXiv:1704.00675, 2017.
203
+ [35] Xuebin Qin, Hang Dai, Xiaobin Hu, Deng-Ping Fan, Ling Shao, and Luc Van Gool. Highly accurate dichotomous image segmentation. In ECCV, 2022.
204
+ [36] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
205
+ [37] Tiancheng Shen, Yuechen Zhang, Lu Qi, Jason Kuen, Xingyu Xie, Jianlong Wu, Zhe Lin, and Jiaya Jia. High quality segmentation for ultra high-resolution images. In CVPR, 2022.
206
+ [38] Jianping Shi, Qiong Yan, Li Xu, and Jiaya Jia. Hierarchical image saliency detection on extended cssd. TPAMI, 38(4):717–729, 2015.
207
+ [39] Towaki Takikawa, David Acuna, Varun Jampani, and Sanja Fidler. Gated-scnn: Gated shape cnns for semantic segmentation. In ICCV, 2019.
208
+ [40] Chufeng Tang, Hang Chen, Xiao Li, Jianmin Li, Zhaoxiang Zhang, and Xiaolin Hu. Look closer to segment better: Boundary patch refinement for instance segmentation. In CVPR, 2021.
209
+ [41] Cameron Trotter, Georgia Atkinson, Matt Sharpe, Kirsten Richardson, A Stephen McGough, Nick Wright, Ben Burville, and Per Berggren. Ndd20: A large-scale few-shot dolphin dataset for coarse and fine-grained categorisation. arXiv preprint arXiv:2005.13359, 2020.
210
+ [42] Weiyao Wang, Matt Feiszli, Heng Wang, and Du Tran. Unidentified video objects: A benchmark for dense, open-world segmentation. In CVPR, 2021.
211
+ [43] Xinlong Wang, Xiaosong Zhang, Yue Cao, Wen Wang, Chunhua Shen, and Tiejun Huang. Seggpt: Segmenting everything in context. arXiv preprint arXiv:2304.03284, 2023.
212
+ [44] Qinrou Wen, Jirui Yang, Xue Yang, and Kewei Liang. Patchdct: Patch refinement for high quality instance segmentation. In ICLR, 2023.
213
+ [45] Yinghui Xing, Qirui Wu, De Cheng, Shizhou Zhang, Guoqiang Liang, and Yanning Zhang. Class-aware visual prompt tuning for vision-language pre-trained model. arXiv preprint arXiv:2208.08340, 2022.
214
+ [46] Chuan Yang, Lihe Zhang, Huchuan Lu, Xiang Ruan, and Ming-Hsuan Yang. Saliency detection via graph-based manifold ranking. In CVPR, 2013.
215
+ [47] Linjie Yang, Yuchen Fan, and Ning Xu. Video instance segmentation. In ICCV, 2019.
216
+ [48] Taojiannan Yang, Yi Zhu, Yusheng Xie, Aston Zhang, Chen Chen, and Mu Li. Aim: Adapting image models for efficient video action recognition. In ICLR, 2023.
217
+ [49] Yuan Yao, Ao Zhang, Zhengyan Zhang, Zhiyuan Liu, Tat-Seng Chua, and Maosong Sun. Cpt: Colorful prompt tuning for pre-trained vision-language models. arXiv preprint arXiv:2109.11797, 2021.
218
+ [50] Yuhui Yuan, Jingyi Xie, Xilin Chen, and Jingdong Wang. Segfix: Model-agnostic boundary refinement for segmentation. In ECCV, 2020.
219
+ [51] Yi Zeng, Pingping Zhang, Jianming Zhang, Zhe Lin, and Huchuan Lu. Towards high-resolution salient object detection. In ICCV, 2019.
220
+ [52] Chaoning Zhang, Dongshen Han, Yu Qiao, Jung Uk Kim, Sung-Ho Bae, Seungkyu Lee, and Choong Seon Hong. Faster segment anything: Towards lightweight sam for mobile applications. arXiv preprint arXiv:2306.14289, 2023.
221
+ [53] Hao Zhang, Feng Li, Shilong Liu, Lei Zhang, Hang Su, Jun Zhu, Lionel M. Ni, and Heung-Yeung Shum. Dino: Detr with improved denoising anchor boxes for end-to-end object detection. In ICLR, 2023.
222
+ [54] Hengshuang Zhao, Xiaojuan Qi, Xiaoyong Shen, Jianping Shi, and Jiaya Jia. Icnet for real-time semantic segmentation on high-resolution images. In ECCV, 2018.
223
+ [55] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017.
224
+ [56] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 2022.
225
+ [57] Ziqin Zhou, Yinjie Lei, Bowen Zhang, Lingqiao Liu, and Yifan Liu. Zegclip: Towards adapting clip for zero-shot semantic segmentation. In CVPR, 2023.
226
+ [58] Xueyan Zou, Zi-Yi Dou, Jianwei Yang, Zhe Gan, Linjie Li, Chunyuan Li, Xiyang Dai, Harkirat Behl, Jianfeng Wang, Lu Yuan, et al. Generalized decoding for pixel, image, and language. In CVPR, 2023.
227
+ [59] Xueyan Zou, Jianwei Yang, Hao Zhang, Feng Li, Linjie Li, Jianfeng Gao, and Yong Jae Lee. Segment everything everywhere all at once. In NeurIPS, 2023.
228
+
229
+ # Supplementary Material: Segment Anything in High Quality
230
+
231
+ In this supplementary material, Section 6 first presents the additional experimental analysis of our HQSAM, including more zero-shot transfer comparisons to SAM on both image and video benchmarks. Then, in Section 7, we describe more details of our method implementation, including the training and inference. In Section 8, we provide further details of our constructed HQSeg-44K dataset for training HQ-SAM. In Section 9, we show extensive visual results comparison between our HQ-SAM and SAM on COCO [31], DIS-test [35], HR-SOD [51], NDD20 [41], DAVIS [34], and YTVIS [47].
232
+
233
+ # 6 Supplementary experiments
234
+
235
+ SAM vs. HQ-SAM on Various Backbones In Table 10, we provide a comprehensive comparison between HQ-SAM and SAM using various backbones, including ViT-B, ViT-L, ViT-H and TinyViT. The comparison not only includes the numerical results on the four HQ datasets and COCO validation set, but also contains the model sizes/speed/memory. HQ-SAM consistently outperforms SAM using three different backbones, with over 10 points increase in mBIoU on the four HQ datasets. Notably, the ViT-B based HQ-SAM significantly improves the $\mathbf { A P } ^ { B }$ on COCO from 28.2 to 31.3 and AP from 44.4 to 46.7, with only a $1 . 1 \%$ increase in model parameters and negligible extra memory consumption.
236
+
237
+ Table 10: SAM vs. HQ-SAM on various ViT backbones. For the COCO dataset, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator.
238
+
239
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Four HQ datasets</td><td colspan="5">CoCo</td><td colspan="2">Model Params (MB)</td><td rowspan="2">FPS</td><td rowspan="2">Memory</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>APB</td><td>AP</td><td>APL</td><td>APM</td><td>APs</td><td>Total</td><td>Learnable</td></tr><tr><td>SAM-B HQ-SAM-B</td><td>70.6 86.3</td><td>62.3 78.1</td><td>28.2 31.3</td><td>44.4 46.7</td><td>57.7 62.9</td><td>48.7 50.5</td><td>32.1 32.0</td><td>358 362.1</td><td>358 4.1</td><td>10.1 9.8</td><td>5.1G 5.1G</td></tr><tr><td>SAM-L</td><td>79.5</td><td>71.1</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td><td>1191</td><td>1191</td><td>5.0</td><td>7.6G</td></tr><tr><td>HQ-SAM-L SAM-H</td><td>89.1 75.6</td><td>81.8 68.3</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td><td>1196.1</td><td>5.1 2446</td><td>4.8 3.5</td><td>7.6G 10.3G</td></tr><tr><td>HQ-SAM-H</td><td>89.3</td><td>81.5</td><td>34.0 34.9</td><td>48.9 49.9</td><td>64.5</td><td>53.3</td><td>34.4</td><td>2446 2452.1</td><td>6.1</td><td>3.4</td><td>10.3G</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>66.5</td><td>54.0</td><td>34.2</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MobileSAM</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>69.0</td><td>58.8</td><td>28.6</td><td>44.3</td><td>-</td><td>-</td><td>:</td><td>38.6</td><td>38.6</td><td>44.8</td><td>3.7G</td></tr><tr><td>Light HQ-SAM</td><td>81.4</td><td>71.6</td><td>29.6</td><td>45.0</td><td>-</td><td>-</td><td></td><td>40.3</td><td>1.7</td><td>41.2</td><td>3.7G</td></tr></table>
240
+
241
+ Table 11: Results on YouTubeVIS 2019 validation set and HQ-YTVIS test set using ViT-L based SAM. We adopt the SOTA detector Mask2Former [4] trained on the YouTubeVIS 2019 dataset as our video boxes prompt generator while reusing its object association prediction.
242
+
243
+ <table><tr><td rowspan="2">Model</td><td colspan="6">YTVIS 2019</td><td colspan="2">HQ-YTVIS</td></tr><tr><td>AP</td><td>AP50</td><td>AP75</td><td>APL</td><td>APm</td><td>APs</td><td>APB</td><td>APM</td></tr><tr><td>SAM</td><td>51.8</td><td>82.1</td><td>55.4</td><td>65.5</td><td>52.0</td><td>34.2</td><td>30.2</td><td>60.7</td></tr><tr><td>HQ-SAM</td><td>53.2</td><td>82.9</td><td>58.3</td><td>66.4</td><td>53.3</td><td>33.7</td><td>34.0</td><td>63.6</td></tr></table>
244
+
245
+ Zero-shot Video Instance Segmentation Comparison Extending from Table 8 of the paper (evaluation on the HQ-YTVIS benchmark [20]), we further perform a comparative analysis of zeroshot video instance segmentation results on the popular YTVIS 2019 [47] validation set. We take the pre-trained Mask2Former [4] as our video box prompts and feed them into SAM and our HQ-SAM for mask prediction. In Table 11, HQ-SAM achieves consistent gains of 1.4 points in Tube Mask AP, increasing SAM’s performance from 51.8 to 53.2. Interestingly, we find the $\mathsf { A P } _ { 7 5 }$ improvement with a higher IoU threshold for HQ-SAM is much larger than $\mathrm { { A P } _ { 5 0 } }$ , further validating the advantages of HQ-SAM in high-quality mask prediction.
246
+
247
+ Zero-shot Video Object Segmentation Comparison Besides video instance segmentation, in Table 12, we further report the comparison of video object segmentation results between HQ-SAM and SAM on DAVIS validation set in a zero-shot transfer protocol. We take the pre-trained XMem as our video box prompts and feed the same prompts into SAM and HQ-SAM. HQ-SAM improves SAM the $\mathcal { T } \& \mathcal { F }$ from 82.0 to 83.2 and the $\mathcal { F }$ score from 84.9 to 86.1, where $\mathcal { F }$ is for measuring the contour accuracy of the video objects.
248
+
249
+ Table 12: Results on DAVIS 2017 [34] validation set using ViT-L based SAM. We adopt the SOTA model XMem [7] as our video boxes prompt generator while reusing its object association prediction.
250
+
251
+ <table><tr><td>Model</td><td>J&amp;F</td><td>J</td><td>F</td></tr><tr><td>SAM</td><td>82.0</td><td>79.0</td><td>84.9</td></tr><tr><td>HQ-SAM</td><td>83.2</td><td>80.3</td><td>86.1</td></tr></table>
252
+
253
+ Robustness to Input Box Prompts In Table 13, we compare HQ-SAM to SAM by adding various scales of noises to the input ground truth box prompts. In practice, we cannot expect the input box prompts provided by humans in interactive modes to be identical to the ground truth (GT) boxes or extremely accurate. We follow the data augmentation code in DN-DETR [25] to add different noise scales and identify that our HQ-SAM is much more robust compared to SAM, where the relative mBIoU advantage improves from 10.7 to 20.5 when gradually increasing the noise scales. Note that our method is not trained with noised boxes. We also visualize such noised input case in Figure 11, where SAM is more sensitive to small box location shifts that easily happened during interactive annotation.
254
+
255
+ Table 13: Comparison of segmentation accuracy on the four HQ datasets by adding various noise levels to the GT box prompts input.
256
+
257
+ <table><tr><td>Model</td><td colspan="2">No Noise mIoU mBIoU</td><td colspan="2">Noise scale 0.2 mIoU mBIoU</td><td colspan="2">Noise scale 0.4 mIoU mBIoU</td></tr><tr><td>SAM</td><td>79.5</td><td>71.1</td><td>65.7</td><td>57.1</td><td>46.4</td><td>39.8</td></tr><tr><td>HQ-SAM</td><td>89.1</td><td>81.8个10.7</td><td>82.8</td><td>73.4个16.3</td><td>69.9</td><td>60.3个20.5</td></tr></table>
258
+
259
+ # 7 Additional Implementation details
260
+
261
+ Training Details During training HQ-SAM on the composed HQSeg-44K, we fix the model parameters of the pre-trained SAM model while only making the proposed HQ-SAM learnable, including HQ-Output Token, its associated three-layer MLP and three convolutions for HQ-Features fusion. Two of them are transposed convolutions (size $2 \times 2$ , stride 2) used to upscale encoder embedding size from $6 4 \times 6 4$ to $2 5 6 \times 2 5 6$ . We treat the new HQ-Output Token as the fifth mask token compared to the original four mask tokens in SAM’s mask decoder. During training, this new HQ-Output token of size $1 \times 2 5 6$ is concatenated with SAM’s mask tokens (size of $4 \times 2 5 6$ ), iou token (size of $1 \times 2 5 6 ,$ ) and prompt tokens (size of $\mathrm { N _ { p r o m p t } } { \times 2 5 6 } )$ as the input to the SAM’s mask decoder. For example, if the input image contains $N$ box prompts (size $\Nu { \times } 2 \times 2 5 6 )$ ), the final concatenated input and output shape for the 2-layer mask decoder of SAM is $\Nu \times ( 1 + 4 + 1 + 2 ) \times 2 5 6$ . For experiments using ViT-B, ViT-L, and ViT-H-based models on training, we adopt the same training setting, with a learning rate of 1e-3 and train our HQ-SAM for 12 epochs (learning rate drops to 1e-4 after 10 epochs). We supervise mask prediction of the new HQ-Output token with a combination of both BCE Loss and Dice Loss.
262
+
263
+ Implementation Details We follow the same inference pipeline of SAM but use the mask prediction from HQ-Output token as high-quality mask prediction. Table 10 reports the detailed inference speed comparison using various backbones. For box-prompting-based evaluation, we feed SAM and our HQ-SAM with the same image/video bounding boxes and adopt the single mask output mode of SAM. For interactive segmentation comparison using a single point, we follow SAM and adopt the “center” point of Ground Truth (GT) masks, which is at a maximal value location in a mask’s interior distance transform. For multiple-point evaluation, we randomly sample the points from the GT masks and report the averaged results with three trials.
264
+
265
+ # 8 More Details of HQSeg-44K
266
+
267
+ Data compostion of HQSeg-44K In Table 14, we provide more details of our composed new training dataset HQSeg-44K which contains 44,320 extremely accurate image mask annotations, where we show their annotation quality in Figure 8. HQSeg-44K is a collection of six existing image datasets including DIS [35] (train set), ThinObject-5K [29] (train set), FSS [26], ECSSD [38], MSRA-10K [8], DUT-OMRON [46] with extremely fine-grained mask labeling, where each of them contains 7.4K mask labels on average. This composed training set has no images/annotations overlapping with the zero-shot evaluation datasets adopted in our paper.
268
+
269
+ Effect of HQSeg-44K In Table 15, we show the advantage of using HQSeg-44K by comparing HQ-SAM training with 44K randomly sampled images and masks from SA-1B [21]. Using the same efficient token learning strategy, training with SA-1B (44K) decreases the averaged mBIoU on the four datasets from 71.1 to 70.1, while ours improves it from 71.1 to 81.8. This validates the effectiveness of our constructed HQSeg-44K benchmark in improving mask quality. Note that the ablation experiments in Table 2, Table 3, Table 4, and Table 9 of the paper are all based on the constructed HQSeg-44K.
270
+
271
+ Table 14: Data composition of our constructed HQ-Seg-44K.
272
+
273
+ <table><tr><td>Dataset</td><td>DIS [35]</td><td>Thin-Object 5k [29]</td><td>FSS [26]</td><td>DUTS [46]</td><td>ECSSD [38]</td><td>MSRA-10K [8]</td><td>Total</td></tr><tr><td>Image Num.</td><td>3000</td><td>4748</td><td>10000</td><td>15572</td><td>1000</td><td>10000</td><td>44320</td></tr></table>
274
+
275
+ ![](images/cd0a6b40af772e74a6dd84609517d95ad0361f92e9a7bdf1f11d27cbd994c7c6.jpg)
276
+ Figure 8: Visualization of annotated mask quality for randomly selected cases from the six dataset components of the HQ-Seg-44K. Zoom in for better viewing the fine-grained mask details.
277
+
278
+ Zero-shot results on DIS and ThinObject-5K We also report zero-shot results in Table 16 on DIS and ThinObject-5K by removing the training splits of either or both datasets from the training of
279
+
280
+ Table 15: Comparison of the training dataset. For the COCO dataset using ViT-L-based SAM, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator.
281
+
282
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Dataset</td><td colspan="2">DIS</td><td colspan="2">COIFT</td><td colspan="2">HRSOD</td><td colspan="2">ThinObject mBIoU</td><td rowspan="2">Average</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mIoU</td><td>mBIoU</td></tr><tr><td>SAM</td><td>SA-1B</td><td>62.0</td><td>52.8</td><td>92.1</td><td>86.5</td><td>90.2</td><td>83.1</td><td>73.6</td><td>61.8</td><td>79.5</td><td>71.1</td></tr><tr><td>HQ-SAM</td><td>+ SA-1B-44K</td><td>60.4</td><td>51.7</td><td>91.1</td><td>86.1</td><td>88.4</td><td>80.9</td><td>73.1</td><td>61.8</td><td>78.3</td><td>70.1</td></tr><tr><td>HQ-SAM</td><td>+ HQ-Seg-44K(Ours)</td><td>78.6</td><td>70.4</td><td>94.8</td><td>90.1</td><td>93.6</td><td>86.9</td><td>89.5</td><td>79.9</td><td>89.1</td><td>81.8</td></tr></table>
283
+
284
+ ![](images/e8c7b778d9aac766ea214213137b57b038b7dab53250c5ec0ddcfe7a2349f2f4.jpg)
285
+ Figure 9: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) on DIS test set, given the same red box prompt. HQ-SAM produces significantly more accurate boundaries.
286
+
287
+ HQ-SAM. The improvement of HQ-SAM over SAM is still substantial on DIS or ThinObject (over 10.0 points on DIS-mIoU and 9.0 points on ThinObject-mIoU), even when the corresponding training splits are removed from training.
288
+
289
+ Table 16: Zero-shot results on DIS and ThinObject-5K by removing the training splits of either or both datasets from the training of HQ-SAM. Results not obtained in a zero-shot manner (i.e. the training split was used), are shown in parenthesis to easily compare zero-shot results.
290
+
291
+ <table><tr><td>Training Setting</td><td>DIS-mIoU</td><td>DIS-mBIoU</td><td>ThinObject-mloU</td><td>ThinObject-mBIoU</td></tr><tr><td>SAM (baseline)</td><td>62.0</td><td>52.8</td><td>73.6</td><td>61.8</td></tr><tr><td>HQ-SAM (remove both DIS and ThinObject)</td><td>72.9</td><td>63.1</td><td>82.7</td><td>70.7</td></tr><tr><td>HQ-SAM (remove DIS)</td><td>74.7</td><td>66.2</td><td>(90.1)</td><td>(80.4)</td></tr><tr><td>HQ-SAM (remove ThinObject)</td><td>(78.4)</td><td>(70.3)</td><td>83.3</td><td>72.1</td></tr><tr><td>HQ-SAM (default HQSeg-44K)</td><td>(78.6)</td><td>(70.4)</td><td>(89.5)</td><td>(79.9)</td></tr></table>
292
+
293
+ # 9 More Visual Results Comparison
294
+
295
+ We provide more extensive visual results comparison in Figure 9 (DIS [35] test set), Figure 10 (zeroshot setting in COCO), Figure 11 (noised box input) and Figure 12 (zero-shot setting in HRSOD [51], NDD20 [41] and web images which cover objects with various structure complexities in diverse environments. In Figure 13 and Figure 14, we provide the zero-shot video segmentation results comparison on DAVIS 2017 and YTVIS 2019 benchmarks respectively. Besides, we include the dark underwater environment in NDD20 [41] and randomly selected web images in Figure 12, showing that the zero-shot segmentation power in SAM is well preserved by HQ-SAM. In Figure 12, we also include two failure cases in the rightmost two columns of the third row and bottom row, where HQ-SAM improves over SAM, but still cannot achieve fully correct mask prediction.
296
+
297
+ ![](images/e795bb0b5cd7075b6c3a38e3405e6ac7c9ed26c5bf98bf3f7fd17b615947eeaf.jpg)
298
+ Figure 10: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) on COCO val set in zero-shot setting, using a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. HQ-SAM predicts masks with higher quality than SAM with less mask artifacts.
299
+
300
+ ![](images/1af3959ed492899c80291476410d91a2c2469d5a8493f8c962999aa306800ca3.jpg)
301
+ Figure 11: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) with both the GT and noised green box prompt. HQ-SAM produces much more consistent and robust segmentation results regarding to the noises in the input boxes.
302
+
303
+ ![](images/c11fb3e2b4fdeb3edcc542de87a5867e05f33080fbaa3227e87d4558bbc33bfd.jpg)
304
+ Figure 12: Visual results comparison between SAM (top row and third row) vs. HQ-SAM (second row and bottom row) in zero-shot setting, given the same yellow box or point prompt. HQ-SAM produces significantly more detailed preserving masks while fixing mask errors with broken holes. The rightmost two columns in the third row and bottom row show two failure cases of HQ-SAM in extremely dark environments or very tiny metal rods.
305
+
306
+ ![](images/e68837b6fab3f016dbf3028fa6a390df5ea43384dbc9e110f1a8d9412d80b5b9.jpg)
307
+ Figure 13: Visual results comparison between SAM vs. HQ-SAM on video object segmentation benchmark DAVIS 2017 in zero-shot setting, given the same video boxes prompts generated by the pre-trained XMem [7].
308
+
309
+ ![](images/9fcb950c275fe6b53fde13b0b74eb0a8bd8c670b625373bc6ce7ed6a44586938.jpg)
310
+ Figure 14: Visual results comparison between SAM vs. HQ-SAM on video instance segmentation benchmark YTVIS 2019 in zero-shot setting, given the same video boxes prompts generated by the pre-trained Mask2Former [4].
parse/dev/RA7ND878XP/RA7ND878XP_content_list.json ADDED
@@ -0,0 +1,1379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Segment Anything in High Quality ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 287,
8
+ 122,
9
+ 710,
10
+ 148
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Lei $\\mathbf { K e } ^ { * 1 , 2 }$ Mingqiao Ye∗1 Martin Danelljan1 Yifan Liu1 Yu-Wing Tai3 Chi-Keung Tang2 Fisher Yu1 1ETH Zürich 2HKUST 3Dartmouth College ",
17
+ "bbox": [
18
+ 230,
19
+ 199,
20
+ 769,
21
+ 244
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 280,
32
+ 535,
33
+ 296
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "The recent Segment Anything Model (SAM) represents a big leap in scaling up segmentation models, allowing for powerful zero-shot capabilities and flexible prompting. Despite being trained with 1.1 billion masks, SAM’s mask prediction quality falls short in many cases, particularly when dealing with objects that have intricate structures. We propose HQ-SAM, equipping SAM with the ability to accurately segment any object, while maintaining SAM’s original promptable design, efficiency, and zero-shot generalizability. Our careful design reuses and preserves the pre-trained model weights of SAM, while only introducing minimal additional parameters and computation. We design a learnable High-Quality Output Token, which is injected into SAM’s mask decoder and is responsible for predicting the high-quality mask. Instead of only applying it on mask-decoder features, we first fuse them with early and final ViT features for improved mask details. To train our introduced learnable parameters, we compose a dataset of 44K fine-grained masks from several sources. HQ-SAM is only trained on the introduced detaset of 44k masks, which takes only 4 hours on 8 GPUs. We show the efficacy of HQ-SAM in a suite of 10 diverse segmentation datasets across different downstream tasks, where 8 out of them are evaluated in a zero-shot transfer protocol. Our code and pretrained models are at https://github.com/SysCV/SAM-HQ. ",
40
+ "bbox": [
41
+ 232,
42
+ 311,
43
+ 766,
44
+ 560
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 590,
55
+ 310,
56
+ 607
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Accurate segmentation of diverse objects is fundamental for a wide range of scene understanding applications, including image/video editing, robotic perception, and AR/VR. Trained with billionscale mask labels, the Segment Anything Model (SAM) [21] was recently released as a foundational vision model for general image segmentation. SAM is capable of segmenting a wide range of objects, parts, and visual structures in diverse scenarios, by taking a prompt consisting of points, a bounding box, or a coarse mask as input. Its zero-shot segmentation abilities have led to a rapid paradigm shift, as it can be transferred to numerous applications through simple prompting. ",
63
+ "bbox": [
64
+ 174,
65
+ 622,
66
+ 826,
67
+ 720
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "While SAM has achieved impressive performance, its segmentation results are still unsatisfactory in many cases. In particular, SAM suffers from two key problems: 1) Coarse mask boundaries, often even neglecting the segmentation of thin object structures, as shown in Figure 1. 2) Incorrect predictions, broken masks, or large errors in challenging cases. This is often related to SAM misinterpreting thin structures, such as the kite lines in the rightmost column of Figure 1. These types of failures severely limit the applicability and effectiveness of foundational segmentation models, such as SAM, in particular for automated annotation and image/video editing tasks, where highly accurate image masks are crucial. ",
74
+ "bbox": [
75
+ 174,
76
+ 727,
77
+ 825,
78
+ 837
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "We propose HQ-SAM, which can predict highly accurate segmentation masks, even in very challenging cases (see Figure 1), without compromising the strong zero-shot capabilities and flexibility of the original SAM. To preserve the efficiency and zero-shot performance, we propose a minimal adaptation of SAM, adding less than $0 . 5 \\%$ parameters, to extend its capability to high-quality segmentation. ",
85
+ "bbox": [
86
+ 176,
87
+ 843,
88
+ 823,
89
+ 872
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/407a1726493e2a258b5fdbedad4aa251a2c8caa2f4685673275f9117f4959218.jpg",
96
+ "image_caption": [
97
+ "Figure 1: The predicted masks of SAM vs. our HQ-SAM, given the same red box or several points on the object as input prompts. HQ-SAM produces significantly more detailed results with very accurate boundaries. In the rightmost column, SAM misinterprets the thin structure of the kite lines, and produces a large portion of errors with broken holes for the input box prompt. "
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 176,
102
+ 66,
103
+ 820,
104
+ 294
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "",
111
+ "bbox": [
112
+ 171,
113
+ 366,
114
+ 823,
115
+ 395
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "Directly fine-tuning the SAM decoder or introducing a new decoder module severely degrades the general zero-shot segmentation performance. We therefore propose the HQ-SAM architecture, which tightly integrates with and re-uses the existing learned SAM structure, in order to fully preserve the zero-shot performance. First, we design a learnable HQ-Output Token that is input to SAM’s mask decoder, alongside the original prompt and output tokens. Unlike the original output tokens, our HQ-Output Token and its associated MLP layers are trained to predict a high-quality segmentation mask. Second, instead of only re-using the SAM’s mask decoder features, our HQ-Output Token operates on a refined feature set to achieve accurate mask details. In particular, we use both global semantic context and local fine-grained features by fusing SAM’s mask decoder features with early and late feature maps from its ViT encoder. During training, we freeze the entire pre-trained SAM parameters, while only updating our HQ-Output Token, its associated three-layer MLPs, and a small feature fusion block. ",
122
+ "bbox": [
123
+ 173,
124
+ 401,
125
+ 825,
126
+ 565
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "Learning accurate segmentation requires a dataset with accurate mask annotations of diverse objects with complex and detailed geometries. SAM is trained on the SA-1B dataset, which contains 11M images with 1.1 billion masks automatically generated by a SAM-like model. However, using this extensive dataset presents significant cost implications and falls short of achieving the desired high-quality mask generations pursued in our work, as evident by SAM’s performance in Figure 1. Consequently, we compose a new dataset, called HQSeg-44K, which contains 44K extremely fine-grained image mask annotations. HQSeg44K is constructed by merging six existing image datasets [35, 29, 26, 38, 8, 46] with highly accurate mask labels, covering over 1,000 diverse semantic classes. Thanks to the smaller-scale dataset and our minimal integrated architecture, HQ-SAM can be trained in only 4 hours on 8 RTX 3090 GPUs. ",
133
+ "bbox": [
134
+ 174,
135
+ 574,
136
+ 504,
137
+ 835
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "image",
143
+ "img_path": "images/9e22ac4bdc3810019eab898b37d1b0278a0511dec8ff33f337ff25a25cb40fc0.jpg",
144
+ "image_caption": [
145
+ "Figure 2: Performance vs. speed vs. model size for an array of SAM variants [21, 52]. "
146
+ ],
147
+ "image_footnote": [],
148
+ "bbox": [
149
+ 522,
150
+ 577,
151
+ 813,
152
+ 799
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "To validate the effectiveness of HQ-SAM, we perform extensive quantitative and qualitative experimental analysis. We provide a comprehensive performance-speed-model size comparison on SAM variants [21, 52] in Figure 2. We compare HQ-SAM with SAM on a suite of 10 diverse segmentation datasets across different downstream tasks, where 8 out of them are under a zero-shot transfer protocol, including COCO [31], UVO [42], SGinW [58], LVIS [14], HQ-YTVIS [20], BIG [6], COIFT [29] and HR-SOD [51]. This rigorous evaluation demonstrates that the proposed HQ-SAM can produce higher-quality masks while maintaining the zero-shot capability compared with SAM. ",
159
+ "bbox": [
160
+ 174,
161
+ 842,
162
+ 825,
163
+ 911
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "",
170
+ "bbox": [
171
+ 173,
172
+ 92,
173
+ 823,
174
+ 119
175
+ ],
176
+ "page_idx": 2
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "2 Related Work ",
181
+ "text_level": 1,
182
+ "bbox": [
183
+ 174,
184
+ 140,
185
+ 321,
186
+ 157
187
+ ],
188
+ "page_idx": 2
189
+ },
190
+ {
191
+ "type": "text",
192
+ "text": "High-quality Segmentation Existing works for high-quality segmentation are mostly trained for a specific segmentation task, like image and video instance segmentation [22, 19, 20, 40, 44], semantic segmentation [30, 54, 39, 50] or panoptic segmentation [9], in a close-world paradigm. Some of them focus on post-segmentation refinement using with graphical models such as CRF [23] or region growing [10]. However, the CRF-based refinement is adhere to low-level color boundaries without fully utilizing high-level semantic context and cannot fix large segmentation errors. While some refinement-based works adopt separate deep networks for cascade iterative refinement [6, 37], they are prone to overfitting as shown by our experiment. Compared to these high-quality segmentation [19, 22, 33] or segmentation refinement methods, we focus on accurately segmenting diverse objects on new data with flexible prompting, and build a high-quality zero-shot segmentation model that generalizes to various segmentation tasks and domains. Unlike the post segmentation refinement works [6, 37], to preserve the zero-shot segmentation capability of SAM, HQ-SAM predicts the new high-quality mask directly by reusing the image encoder and mask decoder of SAM, instead of taking the coarse mask and images as the input and feeding it into a separate refinement network. The model architecture of HQ-SAM builds upon SAM with negligible overhead, where we propose efficient token learning for accurate mask predictions. This is completely different from previous high-quality segmentation works, and we show its effectiveness across a wide range of zero-shot experiments. ",
193
+ "bbox": [
194
+ 174,
195
+ 172,
196
+ 825,
197
+ 406
198
+ ],
199
+ "page_idx": 2
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "Fine-tuning and Prompt Tuning for Foundation Models Foundation models [2, 1] first appear in the NLP community, where large language models such as GPT series [2] show strong zero-shot generalization to unseen tasks and data. Then, some prompt-based learning works [16, 27, 17] are proposed to help these pre-trained models generalize to the downstream tasks instead of fine-tuning the internal model parameters [15] for better transfer learning. For vision-based foundation models [21, 43, 59], prompt engineering [56, 45, 49, 57] that freezes the pre-trained model is first explored in vision-language models, such as CLIP [36]. These prompts with learnable parameters are designed to help downstream tasks with better context optimization. Different from the existing prompt-based or finetuning works, we focus on the minimal adaptation of SAM toward high-quality segmentation. We directly use the proposed HQ-Output Token output for accurate mask prediction, instead of only leveraging some learnable parameters [56] to help context learning and better generalization. ",
204
+ "bbox": [
205
+ 174,
206
+ 412,
207
+ 825,
208
+ 565
209
+ ],
210
+ "page_idx": 2
211
+ },
212
+ {
213
+ "type": "text",
214
+ "text": "3 Method ",
215
+ "text_level": 1,
216
+ "bbox": [
217
+ 174,
218
+ 585,
219
+ 269,
220
+ 603
221
+ ],
222
+ "page_idx": 2
223
+ },
224
+ {
225
+ "type": "text",
226
+ "text": "We propose HQ-SAM to upgrade SAM for high-quality zero-shot segmentation. HQ-SAM is lightweight and only introduces two important adaptations to the SAM model. In Sec 3.1, we first briefly review the architecture of SAM on which HQ-SAM is built. Then, in Sec 3.2, we introduce our HQ-SAM with High-Quality Token (HQ-Output Token) and Global-local Feature Fusion, which are the key components to achieve better segmentation quality for SAM while preserving its zero-shot capability. Finally, in Sec 3.3, we describe the training and inference process of HQ-SAM, which is both data and computationally efficient. ",
227
+ "bbox": [
228
+ 174,
229
+ 618,
230
+ 825,
231
+ 715
232
+ ],
233
+ "page_idx": 2
234
+ },
235
+ {
236
+ "type": "text",
237
+ "text": "3.1 Preliminaries: SAM ",
238
+ "text_level": 1,
239
+ "bbox": [
240
+ 174,
241
+ 733,
242
+ 352,
243
+ 747
244
+ ],
245
+ "page_idx": 2
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "SAM [21] is composed of three modules: (a) Image encoder: a heavy ViT-based backbone for image feature extraction, resulting in image embedding in spatial size $6 4 \\times 6 4$ . (b) Prompt encoder: encoding the interactive positional information from the input points/boxes/masks to provide for the mask decoder. (c) Mask decoder: a two-layer transformer-based decoder takes both the extracted image embedding with the concatenated output and prompt tokens for final mask prediction. The released SAM model is trained on the large-scale SA-1B dataset, which contains over 1 billion automatically generated masks $4 0 0 \\times$ more masks than any existing segmentation datasets [14, 24]) and 11 million images. Thus, SAM shows valuable strong zero-shot generalization to new data without the necessity for additional training. However, we also note that SAM training is very expensive, where distributively training ViT-H-based SAM for 2 epochs on SA-1B requires 256 GPUs with a large batch size of 256 images. For more SAM method details, we refer readers to [21]. ",
250
+ "bbox": [
251
+ 174,
252
+ 758,
253
+ 825,
254
+ 911
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "image",
260
+ "img_path": "images/4e828903d98d1c98ee300a042bb3f9054e815e3f7dbe43ceaae583eb665cb4b3.jpg",
261
+ "image_caption": [
262
+ "Figure 3: HQ-SAM introduces HQ-Output Token and Global-local Feature Fusion to SAM for high-quality mask prediction. To keep the zero-shot capability of SAM, the lightweight HQ-Output Token reuses SAM’s mask decoder, and generates new MLP layers for performing point-wise product with fused HQ-Features. During training, only a few learnable parameters in HQ-SAM are trainable while we fix the model parameters of the pre-trained SAM. The prompt encoder is omitted here for clarity. Error correction is simply used as a direct element-wise sum between the predicted logits of the SAM’s Output Token and the HQ-Output Token during inference. "
263
+ ],
264
+ "image_footnote": [],
265
+ "bbox": [
266
+ 176,
267
+ 92,
268
+ 821,
269
+ 292
270
+ ],
271
+ "page_idx": 3
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "3.2 Ours: HQ-SAM ",
276
+ "text_level": 1,
277
+ "bbox": [
278
+ 174,
279
+ 410,
280
+ 326,
281
+ 425
282
+ ],
283
+ "page_idx": 3
284
+ },
285
+ {
286
+ "type": "text",
287
+ "text": "In this section, we describe the architecture of the HQ-SAM network. To preserve the zero-shot transfer capability of SAM, while preventing model overfitting or catastrophic forgetting, instead of directly finetuning SAM or adding a new heavy decoder network, we take a minimal adaptation approach as much as possible. To this end, HQ-SAM reuses the pre-trained model weights of SAM as much as possible with only two new key components, namely, High-Quality Output Token and Global-local Feature Fusion, as illustrated in Figure 3. HQ-SAM can thus be regarded as a highquality zero-shot segmentation model evolved from SAM with negligible extra model parameters and computation cost. ",
288
+ "bbox": [
289
+ 174,
290
+ 438,
291
+ 825,
292
+ 549
293
+ ],
294
+ "page_idx": 3
295
+ },
296
+ {
297
+ "type": "text",
298
+ "text": "3.2.1 High-Quality Output Token ",
299
+ "text_level": 1,
300
+ "bbox": [
301
+ 174,
302
+ 568,
303
+ 418,
304
+ 583
305
+ ],
306
+ "page_idx": 3
307
+ },
308
+ {
309
+ "type": "text",
310
+ "text": "We propose efficient token learning for improving the mask quality of SAM. As shown in Figure 3, in SAM’s original mask decoder design, the output token (similar to object query in DETR [3]) is adopted for mask prediction, which predicts dynamic MLP weights and then performs point-wise product with the mask features. To promote SAM’s mask quality in HQ-SAM, instead of directly taking SAM’s coarse masks as input, we introduce the HQ-Output token and a new mask prediction layer for high-quality mask prediction. ",
311
+ "bbox": [
312
+ 173,
313
+ 593,
314
+ 825,
315
+ 678
316
+ ],
317
+ "page_idx": 3
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "In Figure 3, by reusing and fixing SAM’s mask decoder, a new learnable HQ-Output Token (size of $1 \\times 2 5 6 ,$ is concatenated with SAM’s output tokens (size of $4 \\times 2 5 6$ and prompt tokens (size of $\\mathrm { N _ { p r o m p t } } { \\times } 2 5 6 $ ) as the input to the SAM’s mask decoder. Similar to the original output token, in each attention layer, HQ-Output Token first performs self-attention with other tokens and then conducts both token-to-image and the reverse image-to-token attention for its feature updating. Note that HQ-Output Token uses the point-wise MLP shared by the other tokens in each decoder layer. After passing through two decoder layers, the updated HQ-Output Token has access to the global image context, the critical geometric/type information of prompt tokens as well as hidden mask information of the other output tokens. Finally, we add a new three-layer MLP to generate dynamic convolutional kernels from the updated HQ-Output Token, which then performs spatially point-wise product with the fused HQ-feature for high-quality mask generation. ",
322
+ "bbox": [
323
+ 174,
324
+ 683,
325
+ 825,
326
+ 835
327
+ ],
328
+ "page_idx": 3
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "Instead of directly finetuning SAM or further adding a heavy post-refinement network, we only allow the HQ-Output Token and its associated three-layer MLPs to be trained for correcting the mask errors of SAM’s output token. This is completely different from existing high-quality segmentation models [19, 6, 20, 22]. We identify two main advantages of our efficient token learning through extensive experiments: 1) This strategy significantly improves SAM’s mask quality while only introducing negligible parameters compared to original SAM, making HQ-SAM training extremely time and data-efficient; 2) The learned token and MLP layers do not overfit to mask the annotation bias of a specific dataset, thus keeping SAM’s strong zero-shot segmentation capability on new images without catastrophic knowledge forgetting. ",
333
+ "bbox": [
334
+ 174,
335
+ 842,
336
+ 823,
337
+ 911
338
+ ],
339
+ "page_idx": 3
340
+ },
341
+ {
342
+ "type": "text",
343
+ "text": "",
344
+ "bbox": [
345
+ 174,
346
+ 92,
347
+ 825,
348
+ 147
349
+ ],
350
+ "page_idx": 4
351
+ },
352
+ {
353
+ "type": "text",
354
+ "text": "3.2.2 Global-local Fusion for High-quality Features ",
355
+ "text_level": 1,
356
+ "bbox": [
357
+ 174,
358
+ 162,
359
+ 542,
360
+ 178
361
+ ],
362
+ "page_idx": 4
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "Very accurate segmentation also requires input image feature with both rich global semantic context and local boundary details. To further promote mask quality, we enrich both the high-level object context and low-level boundary/edge information in the mask decoder features of SAM. Instead of directly using SAM’s mask decoder feature, we compose the new high-quality features (HQFeatures) by extracting and fusing features from different stages of the SAM model: 1) The early layer local feature of SAM’s ViT encoder with spatial shape $6 4 \\times 6 4$ , which captures more general image edge/boundary details [12]. Concretely, we extract the feature after the first global attention block of the ViT encoder, and for ViT-Large based SAM, this is the 6th block output for the 24 blocks in total; 2) The final layer global feature of SAM’s ViT encoder with shape $6 4 \\times 6 4$ , which has more global image context information; 3) The mask feature in SAM’s mask decoder with size $2 5 6 \\times 2 5 6$ , which is also shared by the output tokens, contains strong mask shape information. ",
367
+ "bbox": [
368
+ 174,
369
+ 186,
370
+ 825,
371
+ 339
372
+ ],
373
+ "page_idx": 4
374
+ },
375
+ {
376
+ "type": "text",
377
+ "text": "As shown in Figure 3, to obtain the input HQ-Features, we first upsample the early-layer and finallayer encoder features to the spatial size $2 5 6 \\times 2 5 6$ by transposed convolution. Then, we sum up these three types of features in an element-wise manner after simple convolutional processing. We show that this global-local feature fusion is simple while effective, yielding detail-preserving segmentation results with a small memory footprint and computation burden. We also perform detailed ablation on the effect of each feature source in the experimental section (Table 3). ",
378
+ "bbox": [
379
+ 174,
380
+ 345,
381
+ 825,
382
+ 428
383
+ ],
384
+ "page_idx": 4
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "3.3 Training and Inference of HQ-SAM ",
389
+ "text_level": 1,
390
+ "bbox": [
391
+ 176,
392
+ 436,
393
+ 462,
394
+ 452
395
+ ],
396
+ "page_idx": 4
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "Training Data Construction To train HQ-SAM in a data-efficient manner, instead of further training on SA-1B [21], we compose a new training dataset HQSeg-44K which contains 44,320 extremely accurate image mask annotations. We note that the released SA-1B dataset only contains automatically generated mask labels, missing very accurate manual annotation on objects with complex structures. Due to the annotation difficulty, HQSeg-44K leverages a collection of six existing image datasets including DIS [35] (train set), ThinObject-5K [29] (train set), FSS-1000 [26], ECSSD [38], MSRA10K [8], DUT-OMRON [46] with extremely fine-grained mask labeling, where each of them contains 7.4K mask labels on average. To make HQ-SAM robust and generalizable to new data, HQSeg-44K contains diverse semantic classes of more than 1,000. We show the advantage of using HQSeg-44K by comparing HQ-SAM training with 44K randomly sampled images and masks from SA-1B [21] in our supplemental analysis. ",
401
+ "bbox": [
402
+ 173,
403
+ 462,
404
+ 826,
405
+ 614
406
+ ],
407
+ "page_idx": 4
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "HQ-SAM Training During training, we fix the model parameters of the pre-trained SAM model while only making the proposed HQ-SAM learnable. The learnable parameters thus only include the HQ-Output Token, its associated three-layer MLP and three simple convolutions for HQ-Features fusion. Since SAM is designed for flexible segmentation prompts, we train HQ-SAM by sampling mixed types of prompts including bounding boxes, randomly sampled points, and coarse masks input. We generate these degraded masks by adding random Gaussian noise in the boundary regions of the GT masks. For generalizability to different object scales, we use large-scale jittering [13]. We use a learning rate of 0.001 and train our HQ-SAM for 12 epochs, with a learning rate drop after 10 epochs. We train on 8 Nvidia GeForce RTX 3090 GPUs with a total batch size of 32, which takes 4 hours to train for 16.6K iterations. Please refer to our supplemental file for more details. ",
412
+ "bbox": [
413
+ 174,
414
+ 621,
415
+ 825,
416
+ 760
417
+ ],
418
+ "page_idx": 4
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "HQ-SAM Inference We follow the same inference pipeline of SAM but use the mask prediction from HQ-Output token as high-quality mask prediction. During inference, we sum the predicted logits of the SAM mask (by Output Token) and our predicted mask (by HQ-Output Token) for mask correction on spatial resolution $2 5 6 \\times 2 5 6$ . Then we up-sample the corrected mask to the original resolution $1 0 2 4 \\times 1 0 2 4$ as our output. ",
423
+ "bbox": [
424
+ 174,
425
+ 766,
426
+ 823,
427
+ 835
428
+ ],
429
+ "page_idx": 4
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "SAM vs. HQ-SAM on Training and Inference In Table 1, we report detailed training and inference comparisons between our HQ-SAM and SAM. While HQ-SAM produces substantially better segmentation quality, its training is very quick and affordable, which only takes 4 hours with 8 RTX3090 GPUs. HQ-SAM is also lightweight and efficient, introducing negligible increases in model parameters, GPU memory usage, and inference time per image. ",
434
+ "bbox": [
435
+ 174,
436
+ 842,
437
+ 823,
438
+ 911
439
+ ],
440
+ "page_idx": 4
441
+ },
442
+ {
443
+ "type": "table",
444
+ "img_path": "images/0cc7fae8ff33807706e786cf8bb5b5fedacacef58fe28261c3c11801d83dad51.jpg",
445
+ "table_caption": [
446
+ "Table 1: Training and inference comparison between ViT-L [11] based SAM and HQ-SAM. HQ-SAM brings negligible extra computation burden to SAM, with less than $0 . 5 \\%$ increase in model parameters and reaching $96 \\%$ of its original speed. SAM-L is trained on 128 A100 GPUs for 180k iterations. Based on SAM-L, we only need to train our HQ-SAM on 8 RTX3090 GPUs for 4 hours. "
447
+ ],
448
+ "table_footnote": [],
449
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"4\">Training</td><td colspan=\"2\">Inference</td></tr><tr><td>Learnable Params (M)</td><td># GPU</td><td>Batch Size</td><td>Time (h)</td><td>FPS</td><td>Mem.</td></tr><tr><td>SAM [21]</td><td>1191</td><td>128</td><td>128</td><td>N/A</td><td>5.0</td><td>7.6G</td></tr><tr><td>HQ-SAM</td><td>5.1</td><td>8</td><td>32</td><td>4</td><td>4.8</td><td>7.6G</td></tr></table>",
450
+ "bbox": [
451
+ 220,
452
+ 154,
453
+ 771,
454
+ 219
455
+ ],
456
+ "page_idx": 5
457
+ },
458
+ {
459
+ "type": "text",
460
+ "text": "4 Experiments ",
461
+ "text_level": 1,
462
+ "bbox": [
463
+ 173,
464
+ 233,
465
+ 312,
466
+ 251
467
+ ],
468
+ "page_idx": 5
469
+ },
470
+ {
471
+ "type": "text",
472
+ "text": "4.1 Experimental Setup ",
473
+ "text_level": 1,
474
+ "bbox": [
475
+ 174,
476
+ 263,
477
+ 352,
478
+ 280
479
+ ],
480
+ "page_idx": 5
481
+ },
482
+ {
483
+ "type": "text",
484
+ "text": "Datasets For training we use the compiled HQSeg-44K, described in Section 3.3. For a comprehensive evaluation of the segmentation performance of HQ-SAM, we perform experiments on a wide range of datasets, including four extremely fine-grained segmentation datasets: DIS [35] (validation set), ThinObject-5K [29] (test set), COIFT [29] and HR-SOD [51]. Besides, we experiment on popular and challenging benchmarks across various image/video-based segmentation tasks in zero-shot settings, such as COCO [31], SGinW [58], UVO [42], LVIS [14], HQ-YTVIS [20] and BIG [6]. ",
485
+ "bbox": [
486
+ 173,
487
+ 289,
488
+ 826,
489
+ 373
490
+ ],
491
+ "page_idx": 5
492
+ },
493
+ {
494
+ "type": "text",
495
+ "text": "Evaluation Metrics To accurately quantify improvements in mask quality, instead of only employing the standard mask AP or mask mIoU, we also adopt boundary metrics mBIoU and boundary $\\mathsf { A P } _ { B }$ [5]. We also evaluate on stricter $\\mathsf { A P } _ { B } ^ { \\mathrm { s t r i c t } }$ by adjusting the default dilation ratio from 0.02 to 0.01 on UVO [42] and LVIS [14]. For evaluation on the four fine-grained segmentation datasets [35, 29, 51], we also report the averaged boundary and mask IoU among them. For video instance segmentation evaluation on HQ-YTVIS [20], we use both Tube Boundary $\\mathsf { A P } ^ { B }$ and Tube Mask $\\mathsf { A P } ^ { M }$ . ",
496
+ "bbox": [
497
+ 174,
498
+ 378,
499
+ 825,
500
+ 463
501
+ ],
502
+ "page_idx": 5
503
+ },
504
+ {
505
+ "type": "text",
506
+ "text": "4.2 Ablation Experiments ",
507
+ "text_level": 1,
508
+ "bbox": [
509
+ 174,
510
+ 478,
511
+ 366,
512
+ 493
513
+ ],
514
+ "page_idx": 5
515
+ },
516
+ {
517
+ "type": "text",
518
+ "text": "We conduct detailed ablation studies on the proposed HQ-SAM using ViT-Large as the backbone, analyzing the impact of the proposed HQ-Output Token and HQ-Features on segmentation quality especially in zero-shot cases. For ablation experiments, we use the four aforementioned extremely accurate segmentation datasets, namely, DIS (val) [35], ThinObject-5K (test) [29], COIFT [29] and HR-SOD [51] as well as the COCO validation set. ",
519
+ "bbox": [
520
+ 174,
521
+ 503,
522
+ 825,
523
+ 573
524
+ ],
525
+ "page_idx": 5
526
+ },
527
+ {
528
+ "type": "text",
529
+ "text": "Effect of the High-Quality Output Token . HQ-SAM employs HQ-Output Token for high-quality mask prediction. Table 2 compares our HQ-Output Token to the baseline SAM and other existing prompt/token learning strategies, such as adding an additional three context tokens [56] as learnable vectors into the SAM’s mask decoder for better context learning. Compared to using context tokens, the HQ-Output token consistently brings larger performance gains on four high-quality datasets, with 13.2 mBIoU on DIS and 2.7 mBIoU on COIFT datasets. We also perform other ablation experiment variants, such as computing the scaled dot product [18] between the original SAM’s output token and our HQ-Output token or restricting the mask loss to only inside the boundary regions, and find they slightly decrease the averaged performance on the four evaluation datasets. Compared to SAM, HQ-SAM significantly improves the mBIoU on DIS benchmark from 52.8 to 70.4 and also promotes the mBIoU on the HRSOD dataset for 3.8 points. ",
530
+ "bbox": [
531
+ 173,
532
+ 580,
533
+ 825,
534
+ 732
535
+ ],
536
+ "page_idx": 5
537
+ },
538
+ {
539
+ "type": "text",
540
+ "text": "Ablation on the Global-local Fusion for HQ-Features Table 3 tabulates the effect of global-local fusion, where the importance of each feature component is analyzed in HQ-Features during the fusion process. Compared to directly using the mask decoder feature of SAM, the entire HQ-Features bring an obvious advantage of $2 . 6 \\ \\mathrm { m B I o U }$ on four highly accurate segmentation datasets. The final-layer ViT encoder feature with global context increases the mBIoU from 80.1 to 81.3. while the early-layer feature with local details further promotes the mBIoU to 81.8. We also replace the proposed global-local fusion with the conventional FPN to build a feature pyramid for fusion, and found this brought an inferior performance, decreasing from 89.1 to 87.4 mIoU. ",
541
+ "bbox": [
542
+ 174,
543
+ 738,
544
+ 825,
545
+ 849
546
+ ],
547
+ "page_idx": 5
548
+ },
549
+ {
550
+ "type": "text",
551
+ "text": "Comparison to SAM finetuning or post-refinement . In Table 4, we compare our efficient token adaptation strategy to adding an extra post-refinement network [6] and model finetuning, including directly finetuning SAM’s mask decoder or only finetuning its output token for mask prediction. Adding an extra heavy post-refinement network brings limited averaged performance increase on four HQ datasets but leads to very poor performance on COCO, indicating strong overfitting. We also observe a similar phenomenon when directly finetuning SAM’s mask decoder. Only finetuning SAM’s output token can address the catastrophic forgetting problem with improvement on the four HQ datasets and COCO. However, the incremental improvement is still much smaller compared to ours. HQ-SAM improves 1.1 $\\mathsf { A P } _ { B }$ on COCO while output token finetuning only gives an increase of $0 . 4 \\ : \\mathrm { A P } _ { B }$ . This shows the advantage of HQ-SAM in data-efficient learning while preserving the zero-shot capability of SAM. ",
552
+ "bbox": [
553
+ 176,
554
+ 856,
555
+ 825,
556
+ 911
557
+ ],
558
+ "page_idx": 5
559
+ },
560
+ {
561
+ "type": "table",
562
+ "img_path": "images/ff9b9ede5a8323bc38e1774e419cf448288a66f9151302d35eb1e865c5bc7d57.jpg",
563
+ "table_caption": [
564
+ "Table 2: Ablation study of the HQ-Output Token on four extremely fine-grained segmentation datasets. We adopt the boxes converted from their GT masks as the box prompt input. By default, we train the predicted mask of HQ Output-Token by computing full GT mask loss. "
565
+ ],
566
+ "table_footnote": [],
567
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">DIS [35]</td><td colspan=\"2\">COIFT [29]</td><td colspan=\"2\">HRSOD [51]</td><td colspan=\"2\">ThinObject [29]</td><td colspan=\"2\">Average</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td></tr><tr><td>SAM (baseline)</td><td>62.0</td><td>52.8</td><td>92.1</td><td>86.5</td><td>90.2</td><td>83.1</td><td>73.6</td><td>61.8</td><td>79.5</td><td>71.1</td></tr><tr><td>Using SAM&#x27;s mask decoder feature:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SAM+Context Token [56]</td><td>71.5</td><td>62.2</td><td>93.0</td><td>87.7</td><td>91.8</td><td>85.0</td><td>84.5</td><td>73.1</td><td>85.2</td><td>77.0</td></tr><tr><td>SAM + HQ-Output Token (× Output Token)</td><td>75.1</td><td>65.8 66.4</td><td>93.9</td><td>88.9</td><td>93.0</td><td>86.1</td><td>86.1</td><td>74.6</td><td>87.0</td><td>78.9</td></tr><tr><td>SAM + HQ-Output Token (Boundary Loss) SAM + HQ-Output Token</td><td>75.2 75.3</td><td>66.0</td><td>94.0 94.2</td><td>88.9 89.2</td><td>92.1 93.0</td><td>85.7 86.1</td><td>87.3 86.8</td><td>76.0 75.4</td><td>87.2 87.3</td><td>79.3</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>79.2</td></tr><tr><td>Using Our HQ-Feature:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SAM + HQ-Output Token (+ Context Token)</td><td>78.5</td><td>70.4</td><td>94.6</td><td>89.6</td><td>93.6</td><td>87.0</td><td>88.9 89.5</td><td>79.3</td><td>88.9 89.1</td><td>81.6</td></tr><tr><td>SAM+ HQ-Output Token</td><td>78.6</td><td>70.4</td><td>94.8</td><td>90.1</td><td>93.6</td><td>86.9</td><td></td><td>79.9</td><td></td><td>81.8</td></tr></table>",
568
+ "bbox": [
569
+ 174,
570
+ 143,
571
+ 825,
572
+ 272
573
+ ],
574
+ "page_idx": 6
575
+ },
576
+ {
577
+ "type": "table",
578
+ "img_path": "images/d633a7cec868e3d48b90183127f1b623fd8889d357c19b8c9109510afb7aa15a.jpg",
579
+ "table_caption": [
580
+ "Table 3: Ablation study on the HQ-Features sources. Early-layer denotes the feature after the first global attention block of the ViT encoder, while final-layer denotes the output of the last ViT block. Four HQ datasets denote DIS (val) [35], ThinObject-5K (test) [29], COIFT [29] and HR-SOD [51]. "
581
+ ],
582
+ "table_footnote": [],
583
+ "table_body": "<table><tr><td>Model</td><td>Fusion conv</td><td>Decoder Mask feature</td><td>ViT Encoder Final-layer Early-layer</td><td>mIoU</td><td>Four HQ datasets mBIoU</td></tr><tr><td>SAM [21]</td><td></td><td>√</td><td></td><td>79.5</td><td>71.1</td></tr><tr><td rowspan=\"5\">HQ-SAM (Ours)</td><td rowspan=\"5\">广</td><td>√</td><td></td><td></td><td>87.3 79.2</td></tr><tr><td>√</td><td></td><td>87.8</td><td>80.1</td></tr><tr><td></td><td></td><td>15.1</td><td>9.0</td></tr><tr><td>√ √</td><td>广</td><td></td><td>88.6 81.3</td></tr><tr><td>√ √</td><td>√ √ √ 丁</td><td>88.6 89.1</td><td>81.1 81.8</td></tr></table>",
584
+ "bbox": [
585
+ 207,
586
+ 333,
587
+ 792,
588
+ 469
589
+ ],
590
+ "page_idx": 6
591
+ },
592
+ {
593
+ "type": "text",
594
+ "text": "",
595
+ "bbox": [
596
+ 173,
597
+ 477,
598
+ 825,
599
+ 574
600
+ ],
601
+ "page_idx": 6
602
+ },
603
+ {
604
+ "type": "image",
605
+ "img_path": "images/bbcd16187a66390c4705bad3e39d81e9e20ed9ae9461c2d432578811e25a09dc.jpg",
606
+ "image_caption": [
607
+ "Figure 4: Recall rate comparison between COIFT [29] and HRSOD [51] under the zero-shot protocol, using BIoU thresholds ranging from loose to strict. The performance gap between SAM and our HQ-SAM increases significantly when we vary from a loose BIoU threshold of 0.5 to a very strict threshold of 0.9, showing the advantage of HQ-SAM in predicting very accurate segmentation masks. "
608
+ ],
609
+ "image_footnote": [],
610
+ "bbox": [
611
+ 179,
612
+ 583,
613
+ 816,
614
+ 743
615
+ ],
616
+ "page_idx": 6
617
+ },
618
+ {
619
+ "type": "text",
620
+ "text": "Accuracy analysis at different BIoU thresholds Figure 4 compares SAM and HQ-SAM from loose to strict BIoU thresholds. We plot the percentage of mask predictions that have a BIoU larger than the threshold indicated on the $\\mathbf { X }$ -axis. The large performance gap with strict IoU thresholds on both COIFT [29] and HRSOD [51] clearly validates the advantage of HQ-SAM in predicting very accurate masks. However, even at the loose threshold of 0.5, HQ-SAM reduces the number of incorrect predictions by SAM by $81 \\%$ for COIFT and $69 \\%$ for HRSOD. This shows that HQ-SAM predictions are not only substantially more accurate but also more robust in challenging cases. ",
621
+ "bbox": [
622
+ 173,
623
+ 814,
624
+ 825,
625
+ 911
626
+ ],
627
+ "page_idx": 6
628
+ },
629
+ {
630
+ "type": "table",
631
+ "img_path": "images/cb3256880904bef89d1da7b1ccfaf39a1af9505c9407a7ca88a1a04ec57f2fda.jpg",
632
+ "table_caption": [
633
+ "Table 4: Comparison with model finetuning or extra post-refinement [6]. For the COCO dataset, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. "
634
+ ],
635
+ "table_footnote": [],
636
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Four HQ datasets mIoU mBIoU</td><td rowspan=\"2\"></td><td colspan=\"5\">CoCo</td></tr><tr><td>APB</td><td>AP</td><td>APL</td><td>APm</td><td>APs</td></tr><tr><td>SAM (baseline)</td><td>79.5</td><td>71.1</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td></tr><tr><td>Training the whole SAM</td><td>38.0</td><td>12.2</td><td>0.2</td><td>5.5</td><td>1</td><td>-</td><td>1</td></tr><tr><td>Add Context Token [56]</td><td>85.2</td><td>77.0</td><td>31.9</td><td>47.2</td><td>65.1</td><td>51.2</td><td>31.9</td></tr><tr><td>CascadePSP Post-refinement [6]</td><td>80.9</td><td>74.6</td><td>2.8</td><td>13.4</td><td>43.4</td><td>9.4</td><td>0.0</td></tr><tr><td>CRM Post-refinement [37]</td><td>81.4</td><td>75.4</td><td>15.9</td><td>28.7</td><td>=</td><td>-</td><td>-</td></tr><tr><td>Finetune SAM&#x27;s decoder</td><td>87.6</td><td>79.5</td><td>9.0</td><td>19.5</td><td>45.2</td><td>15.8</td><td>4.7</td></tr><tr><td>Finetune SAM&#x27;s output token</td><td>87.6</td><td>79.7</td><td>33.7</td><td>48.7</td><td>66.0</td><td>52.3</td><td>33.6</td></tr><tr><td>HQ-SAM (Ours)</td><td>89.1</td><td>81.8</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td></tr></table>",
637
+ "bbox": [
638
+ 207,
639
+ 130,
640
+ 792,
641
+ 286
642
+ ],
643
+ "page_idx": 7
644
+ },
645
+ {
646
+ "type": "table",
647
+ "img_path": "images/21a741465b78b0ed34fcd327f5b45c79d3f3097733da40389229a3de9fd45ab8.jpg",
648
+ "table_caption": [
649
+ "Table 5: Zero-shot open-world instance segmentation results comparison on UVO [42]. We use FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. $* ^ { s t r i c t }$ denotes the boundary region with a tighter threshold. "
650
+ ],
651
+ "table_footnote": [],
652
+ "table_body": "<table><tr><td>Model</td><td>APsict</td><td>AP</td><td>AP6</td><td>APB</td><td>APB75</td><td>APB50</td><td>AP</td></tr><tr><td>SAM</td><td>8.6</td><td>3.7</td><td>25.6</td><td>17.3</td><td>14.4</td><td>37.7</td><td>29.7</td></tr><tr><td>HQ-SAM</td><td>9.9</td><td>5.0</td><td>28.2</td><td>18.5</td><td>16.3</td><td>38.6</td><td>30.1</td></tr></table>",
653
+ "bbox": [
654
+ 256,
655
+ 339,
656
+ 735,
657
+ 393
658
+ ],
659
+ "page_idx": 7
660
+ },
661
+ {
662
+ "type": "table",
663
+ "img_path": "images/ee5bfc0cabae011fd00b72ae3e1aad5b40add77f708bdf25af16fa1561b1bd00.jpg",
664
+ "table_caption": [
665
+ "Table 6: Zero-shot segmentation result comparison on the test set of high-quality BIG [6] benchmark using various types of input prompts. We employ PSPNet [55] to generate the coarse mask prompt. "
666
+ ],
667
+ "table_footnote": [],
668
+ "table_body": "<table><tr><td>Model</td><td>GT Box Prompt mIoU</td><td>mBIoU</td><td>Mask Prompt mIoU</td><td>mBIoU</td></tr><tr><td>SAM</td><td>81.1</td><td>70.4</td><td>66.6</td><td>41.8</td></tr><tr><td>HQ-SAM</td><td>86.0</td><td>75.3</td><td>86.9</td><td>75.1</td></tr></table>",
669
+ "bbox": [
670
+ 338,
671
+ 433,
672
+ 655,
673
+ 498
674
+ ],
675
+ "page_idx": 7
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "4.3 Zero-shot Comparison with SAM ",
680
+ "text_level": 1,
681
+ "bbox": [
682
+ 176,
683
+ 512,
684
+ 444,
685
+ 527
686
+ ],
687
+ "page_idx": 7
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "We perform extensive zero-shot transfer comparisons between our HQ-SAM and SAM on 7 benchmarks, including SGinW [58], COCO [31], UVO [42], LVIS [14], HQ-YTVIS [20], BIG [6], COIFT [29] and HR-SOD [51], where HQ-SAM outperforms SAM without bells and whistles, demonstrating its efficacy and kept generalization ability even trained with a small-scale dataset. ",
692
+ "bbox": [
693
+ 174,
694
+ 539,
695
+ 826,
696
+ 594
697
+ ],
698
+ "page_idx": 7
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "Results on the SGinW Benchmark Equipped with the same Grounding-DINO [32] as box prompts, we also performed experiments by replacing SAM with HQ-SAM in Grounded-SAM, and obtained the first place in the Segmentation in the Wild (SGinW) competition1 on the zero-shot track. Note that SGinW contains 25 zero-shot in-the-wild segmentation datasets for evaluation, and GroundedHQ-SAM with 49.6 mean AP and outperforms Grounded-SAM obviously using the same detector. ",
703
+ "bbox": [
704
+ 174,
705
+ 601,
706
+ 825,
707
+ 671
708
+ ],
709
+ "page_idx": 7
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Zero-Shot Open-world Segmentation To evaluate the zero-shot segmentation results in the openworld environment, in Table 5, we compare SAM and our HQ-SAM on the challenging UVO [42] benchmark with diverse and dense objects mask annotations. By taking the same pre-trained object detector [53] as box prompt input, our HQ-SAM improves for $1 . 3 \\mathrm { A P } _ { B } ^ { \\mathrm { s t r i c t } }$ t and 2.6 APstrictB50 over SAM. ",
714
+ "bbox": [
715
+ 174,
716
+ 676,
717
+ 825,
718
+ 733
719
+ ],
720
+ "page_idx": 7
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "Zero-Shot Segmentation on High-resolution BIG Dataset In Table 6, we compare the zero-shot segmentation quality between SAM and HQ-SAM on the high-resolution BIG benchmark [6] with two types of prompts, including using GT object boxes or the provided coarse masks input. HQ-SAM consistently surpasses SAM, with obvious advantages using different types of prompts, and is much more robust to coarse masks prompts with partial boundary errors (provided by PSPNet [55]). ",
725
+ "bbox": [
726
+ 174,
727
+ 739,
728
+ 825,
729
+ 809
730
+ ],
731
+ "page_idx": 7
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "Zero-shot Instance Segmentation on COCO and LVIS In Table 7, we also evaluate HQ-SAM on the popular COCO and LVIS benchmarks respectively by feeding box prompts generated by the trained detectors of these two datasets. HQ-SAM consistently outperforms SAM by $1 . 1 \\mathrm { \\ A P } _ { B }$ on COCO and $0 . 7 \\mathrm { A P } _ { B 7 5 } ^ { \\mathrm { s t r i c t } }$ on LVIS, showing the improved mask quality and well-preserved zero-shot segmentation ability during the HQ-SAM training process. ",
736
+ "bbox": [
737
+ 174,
738
+ 815,
739
+ 825,
740
+ 885
741
+ ],
742
+ "page_idx": 7
743
+ },
744
+ {
745
+ "type": "table",
746
+ "img_path": "images/7e083153f3fa9e72165a56edf3e4d63c6aee23f8c411543437964fcc703677df.jpg",
747
+ "table_caption": [
748
+ "Table 7: Zero-shot instance segmentation results comparison on COCO [31] and LVISv1 [14]. For the COCO dataset, we use FocalNet-DINO [53] detector trained on COCO. For LVIS, we adopt ViTDet-H [28] trained on the LVIS dataset as our box prompt generator. For SAM, we use the ViT-L backbone and box prompt. We maintain the zero-shot segmentation capability of the original SAM while improving the mask quality on the boundary region. "
749
+ ],
750
+ "table_footnote": [],
751
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">COCO</td><td colspan=\"5\">LVIS</td></tr><tr><td>APB</td><td>AP</td><td>APsiet</td><td>AP</td><td>APB</td><td>APB75</td><td>AP</td></tr><tr><td>SAM</td><td>33.3</td><td>48.5</td><td>32.1</td><td>32.8</td><td>38.5</td><td>40.9</td><td>43.6</td></tr><tr><td>HQ-SAM</td><td>34.4</td><td>49.5</td><td>32.5</td><td>33.5</td><td>38.8</td><td>41.2</td><td>43.9</td></tr></table>",
752
+ "bbox": [
753
+ 267,
754
+ 154,
755
+ 723,
756
+ 219
757
+ ],
758
+ "page_idx": 8
759
+ },
760
+ {
761
+ "type": "image",
762
+ "img_path": "images/3e2a649cbc6fa87420afe8afb381fa3922fca11a2410a55b3b7cc6cc7d1af28c.jpg",
763
+ "image_caption": [
764
+ "Figure 5: Interactive segmentation results comparison using a varying number of input points on the COIFT [29] (zero-shot) and DIS [35] val set. HQ-SAM consistently outperforms SAM with various point numbers, and the relative improvement is more obvious with less prompt ambiguity. "
765
+ ],
766
+ "image_footnote": [],
767
+ "bbox": [
768
+ 181,
769
+ 231,
770
+ 812,
771
+ 397
772
+ ],
773
+ "page_idx": 8
774
+ },
775
+ {
776
+ "type": "table",
777
+ "img_path": "images/76c4f6f48b62c8b84480b515aee1bf7fc939ab9c689a94197c1d113d15eaa400.jpg",
778
+ "table_caption": [
779
+ "Table 8: Zero-shot Video Instance Segmentation comparison on the test set of the very accurately labeled HQ-YTVIS [20] benchmark. We utilize pre-trained Swin-L-based Mask2Fromer [4] on YTVIS [47] as our box prompt input while reusing its object association prediction. "
780
+ ],
781
+ "table_footnote": [],
782
+ "table_body": "<table><tr><td>Model</td><td>APB</td><td>AP</td><td>AP5</td><td>APM</td><td>AP</td><td>AP</td></tr><tr><td>SAM</td><td>30.2</td><td>19.1</td><td>72.9</td><td>60.7</td><td>68.1</td><td>90.5</td></tr><tr><td>HQ-SAM</td><td>34.0</td><td>24.3</td><td>79.5</td><td>63.6</td><td>70.5</td><td>91.1</td></tr></table>",
783
+ "bbox": [
784
+ 305,
785
+ 488,
786
+ 689,
787
+ 542
788
+ ],
789
+ "page_idx": 8
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "Point-based Interactive Segmentation Comparison To investigate the segmentation performance of HQ-SAM with interactive point prompts, in Figure 5, we compare HQ-SAM to SAM with varying numbers of input points on COIFT [29] (zero-shot) and DIS [35] val set. HQ-SAM consistently outperforms SAM with different point prompts on both two datasets. We note that the relative performance increase is more significant when the prompt contains less object ambiguity with more input points information (increasing from 1 positive point to 10 positive points $+ 5$ negative points). ",
794
+ "bbox": [
795
+ 173,
796
+ 551,
797
+ 825,
798
+ 637
799
+ ],
800
+ "page_idx": 8
801
+ },
802
+ {
803
+ "type": "text",
804
+ "text": "Zero-shot High-quality Video Instance Segmentation Besides conducting image-based segmentation evaluation, we also perform video instance segmentation results comparison on the accurately annotated HQ-YTVIS benchmark [20]. We take the pre-trained Mask2Former [4] as our video box prompts and feed it into SAM and our HQ-SAM for mask prediction. In Table 8, HQ-SAM achieves remarkable gains of 3.8 points in Tube Boundary $\\mathsf { A P } ^ { B }$ and 2.9 Tube Mask $\\mathsf { A P } ^ { M }$ . ",
805
+ "bbox": [
806
+ 174,
807
+ 641,
808
+ 825,
809
+ 712
810
+ ],
811
+ "page_idx": 8
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "Visualization of HQ-Output Token In Figure 6, we provide visual comparison of our HQ-Output Token vs. SAM’s common output token for their cross-attention maps in the last token-to-image layer of the mask decoder. We observe that our HQ-Output Token attends to the boundary and thin structure regions that are missed by the common token. ",
816
+ "bbox": [
817
+ 174,
818
+ 717,
819
+ 825,
820
+ 773
821
+ ],
822
+ "page_idx": 8
823
+ },
824
+ {
825
+ "type": "text",
826
+ "text": "Zero-shot Visual Results Comparison In Figure 7, we compare HQ-SAM to SAM qualitatively in a zero-shot transfer setting, where HQ-SAM significantly promotes the mask details of SAM and also improves the masks of broken holes or large portion errors by the enriched semantic context. Refer to the supplemental file for more visual comparisons. ",
827
+ "bbox": [
828
+ 174,
829
+ 779,
830
+ 825,
831
+ 835
832
+ ],
833
+ "page_idx": 8
834
+ },
835
+ {
836
+ "type": "text",
837
+ "text": "Comparison with Adapter Tuning Strategy In Table 9, we also compare our efficient token adaptation strategy to the recent Adapter Tuning [48] and LoRA [17]. We introduce lightweight adapters to ViT layers of SAM’s encoder for encoder tuning and identify that this strategy leads to overfitting and its zero-shot performance on COCO decreases from 33.3 to 29.6. This validates our design choice to freeze SAM’s encoder, and mainly focus on SAM’s decoder. ",
838
+ "bbox": [
839
+ 174,
840
+ 842,
841
+ 825,
842
+ 911
843
+ ],
844
+ "page_idx": 8
845
+ },
846
+ {
847
+ "type": "image",
848
+ "img_path": "images/eea1ab449769a73f49fe2b291298358cea5af95b5d5850d38bcc06c26ef6abd8.jpg",
849
+ "image_caption": [],
850
+ "image_footnote": [],
851
+ "bbox": [
852
+ 183,
853
+ 66,
854
+ 812,
855
+ 236
856
+ ],
857
+ "page_idx": 9
858
+ },
859
+ {
860
+ "type": "image",
861
+ "img_path": "images/a74317947cf626e16a1796294afa6276b45cb3ed3a71f30829443bdd89401bd5.jpg",
862
+ "image_caption": [
863
+ "Figure 6: Cross-attention of SAM’s original token vs. HQ-Output Token in the last decoder layer. HQ-Token attends to the boundary and thin structure regions that are missed by the original token. ",
864
+ "Figure 7: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) in a zero-shot transfer setting, given the same red box or point prompt. HQ-SAM produces significantly more detailed-preserving results and also addresses the mask errors with broken holes. "
865
+ ],
866
+ "image_footnote": [],
867
+ "bbox": [
868
+ 178,
869
+ 275,
870
+ 818,
871
+ 473
872
+ ],
873
+ "page_idx": 9
874
+ },
875
+ {
876
+ "type": "table",
877
+ "img_path": "images/7f30c7795c16cda503e649b73ae372c6ca845b81c583989537c02e38075a457e.jpg",
878
+ "table_caption": [
879
+ "Table 9: Comparison to Adapter Tuning [48] or using LoRA [17] in SAM’s encoder using ViT-L based SAM and the same HQSeg-44K. For the COCO dataset, we use the SOTA detector FocalNetDINO [53] trained on the COCO dataset as our box prompt generator. "
880
+ ],
881
+ "table_footnote": [],
882
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"5\">CoCo</td><td colspan=\"2\">Model Params (MB)</td></tr><tr><td>APB</td><td>AP</td><td>APL</td><td>APM</td><td>APs</td><td>Total</td><td>Trainable</td></tr><tr><td>SAM</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td><td>1191</td><td>1</td></tr><tr><td>SAM+LoRA[17]</td><td>28.6</td><td>43.7</td><td>-</td><td>-</td><td>-</td><td>1192.5</td><td>1.5</td></tr><tr><td>SAM + Encoder Adapter [48]</td><td>29.6</td><td>44.8</td><td>63.9</td><td>47.8</td><td>29.0</td><td>1203</td><td>12.0</td></tr><tr><td>HQ-SAM</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td><td>1196.1</td><td>5.1</td></tr></table>",
883
+ "bbox": [
884
+ 223,
885
+ 573,
886
+ 774,
887
+ 661
888
+ ],
889
+ "page_idx": 9
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "Mobile Efficiency Although HQ-SAM significantly boosts SAM’s mask quality with negligible overhead, it shares the heavy ViT encoder of SAM, and thus cannot achieve a real-time speed in video processing. For efficient mobile deployment, we propose Light HQ-SAM based on the tiny ViT image encoder provided by MobileSAM [52]. In Figure 2, achieving running speed of $4 1 . 2 \\ : \\mathrm { F P S }$ , Light HQ-SAM improves the zero-shot COCO AP of MobileSAM from 44.3 to 45.0 with negligible additional cost, i.e., 1.7MB increase in model parameters. ",
894
+ "bbox": [
895
+ 173,
896
+ 670,
897
+ 826,
898
+ 755
899
+ ],
900
+ "page_idx": 9
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "5 Conclusion ",
905
+ "text_level": 1,
906
+ "bbox": [
907
+ 174,
908
+ 767,
909
+ 299,
910
+ 785
911
+ ],
912
+ "page_idx": 9
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "We propose HQ-SAM, the first high-quality zero-shot segmentation model by introducing negligible overhead to the original SAM. We propose a lightweight High-quality Output Token in HQ-SAM to replace the original SAM’s output token for high-quality mask prediction. After training only on 44K highly-accurate masks, HQ-SAM significantly boosts the mask prediction quality of SAM, which was trained on 1.1 billion masks. The zero-shot transfer evaluation is performed on 8 segmentation benchmarks across both image and video tasks, spanning diverse objects and scenes. Our research offers timely insights into how to leverage and extend SAM-like foundational segmentation models in a data-efficient and computation-affordable manner. ",
917
+ "bbox": [
918
+ 173,
919
+ 800,
920
+ 825,
921
+ 911
922
+ ],
923
+ "page_idx": 9
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "References ",
928
+ "text_level": 1,
929
+ "bbox": [
930
+ 174,
931
+ 90,
932
+ 266,
933
+ 106
934
+ ],
935
+ "page_idx": 10
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. [2] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020. \n[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. \n[4] Bowen Cheng, Anwesa Choudhuri, Ishan Misra, Alexander Kirillov, Rohit Girdhar, and Alexander G Schwing. Mask2former for video instance segmentation. arXiv preprint arXiv:2112.10764, 2021. \n[5] Bowen Cheng, Ross Girshick, Piotr Dollár, Alexander C. Berg, and Alexander Kirillov. Boundary IoU: Improving object-centric image segmentation evaluation. In CVPR, 2021. \n[6] Ho Kei Cheng, Jihoon Chung, Yu-Wing Tai, and Chi-Keung Tang. CascadePSP: Toward class-agnostic and very high-resolution segmentation via global and local refinement. In CVPR, 2020. \n[7] Ho Kei Cheng and Alexander G. Schwing. XMem: Long-term video object segmentation with an atkinson-shiffrin memory model. In ECCV, 2022. \n[8] Ming-Ming Cheng, Niloy J Mitra, Xiaolei Huang, Philip HS Torr, and Shi-Min Hu. Global contrast based salient region detection. TPAMI, 37(3):569–582, 2014. [9] Daan de Geus and Gijs Dubbelman. Intra-batch supervision for panoptic segmentation on high-resolution images. In WACV, 2023. \n[10] Philipe Ambrozio Dias and Henry Medeiros. Semantic segmentation refinement by monte carlo region growing of high confidence detections. In ACCV, 2019. \n[11] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. \n[12] Amin Ghiasi, Hamid Kazemi, Eitan Borgnia, Steven Reich, Manli Shu, Micah Goldblum, Andrew Gordon Wilson, and Tom Goldstein. What do vision transformers learn? a visual exploration. arXiv preprint arXiv:2212.06727, 2022. \n[13] Golnaz Ghiasi, Yin Cui, Aravind Srinivas, Rui Qian, Tsung-Yi Lin, Ekin D Cubuk, Quoc V Le, and Barret Zoph. Simple copy-paste is a strong data augmentation method for instance segmentation. In CVPR, 2021. \n[14] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In CVPR, 2019. \n[15] Stefan Hinterstoisser, Vincent Lepetit, Paul Wohlhart, and Kurt Konolige. On pre-trained image features and synthetic images for deep learning. In ECCV Workshops, 2018. \n[16] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019. \n[17] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In ICLR, 2022. \n[18] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In ECCV, 2022. \n[19] Lei Ke, Martin Danelljan, Xia Li, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Mask transfiner for high-quality instance segmentation. In CVPR, 2022. \n[20] Lei Ke, Henghui Ding, Martin Danelljan, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Video mask transfiner for high-quality video instance segmentation. In ECCV, 2022. \n[21] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C. Berg, Wan-Yen Lo, Piotr Dollár, and Ross Girshick. Segment anything. In ICCV, 2023. \n[22] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick. Pointrend: Image segmentation as rendering. In CVPR, 2020. \n[23] Philipp Krähenbühl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge potentials. In NeurIPS, 2011. \n[24] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. IJCV, 128(7):1956–1981, 2020. \n[25] Feng Li, Hao Zhang, Shilong Liu, Jian Guo, Lionel M Ni, and Lei Zhang. Dn-detr: Accelerate detr training by introducing query denoising. In CVPR, 2022. \n[26] Xiang Li, Tianhan Wei, Yau Pun Chen, Yu-Wing Tai, and Chi-Keung Tang. Fss-1000: A 1000-class dataset for few-shot segmentation. In CVPR, 2020. preprint arXiv:2101.00190, 2021. \n[28] Yanghao Li, Hanzi Mao, Ross Girshick, and Kaiming He. Exploring plain vision transformer backbones for object detection. In ECCV, 2022. \n[29] Jun Hao Liew, Scott Cohen, Brian Price, Long Mai, and Jiashi Feng. Deep interactive thin object selection. In WACV, 2021. \n[30] Guosheng Lin, Anton Milan, Chunhua Shen, and Ian Reid. Refinenet: Multi-path refinement networks for high-resolution semantic segmentation. In CVPR, 2017. \n[31] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014. \n[32] Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. arXiv preprint arXiv:2303.05499, 2023. \n[33] Qi Lu, Jason Kuen, Guo Weidong, Shen Tiancheng, Gu Jiuxiang, Li Wenbo, Jia Jiaya, Lin Zhe, and Yang Ming-Hsuan. Fine-grained entity segmentation. arXiv preprint arxiv:2211.05776, 2022. \n[34] Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alexander Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. arXiv:1704.00675, 2017. \n[35] Xuebin Qin, Hang Dai, Xiaobin Hu, Deng-Ping Fan, Ling Shao, and Luc Van Gool. Highly accurate dichotomous image segmentation. In ECCV, 2022. \n[36] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021. \n[37] Tiancheng Shen, Yuechen Zhang, Lu Qi, Jason Kuen, Xingyu Xie, Jianlong Wu, Zhe Lin, and Jiaya Jia. High quality segmentation for ultra high-resolution images. In CVPR, 2022. \n[38] Jianping Shi, Qiong Yan, Li Xu, and Jiaya Jia. Hierarchical image saliency detection on extended cssd. TPAMI, 38(4):717–729, 2015. \n[39] Towaki Takikawa, David Acuna, Varun Jampani, and Sanja Fidler. Gated-scnn: Gated shape cnns for semantic segmentation. In ICCV, 2019. \n[40] Chufeng Tang, Hang Chen, Xiao Li, Jianmin Li, Zhaoxiang Zhang, and Xiaolin Hu. Look closer to segment better: Boundary patch refinement for instance segmentation. In CVPR, 2021. \n[41] Cameron Trotter, Georgia Atkinson, Matt Sharpe, Kirsten Richardson, A Stephen McGough, Nick Wright, Ben Burville, and Per Berggren. Ndd20: A large-scale few-shot dolphin dataset for coarse and fine-grained categorisation. arXiv preprint arXiv:2005.13359, 2020. \n[42] Weiyao Wang, Matt Feiszli, Heng Wang, and Du Tran. Unidentified video objects: A benchmark for dense, open-world segmentation. In CVPR, 2021. \n[43] Xinlong Wang, Xiaosong Zhang, Yue Cao, Wen Wang, Chunhua Shen, and Tiejun Huang. Seggpt: Segmenting everything in context. arXiv preprint arXiv:2304.03284, 2023. \n[44] Qinrou Wen, Jirui Yang, Xue Yang, and Kewei Liang. Patchdct: Patch refinement for high quality instance segmentation. In ICLR, 2023. \n[45] Yinghui Xing, Qirui Wu, De Cheng, Shizhou Zhang, Guoqiang Liang, and Yanning Zhang. Class-aware visual prompt tuning for vision-language pre-trained model. arXiv preprint arXiv:2208.08340, 2022. \n[46] Chuan Yang, Lihe Zhang, Huchuan Lu, Xiang Ruan, and Ming-Hsuan Yang. Saliency detection via graph-based manifold ranking. In CVPR, 2013. \n[47] Linjie Yang, Yuchen Fan, and Ning Xu. Video instance segmentation. In ICCV, 2019. \n[48] Taojiannan Yang, Yi Zhu, Yusheng Xie, Aston Zhang, Chen Chen, and Mu Li. Aim: Adapting image models for efficient video action recognition. In ICLR, 2023. \n[49] Yuan Yao, Ao Zhang, Zhengyan Zhang, Zhiyuan Liu, Tat-Seng Chua, and Maosong Sun. Cpt: Colorful prompt tuning for pre-trained vision-language models. arXiv preprint arXiv:2109.11797, 2021. \n[50] Yuhui Yuan, Jingyi Xie, Xilin Chen, and Jingdong Wang. Segfix: Model-agnostic boundary refinement for segmentation. In ECCV, 2020. \n[51] Yi Zeng, Pingping Zhang, Jianming Zhang, Zhe Lin, and Huchuan Lu. Towards high-resolution salient object detection. In ICCV, 2019. \n[52] Chaoning Zhang, Dongshen Han, Yu Qiao, Jung Uk Kim, Sung-Ho Bae, Seungkyu Lee, and Choong Seon Hong. Faster segment anything: Towards lightweight sam for mobile applications. arXiv preprint arXiv:2306.14289, 2023. \n[53] Hao Zhang, Feng Li, Shilong Liu, Lei Zhang, Hang Su, Jun Zhu, Lionel M. Ni, and Heung-Yeung Shum. Dino: Detr with improved denoising anchor boxes for end-to-end object detection. In ICLR, 2023. \n[54] Hengshuang Zhao, Xiaojuan Qi, Xiaoyong Shen, Jianping Shi, and Jiaya Jia. Icnet for real-time semantic segmentation on high-resolution images. In ECCV, 2018. \n[55] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017. \n[56] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 2022. \n[57] Ziqin Zhou, Yinjie Lei, Bowen Zhang, Lingqiao Liu, and Yifan Liu. Zegclip: Towards adapting clip for zero-shot semantic segmentation. In CVPR, 2023. \n[58] Xueyan Zou, Zi-Yi Dou, Jianwei Yang, Zhe Gan, Linjie Li, Chunyuan Li, Xiyang Dai, Harkirat Behl, Jianfeng Wang, Lu Yuan, et al. Generalized decoding for pixel, image, and language. In CVPR, 2023. \n[59] Xueyan Zou, Jianwei Yang, Hao Zhang, Feng Li, Linjie Li, Jianfeng Gao, and Yong Jae Lee. Segment everything everywhere all at once. In NeurIPS, 2023. ",
940
+ "bbox": [
941
+ 171,
942
+ 130,
943
+ 828,
944
+ 912
945
+ ],
946
+ "page_idx": 10
947
+ },
948
+ {
949
+ "type": "text",
950
+ "text": "",
951
+ "bbox": [
952
+ 171,
953
+ 112,
954
+ 828,
955
+ 909
956
+ ],
957
+ "page_idx": 11
958
+ },
959
+ {
960
+ "type": "text",
961
+ "text": "",
962
+ "bbox": [
963
+ 173,
964
+ 92,
965
+ 826,
966
+ 198
967
+ ],
968
+ "page_idx": 12
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "Supplementary Material: Segment Anything in High Quality ",
973
+ "text_level": 1,
974
+ "bbox": [
975
+ 289,
976
+ 122,
977
+ 707,
978
+ 171
979
+ ],
980
+ "page_idx": 13
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "In this supplementary material, Section 6 first presents the additional experimental analysis of our HQSAM, including more zero-shot transfer comparisons to SAM on both image and video benchmarks. Then, in Section 7, we describe more details of our method implementation, including the training and inference. In Section 8, we provide further details of our constructed HQSeg-44K dataset for training HQ-SAM. In Section 9, we show extensive visual results comparison between our HQ-SAM and SAM on COCO [31], DIS-test [35], HR-SOD [51], NDD20 [41], DAVIS [34], and YTVIS [47]. ",
985
+ "bbox": [
986
+ 174,
987
+ 229,
988
+ 826,
989
+ 314
990
+ ],
991
+ "page_idx": 13
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "6 Supplementary experiments ",
996
+ "text_level": 1,
997
+ "bbox": [
998
+ 176,
999
+ 332,
1000
+ 441,
1001
+ 349
1002
+ ],
1003
+ "page_idx": 13
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "text": "SAM vs. HQ-SAM on Various Backbones In Table 10, we provide a comprehensive comparison between HQ-SAM and SAM using various backbones, including ViT-B, ViT-L, ViT-H and TinyViT. The comparison not only includes the numerical results on the four HQ datasets and COCO validation set, but also contains the model sizes/speed/memory. HQ-SAM consistently outperforms SAM using three different backbones, with over 10 points increase in mBIoU on the four HQ datasets. Notably, the ViT-B based HQ-SAM significantly improves the $\\mathbf { A P } ^ { B }$ on COCO from 28.2 to 31.3 and AP from 44.4 to 46.7, with only a $1 . 1 \\%$ increase in model parameters and negligible extra memory consumption. ",
1008
+ "bbox": [
1009
+ 173,
1010
+ 363,
1011
+ 825,
1012
+ 474
1013
+ ],
1014
+ "page_idx": 13
1015
+ },
1016
+ {
1017
+ "type": "table",
1018
+ "img_path": "images/22308a3a9aa2f38c0d4a74274a2a1cf404f1ffb21962d0e6a2c0127bfe149d47.jpg",
1019
+ "table_caption": [
1020
+ "Table 10: SAM vs. HQ-SAM on various ViT backbones. For the COCO dataset, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. "
1021
+ ],
1022
+ "table_footnote": [],
1023
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">Four HQ datasets</td><td colspan=\"5\">CoCo</td><td colspan=\"2\">Model Params (MB)</td><td rowspan=\"2\">FPS</td><td rowspan=\"2\">Memory</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>APB</td><td>AP</td><td>APL</td><td>APM</td><td>APs</td><td>Total</td><td>Learnable</td></tr><tr><td>SAM-B HQ-SAM-B</td><td>70.6 86.3</td><td>62.3 78.1</td><td>28.2 31.3</td><td>44.4 46.7</td><td>57.7 62.9</td><td>48.7 50.5</td><td>32.1 32.0</td><td>358 362.1</td><td>358 4.1</td><td>10.1 9.8</td><td>5.1G 5.1G</td></tr><tr><td>SAM-L</td><td>79.5</td><td>71.1</td><td>33.3</td><td>48.5</td><td>63.9</td><td>53.1</td><td>34.1</td><td>1191</td><td>1191</td><td>5.0</td><td>7.6G</td></tr><tr><td>HQ-SAM-L SAM-H</td><td>89.1 75.6</td><td>81.8 68.3</td><td>34.4</td><td>49.5</td><td>66.2</td><td>53.8</td><td>33.9</td><td>1196.1</td><td>5.1 2446</td><td>4.8 3.5</td><td>7.6G 10.3G</td></tr><tr><td>HQ-SAM-H</td><td>89.3</td><td>81.5</td><td>34.0 34.9</td><td>48.9 49.9</td><td>64.5</td><td>53.3</td><td>34.4</td><td>2446 2452.1</td><td>6.1</td><td>3.4</td><td>10.3G</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>66.5</td><td>54.0</td><td>34.2</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MobileSAM</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>69.0</td><td>58.8</td><td>28.6</td><td>44.3</td><td>-</td><td>-</td><td>:</td><td>38.6</td><td>38.6</td><td>44.8</td><td>3.7G</td></tr><tr><td>Light HQ-SAM</td><td>81.4</td><td>71.6</td><td>29.6</td><td>45.0</td><td>-</td><td>-</td><td></td><td>40.3</td><td>1.7</td><td>41.2</td><td>3.7G</td></tr></table>",
1024
+ "bbox": [
1025
+ 174,
1026
+ 527,
1027
+ 825,
1028
+ 669
1029
+ ],
1030
+ "page_idx": 13
1031
+ },
1032
+ {
1033
+ "type": "table",
1034
+ "img_path": "images/3edb1bdb9715a12a460d760ca620eebea920750998267b639b4b23c23de3f3c6.jpg",
1035
+ "table_caption": [
1036
+ "Table 11: Results on YouTubeVIS 2019 validation set and HQ-YTVIS test set using ViT-L based SAM. We adopt the SOTA detector Mask2Former [4] trained on the YouTubeVIS 2019 dataset as our video boxes prompt generator while reusing its object association prediction. "
1037
+ ],
1038
+ "table_footnote": [],
1039
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"6\">YTVIS 2019</td><td colspan=\"2\">HQ-YTVIS</td></tr><tr><td>AP</td><td>AP50</td><td>AP75</td><td>APL</td><td>APm</td><td>APs</td><td>APB</td><td>APM</td></tr><tr><td>SAM</td><td>51.8</td><td>82.1</td><td>55.4</td><td>65.5</td><td>52.0</td><td>34.2</td><td>30.2</td><td>60.7</td></tr><tr><td>HQ-SAM</td><td>53.2</td><td>82.9</td><td>58.3</td><td>66.4</td><td>53.3</td><td>33.7</td><td>34.0</td><td>63.6</td></tr></table>",
1040
+ "bbox": [
1041
+ 253,
1042
+ 727,
1043
+ 741,
1044
+ 796
1045
+ ],
1046
+ "page_idx": 13
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "Zero-shot Video Instance Segmentation Comparison Extending from Table 8 of the paper (evaluation on the HQ-YTVIS benchmark [20]), we further perform a comparative analysis of zeroshot video instance segmentation results on the popular YTVIS 2019 [47] validation set. We take the pre-trained Mask2Former [4] as our video box prompts and feed them into SAM and our HQ-SAM for mask prediction. In Table 11, HQ-SAM achieves consistent gains of 1.4 points in Tube Mask AP, increasing SAM’s performance from 51.8 to 53.2. Interestingly, we find the $\\mathsf { A P } _ { 7 5 }$ improvement with a higher IoU threshold for HQ-SAM is much larger than $\\mathrm { { A P } _ { 5 0 } }$ , further validating the advantages of HQ-SAM in high-quality mask prediction. ",
1051
+ "bbox": [
1052
+ 173,
1053
+ 800,
1054
+ 826,
1055
+ 911
1056
+ ],
1057
+ "page_idx": 13
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "Zero-shot Video Object Segmentation Comparison Besides video instance segmentation, in Table 12, we further report the comparison of video object segmentation results between HQ-SAM and SAM on DAVIS validation set in a zero-shot transfer protocol. We take the pre-trained XMem as our video box prompts and feed the same prompts into SAM and HQ-SAM. HQ-SAM improves SAM the $\\mathcal { T } \\& \\mathcal { F }$ from 82.0 to 83.2 and the $\\mathcal { F }$ score from 84.9 to 86.1, where $\\mathcal { F }$ is for measuring the contour accuracy of the video objects. ",
1062
+ "bbox": [
1063
+ 173,
1064
+ 90,
1065
+ 825,
1066
+ 174
1067
+ ],
1068
+ "page_idx": 14
1069
+ },
1070
+ {
1071
+ "type": "table",
1072
+ "img_path": "images/f033134cfb542f032f691a204658fb862d5c55af90decdc06455a7ef1431e79f.jpg",
1073
+ "table_caption": [
1074
+ "Table 12: Results on DAVIS 2017 [34] validation set using ViT-L based SAM. We adopt the SOTA model XMem [7] as our video boxes prompt generator while reusing its object association prediction. "
1075
+ ],
1076
+ "table_footnote": [],
1077
+ "table_body": "<table><tr><td>Model</td><td>J&amp;F</td><td>J</td><td>F</td></tr><tr><td>SAM</td><td>82.0</td><td>79.0</td><td>84.9</td></tr><tr><td>HQ-SAM</td><td>83.2</td><td>80.3</td><td>86.1</td></tr></table>",
1078
+ "bbox": [
1079
+ 383,
1080
+ 229,
1081
+ 612,
1082
+ 284
1083
+ ],
1084
+ "page_idx": 14
1085
+ },
1086
+ {
1087
+ "type": "text",
1088
+ "text": "Robustness to Input Box Prompts In Table 13, we compare HQ-SAM to SAM by adding various scales of noises to the input ground truth box prompts. In practice, we cannot expect the input box prompts provided by humans in interactive modes to be identical to the ground truth (GT) boxes or extremely accurate. We follow the data augmentation code in DN-DETR [25] to add different noise scales and identify that our HQ-SAM is much more robust compared to SAM, where the relative mBIoU advantage improves from 10.7 to 20.5 when gradually increasing the noise scales. Note that our method is not trained with noised boxes. We also visualize such noised input case in Figure 11, where SAM is more sensitive to small box location shifts that easily happened during interactive annotation. ",
1089
+ "bbox": [
1090
+ 173,
1091
+ 299,
1092
+ 825,
1093
+ 424
1094
+ ],
1095
+ "page_idx": 14
1096
+ },
1097
+ {
1098
+ "type": "table",
1099
+ "img_path": "images/35bb818a68493fba32991111ea95cfb8b6a534888372cff6da6b41bac8df049d.jpg",
1100
+ "table_caption": [
1101
+ "Table 13: Comparison of segmentation accuracy on the four HQ datasets by adding various noise levels to the GT box prompts input. "
1102
+ ],
1103
+ "table_footnote": [],
1104
+ "table_body": "<table><tr><td>Model</td><td colspan=\"2\">No Noise mIoU mBIoU</td><td colspan=\"2\">Noise scale 0.2 mIoU mBIoU</td><td colspan=\"2\">Noise scale 0.4 mIoU mBIoU</td></tr><tr><td>SAM</td><td>79.5</td><td>71.1</td><td>65.7</td><td>57.1</td><td>46.4</td><td>39.8</td></tr><tr><td>HQ-SAM</td><td>89.1</td><td>81.8个10.7</td><td>82.8</td><td>73.4个16.3</td><td>69.9</td><td>60.3个20.5</td></tr></table>",
1105
+ "bbox": [
1106
+ 264,
1107
+ 477,
1108
+ 732,
1109
+ 545
1110
+ ],
1111
+ "page_idx": 14
1112
+ },
1113
+ {
1114
+ "type": "text",
1115
+ "text": "7 Additional Implementation details ",
1116
+ "text_level": 1,
1117
+ "bbox": [
1118
+ 173,
1119
+ 569,
1120
+ 493,
1121
+ 587
1122
+ ],
1123
+ "page_idx": 14
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "Training Details During training HQ-SAM on the composed HQSeg-44K, we fix the model parameters of the pre-trained SAM model while only making the proposed HQ-SAM learnable, including HQ-Output Token, its associated three-layer MLP and three convolutions for HQ-Features fusion. Two of them are transposed convolutions (size $2 \\times 2$ , stride 2) used to upscale encoder embedding size from $6 4 \\times 6 4$ to $2 5 6 \\times 2 5 6$ . We treat the new HQ-Output Token as the fifth mask token compared to the original four mask tokens in SAM’s mask decoder. During training, this new HQ-Output token of size $1 \\times 2 5 6$ is concatenated with SAM’s mask tokens (size of $4 \\times 2 5 6$ ), iou token (size of $1 \\times 2 5 6 ,$ ) and prompt tokens (size of $\\mathrm { N _ { p r o m p t } } { \\times 2 5 6 } )$ as the input to the SAM’s mask decoder. For example, if the input image contains $N$ box prompts (size $\\Nu { \\times } 2 \\times 2 5 6 )$ ), the final concatenated input and output shape for the 2-layer mask decoder of SAM is $\\Nu \\times ( 1 + 4 + 1 + 2 ) \\times 2 5 6$ . For experiments using ViT-B, ViT-L, and ViT-H-based models on training, we adopt the same training setting, with a learning rate of 1e-3 and train our HQ-SAM for 12 epochs (learning rate drops to 1e-4 after 10 epochs). We supervise mask prediction of the new HQ-Output token with a combination of both BCE Loss and Dice Loss. ",
1128
+ "bbox": [
1129
+ 173,
1130
+ 599,
1131
+ 826,
1132
+ 794
1133
+ ],
1134
+ "page_idx": 14
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "Implementation Details We follow the same inference pipeline of SAM but use the mask prediction from HQ-Output token as high-quality mask prediction. Table 10 reports the detailed inference speed comparison using various backbones. For box-prompting-based evaluation, we feed SAM and our HQ-SAM with the same image/video bounding boxes and adopt the single mask output mode of SAM. For interactive segmentation comparison using a single point, we follow SAM and adopt the “center” point of Ground Truth (GT) masks, which is at a maximal value location in a mask’s interior distance transform. For multiple-point evaluation, we randomly sample the points from the GT masks and report the averaged results with three trials. ",
1139
+ "bbox": [
1140
+ 173,
1141
+ 800,
1142
+ 825,
1143
+ 911
1144
+ ],
1145
+ "page_idx": 14
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "8 More Details of HQSeg-44K ",
1150
+ "text_level": 1,
1151
+ "bbox": [
1152
+ 174,
1153
+ 88,
1154
+ 441,
1155
+ 107
1156
+ ],
1157
+ "page_idx": 15
1158
+ },
1159
+ {
1160
+ "type": "text",
1161
+ "text": "Data compostion of HQSeg-44K In Table 14, we provide more details of our composed new training dataset HQSeg-44K which contains 44,320 extremely accurate image mask annotations, where we show their annotation quality in Figure 8. HQSeg-44K is a collection of six existing image datasets including DIS [35] (train set), ThinObject-5K [29] (train set), FSS [26], ECSSD [38], MSRA-10K [8], DUT-OMRON [46] with extremely fine-grained mask labeling, where each of them contains 7.4K mask labels on average. This composed training set has no images/annotations overlapping with the zero-shot evaluation datasets adopted in our paper. ",
1162
+ "bbox": [
1163
+ 173,
1164
+ 121,
1165
+ 826,
1166
+ 218
1167
+ ],
1168
+ "page_idx": 15
1169
+ },
1170
+ {
1171
+ "type": "text",
1172
+ "text": "Effect of HQSeg-44K In Table 15, we show the advantage of using HQSeg-44K by comparing HQ-SAM training with 44K randomly sampled images and masks from SA-1B [21]. Using the same efficient token learning strategy, training with SA-1B (44K) decreases the averaged mBIoU on the four datasets from 71.1 to 70.1, while ours improves it from 71.1 to 81.8. This validates the effectiveness of our constructed HQSeg-44K benchmark in improving mask quality. Note that the ablation experiments in Table 2, Table 3, Table 4, and Table 9 of the paper are all based on the constructed HQSeg-44K. ",
1173
+ "bbox": [
1174
+ 173,
1175
+ 224,
1176
+ 825,
1177
+ 321
1178
+ ],
1179
+ "page_idx": 15
1180
+ },
1181
+ {
1182
+ "type": "table",
1183
+ "img_path": "images/6b9df94d17f9e160516d8c1172080d078bf3d697de84e3dbba88b381fee7cbbd.jpg",
1184
+ "table_caption": [
1185
+ "Table 14: Data composition of our constructed HQ-Seg-44K. "
1186
+ ],
1187
+ "table_footnote": [],
1188
+ "table_body": "<table><tr><td>Dataset</td><td>DIS [35]</td><td>Thin-Object 5k [29]</td><td>FSS [26]</td><td>DUTS [46]</td><td>ECSSD [38]</td><td>MSRA-10K [8]</td><td>Total</td></tr><tr><td>Image Num.</td><td>3000</td><td>4748</td><td>10000</td><td>15572</td><td>1000</td><td>10000</td><td>44320</td></tr></table>",
1189
+ "bbox": [
1190
+ 178,
1191
+ 362,
1192
+ 823,
1193
+ 400
1194
+ ],
1195
+ "page_idx": 15
1196
+ },
1197
+ {
1198
+ "type": "image",
1199
+ "img_path": "images/cd0a6b40af772e74a6dd84609517d95ad0361f92e9a7bdf1f11d27cbd994c7c6.jpg",
1200
+ "image_caption": [
1201
+ "Figure 8: Visualization of annotated mask quality for randomly selected cases from the six dataset components of the HQ-Seg-44K. Zoom in for better viewing the fine-grained mask details. "
1202
+ ],
1203
+ "image_footnote": [],
1204
+ "bbox": [
1205
+ 186,
1206
+ 431,
1207
+ 823,
1208
+ 837
1209
+ ],
1210
+ "page_idx": 15
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "Zero-shot results on DIS and ThinObject-5K We also report zero-shot results in Table 16 on DIS and ThinObject-5K by removing the training splits of either or both datasets from the training of ",
1215
+ "bbox": [
1216
+ 174,
1217
+ 882,
1218
+ 821,
1219
+ 911
1220
+ ],
1221
+ "page_idx": 15
1222
+ },
1223
+ {
1224
+ "type": "table",
1225
+ "img_path": "images/7fa5f581954ed3b064b689142a99eb43063d57a4c96751072186dde9f64a5ab7.jpg",
1226
+ "table_caption": [
1227
+ "Table 15: Comparison of the training dataset. For the COCO dataset using ViT-L-based SAM, we use a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. "
1228
+ ],
1229
+ "table_footnote": [],
1230
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Dataset</td><td colspan=\"2\">DIS</td><td colspan=\"2\">COIFT</td><td colspan=\"2\">HRSOD</td><td colspan=\"2\">ThinObject mBIoU</td><td rowspan=\"2\">Average</td></tr><tr><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mBIoU</td><td>mIoU</td><td>mIoU</td><td>mBIoU</td></tr><tr><td>SAM</td><td>SA-1B</td><td>62.0</td><td>52.8</td><td>92.1</td><td>86.5</td><td>90.2</td><td>83.1</td><td>73.6</td><td>61.8</td><td>79.5</td><td>71.1</td></tr><tr><td>HQ-SAM</td><td>+ SA-1B-44K</td><td>60.4</td><td>51.7</td><td>91.1</td><td>86.1</td><td>88.4</td><td>80.9</td><td>73.1</td><td>61.8</td><td>78.3</td><td>70.1</td></tr><tr><td>HQ-SAM</td><td>+ HQ-Seg-44K(Ours)</td><td>78.6</td><td>70.4</td><td>94.8</td><td>90.1</td><td>93.6</td><td>86.9</td><td>89.5</td><td>79.9</td><td>89.1</td><td>81.8</td></tr></table>",
1231
+ "bbox": [
1232
+ 176,
1233
+ 130,
1234
+ 825,
1235
+ 193
1236
+ ],
1237
+ "page_idx": 16
1238
+ },
1239
+ {
1240
+ "type": "image",
1241
+ "img_path": "images/e8c7b778d9aac766ea214213137b57b038b7dab53250c5ec0ddcfe7a2349f2f4.jpg",
1242
+ "image_caption": [
1243
+ "Figure 9: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) on DIS test set, given the same red box prompt. HQ-SAM produces significantly more accurate boundaries. "
1244
+ ],
1245
+ "image_footnote": [],
1246
+ "bbox": [
1247
+ 178,
1248
+ 210,
1249
+ 821,
1250
+ 455
1251
+ ],
1252
+ "page_idx": 16
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "HQ-SAM. The improvement of HQ-SAM over SAM is still substantial on DIS or ThinObject (over 10.0 points on DIS-mIoU and 9.0 points on ThinObject-mIoU), even when the corresponding training splits are removed from training. ",
1257
+ "bbox": [
1258
+ 174,
1259
+ 515,
1260
+ 823,
1261
+ 558
1262
+ ],
1263
+ "page_idx": 16
1264
+ },
1265
+ {
1266
+ "type": "table",
1267
+ "img_path": "images/15cc75ab0333c729a519b45a084ae9c050dea88873a18ae4930bfe3567f628e3.jpg",
1268
+ "table_caption": [
1269
+ "Table 16: Zero-shot results on DIS and ThinObject-5K by removing the training splits of either or both datasets from the training of HQ-SAM. Results not obtained in a zero-shot manner (i.e. the training split was used), are shown in parenthesis to easily compare zero-shot results. "
1270
+ ],
1271
+ "table_footnote": [],
1272
+ "table_body": "<table><tr><td>Training Setting</td><td>DIS-mIoU</td><td>DIS-mBIoU</td><td>ThinObject-mloU</td><td>ThinObject-mBIoU</td></tr><tr><td>SAM (baseline)</td><td>62.0</td><td>52.8</td><td>73.6</td><td>61.8</td></tr><tr><td>HQ-SAM (remove both DIS and ThinObject)</td><td>72.9</td><td>63.1</td><td>82.7</td><td>70.7</td></tr><tr><td>HQ-SAM (remove DIS)</td><td>74.7</td><td>66.2</td><td>(90.1)</td><td>(80.4)</td></tr><tr><td>HQ-SAM (remove ThinObject)</td><td>(78.4)</td><td>(70.3)</td><td>83.3</td><td>72.1</td></tr><tr><td>HQ-SAM (default HQSeg-44K)</td><td>(78.6)</td><td>(70.4)</td><td>(89.5)</td><td>(79.9)</td></tr></table>",
1273
+ "bbox": [
1274
+ 176,
1275
+ 626,
1276
+ 825,
1277
+ 712
1278
+ ],
1279
+ "page_idx": 16
1280
+ },
1281
+ {
1282
+ "type": "text",
1283
+ "text": "9 More Visual Results Comparison ",
1284
+ "text_level": 1,
1285
+ "bbox": [
1286
+ 173,
1287
+ 739,
1288
+ 482,
1289
+ 757
1290
+ ],
1291
+ "page_idx": 16
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "text": "We provide more extensive visual results comparison in Figure 9 (DIS [35] test set), Figure 10 (zeroshot setting in COCO), Figure 11 (noised box input) and Figure 12 (zero-shot setting in HRSOD [51], NDD20 [41] and web images which cover objects with various structure complexities in diverse environments. In Figure 13 and Figure 14, we provide the zero-shot video segmentation results comparison on DAVIS 2017 and YTVIS 2019 benchmarks respectively. Besides, we include the dark underwater environment in NDD20 [41] and randomly selected web images in Figure 12, showing that the zero-shot segmentation power in SAM is well preserved by HQ-SAM. In Figure 12, we also include two failure cases in the rightmost two columns of the third row and bottom row, where HQ-SAM improves over SAM, but still cannot achieve fully correct mask prediction. ",
1296
+ "bbox": [
1297
+ 173,
1298
+ 770,
1299
+ 826,
1300
+ 896
1301
+ ],
1302
+ "page_idx": 16
1303
+ },
1304
+ {
1305
+ "type": "image",
1306
+ "img_path": "images/e795bb0b5cd7075b6c3a38e3405e6ac7c9ed26c5bf98bf3f7fd17b615947eeaf.jpg",
1307
+ "image_caption": [
1308
+ "Figure 10: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) on COCO val set in zero-shot setting, using a SOTA detector FocalNet-DINO [53] trained on the COCO dataset as our box prompt generator. HQ-SAM predicts masks with higher quality than SAM with less mask artifacts. "
1309
+ ],
1310
+ "image_footnote": [],
1311
+ "bbox": [
1312
+ 173,
1313
+ 132,
1314
+ 818,
1315
+ 525
1316
+ ],
1317
+ "page_idx": 17
1318
+ },
1319
+ {
1320
+ "type": "image",
1321
+ "img_path": "images/1af3959ed492899c80291476410d91a2c2469d5a8493f8c962999aa306800ca3.jpg",
1322
+ "image_caption": [
1323
+ "Figure 11: Visual results comparison between SAM (top row) vs. HQ-SAM (bottom row) with both the GT and noised green box prompt. HQ-SAM produces much more consistent and robust segmentation results regarding to the noises in the input boxes. "
1324
+ ],
1325
+ "image_footnote": [],
1326
+ "bbox": [
1327
+ 179,
1328
+ 680,
1329
+ 812,
1330
+ 809
1331
+ ],
1332
+ "page_idx": 17
1333
+ },
1334
+ {
1335
+ "type": "image",
1336
+ "img_path": "images/c11fb3e2b4fdeb3edcc542de87a5867e05f33080fbaa3227e87d4558bbc33bfd.jpg",
1337
+ "image_caption": [
1338
+ "Figure 12: Visual results comparison between SAM (top row and third row) vs. HQ-SAM (second row and bottom row) in zero-shot setting, given the same yellow box or point prompt. HQ-SAM produces significantly more detailed preserving masks while fixing mask errors with broken holes. The rightmost two columns in the third row and bottom row show two failure cases of HQ-SAM in extremely dark environments or very tiny metal rods. "
1339
+ ],
1340
+ "image_footnote": [],
1341
+ "bbox": [
1342
+ 179,
1343
+ 276,
1344
+ 820,
1345
+ 646
1346
+ ],
1347
+ "page_idx": 18
1348
+ },
1349
+ {
1350
+ "type": "image",
1351
+ "img_path": "images/e68837b6fab3f016dbf3028fa6a390df5ea43384dbc9e110f1a8d9412d80b5b9.jpg",
1352
+ "image_caption": [
1353
+ "Figure 13: Visual results comparison between SAM vs. HQ-SAM on video object segmentation benchmark DAVIS 2017 in zero-shot setting, given the same video boxes prompts generated by the pre-trained XMem [7]. "
1354
+ ],
1355
+ "image_footnote": [],
1356
+ "bbox": [
1357
+ 181,
1358
+ 226,
1359
+ 815,
1360
+ 722
1361
+ ],
1362
+ "page_idx": 19
1363
+ },
1364
+ {
1365
+ "type": "image",
1366
+ "img_path": "images/9fcb950c275fe6b53fde13b0b74eb0a8bd8c670b625373bc6ce7ed6a44586938.jpg",
1367
+ "image_caption": [
1368
+ "Figure 14: Visual results comparison between SAM vs. HQ-SAM on video instance segmentation benchmark YTVIS 2019 in zero-shot setting, given the same video boxes prompts generated by the pre-trained Mask2Former [4]. "
1369
+ ],
1370
+ "image_footnote": [],
1371
+ "bbox": [
1372
+ 181,
1373
+ 196,
1374
+ 813,
1375
+ 746
1376
+ ],
1377
+ "page_idx": 20
1378
+ }
1379
+ ]
parse/dev/RA7ND878XP/RA7ND878XP_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RA7ND878XP/RA7ND878XP_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/VgOw1pUPh97/VgOw1pUPh97_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/0NXUSlb6oEu/0NXUSlb6oEu_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:435fdf0d0cfd825a5b65f298ec4a44f6c885c616390402f15ce6d12787eeadbd
3
+ size 1068607
parse/train/0NXUSlb6oEu/0NXUSlb6oEu_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a9dbe0abce705a85cdf3bcb9892009c890a7a7f51ce46c84ccfd04ee0acb2bc
3
+ size 886718
parse/train/0NXUSlb6oEu/0NXUSlb6oEu_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db584917fd96cef4b8637e51b17188a99ae93b17211ce57821df8a2a630d89bb
3
+ size 1087666
parse/train/6YEQUn0QICG/6YEQUn0QICG_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5af0b10b23e9c9d6124f947f070b364ac9f030ad60b8c62fcee04af4332ed22a
3
+ size 4580825
parse/train/6YEQUn0QICG/6YEQUn0QICG_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c2667737364557da31d3791de9475578d5d91aa6407330c490d983829f3f3ae
3
+ size 4295675
parse/train/6YEQUn0QICG/6YEQUn0QICG_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ad80de19eeeb1da68084c46875ce58cea8143d5cf510f779f0d6afd0029aa15
3
+ size 4586346
parse/train/74RmfBweB60/74RmfBweB60_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1f19e8ab7afdbfae36fd58411e01020490d2379085a6ffc57f83d9911216b86
3
+ size 872369
parse/train/74RmfBweB60/74RmfBweB60_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e7dd00f19f3f28d0d296014456de24a53ba2d8e761c5573cf3173b2985f518a
3
+ size 670054
parse/train/74RmfBweB60/74RmfBweB60_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5a30d346684e9500b17f3585d421819dd32770ad85c3bb4da269e9dc715ee32
3
+ size 883846
parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fb5427b8460e58677ace1e3d05eff41391d83a4beaf482ee25b31abc881cb75
3
+ size 925595
parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52658e03894f66bb7bf7d500f6be81a737bce4fc762b8da6da779191065be90f
3
+ size 787946
parse/train/7wCBOfJ8hJM/7wCBOfJ8hJM_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f71ae752ab90412ee150829e677ffb93b45c4d3a24fbd5b272ed67ed562c15af
3
+ size 925649
parse/train/8dqEeFuhgMG/8dqEeFuhgMG_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b25315385d6828bbcd40cef319b1f73271c1dc165254d551899ddc191cc8b7b3
3
+ size 1689113
parse/train/8dqEeFuhgMG/8dqEeFuhgMG_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7a894e4a34a6be858f8a095921ecd1a0c77f9cb62fd951970ddb37850e3b079
3
+ size 1518086
parse/train/8dqEeFuhgMG/8dqEeFuhgMG_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39d36f5892626d5e719ca4bd850c7b9157326d60c5603e66b39708fe02080d7a
3
+ size 1701373
parse/train/9xC2tWEwBD/9xC2tWEwBD_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8b6c691faa9a6f3e9fd3e031c23365570fe5f2a934aabfafb2584fa99feb9e1
3
+ size 886395
parse/train/9xC2tWEwBD/9xC2tWEwBD_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd847fead2901e311caa34f98a0097c9df42c749b6a29310b1199bf229b8d4b1
3
+ size 670307
parse/train/9xC2tWEwBD/9xC2tWEwBD_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4590efbcb91bcb79e7ac1cd1e1546c6181edb2641a4ed8df2e594cd57c5fb5f
3
+ size 898209
parse/train/B1ewdt9xe/B1ewdt9xe_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:640f4739f92628ae99dbbee8b67cdd087b19b35312319525e04bf5745b208396
3
+ size 3098934
parse/train/B1ewdt9xe/B1ewdt9xe_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3605816160c9b6d8cff1bd522c3441f6a8adc9ded81b65165580b33a86391866
3
+ size 2951919
parse/train/B1ewdt9xe/B1ewdt9xe_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45e93696a0da5e75d6ef803767c81d70e5092a8fb04670e2da9c51e8a13ee708
3
+ size 3105385
parse/train/B1gTShAct7/B1gTShAct7_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f20d8f2631e100fc840e9c79cfe62b45598771a28f88c1a51e8fd41800e12ce3
3
+ size 3633925
parse/train/B1gTShAct7/B1gTShAct7_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:facbca938259089ccef51af5304156599503184513fff9d98cfd88ee8ff4dc7e
3
+ size 3259226
parse/train/B1gTShAct7/B1gTShAct7_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66d9896deee91067a6b49e5a9131ccc682a250dd213a378d48be3060c6332222
3
+ size 3635557
parse/train/B1lnbRNtwr/B1lnbRNtwr_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f357c1908a9769a031906d12352b563329d88eb3f27e3b551376f44257fc6e7
3
+ size 855704
parse/train/B1lnbRNtwr/B1lnbRNtwr_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b401f9a254a900f23dc1aea41100744165a013ecc2f7b47ae283f85e0364e84c
3
+ size 754790
parse/train/B1lnbRNtwr/B1lnbRNtwr_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41fc004dea9e81bbcba7037ea2b474e229040052126d397c8dd89f07cd685f74
3
+ size 858246
parse/train/B1xm3RVtwB/B1xm3RVtwB_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:734a91de719549e51c54f9e82b758aea29a8dea37921ed58d8576515698ef43f
3
+ size 1652240
parse/train/B1xm3RVtwB/B1xm3RVtwB_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4cb5d822528c92cb0eb605cee14a60467794208c0bbf34daa85e46645a0d3b0
3
+ size 1509293