Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of : HIC-YOLOv5: Improved YOLOv5 for Small Object Detection #12264

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e7e1cdb
imp of CBAM + Involution at common.py
aash1999 Oct 21, 2023
16fd02c
import CBAm and Involution into yolo.py
aash1999 Oct 21, 2023
7eff0ef
handle GPU err on
aash1999 Oct 21, 2023
b7715ca
Merge pull request #1 from aash1999/cbam-imp
aash1999 Oct 21, 2023
55ea408
added arch. backbone to /models/
aash1999 Oct 21, 2023
02469f2
readme update
aash1999 Oct 21, 2023
a27e8d1
Merge pull request #2 from aash1999/cbam-imp
aash1999 Oct 21, 2023
b1b1ab9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2023
2ee59f6
Update general.py
aash1999 Oct 24, 2023
79112df
Update common.py
aash1999 Oct 24, 2023
3d46323
adding hyp and model files as mentioned in paper
aash1999 Oct 24, 2023
f0b2ffc
Merge pull request #4 from aash1999/cbam-imp
aash1999 Oct 24, 2023
1204c74
Delete models/yolo5m-cbam-involution.yaml
aash1999 Oct 24, 2023
947266a
Update general.py
aash1999 Oct 24, 2023
a56bf81
Update yolov5s-cbam-involution.yaml
aash1999 Oct 25, 2023
5208303
Update CITATION.cff
aash1999 Oct 25, 2023
ccf2664
removed trailing spaces in general.py
aash1999 Oct 25, 2023
16ed93a
yapf formatting
aash1999 Oct 25, 2023
11ddc58
yapf formatting
aash1999 Oct 25, 2023
02bf256
Delete CITATION.cff
aash1999 Oct 25, 2023
1f85ade
reverting the files to commit 4d687c8
aash1999 Oct 25, 2023
8738c27
yapf reformat
aash1999 Oct 25, 2023
0fd8fe3
movig files to where they belong
aash1999 Oct 25, 2023
2fc73ca
typo correction
aash1999 Oct 25, 2023
ad78882
Merge branch 'master' into master
aash1999 Oct 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding hyp and model files as mentioned in paper
  • Loading branch information
aash1999 committed Oct 24, 2023
commit 3d46323e556c73859577e37a721e65d7916f835b
34 changes: 34 additions & 0 deletions data/hyps/cbam.hyp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
# Hyperparameters for low-augmentation COCO training from scratch
# python train.py --batch 64 --cfg yolov5n6.yaml --weights '' --data coco.yaml --img 640 --epochs 300 --linear
# See tutorials for hyperparameter evolution https://github.com/ultralytics/yolov5#tutorials

lr0: 0.001 # initial learning rate (SGD=1E-2, Adam=1E-3)
lrf: 0.01 # final OneCycleLR learning rate (lr0 * lrf)
momentum: 0.937 # SGD momentum/Adam beta1
weight_decay: 0.0005 # optimizer weight decay 5e-4
warmup_epochs: 3.0 # warmup epochs (fractions ok)
warmup_momentum: 0.8 # warmup initial momentum
warmup_bias_lr: 0.1 # warmup initial bias lr
box: 0.05 # box loss gain
cls: 0.25 # cls loss gain
cls_pw: 1.0 # cls BCELoss positive_weight
obj: 0.5 # obj loss gain (scale with pixels)
obj_pw: 1.0 # obj BCELoss positive_weight
iou_t: 0.20 # IoU training threshold
anchor_t: 4.0 # anchor-multiple threshold
# anchors: 3 # anchors per output layer (0 to ignore)
fl_gamma: 0.0 # focal loss gamma (efficientDet default gamma=1.5)
hsv_h: 0.4 # image HSV-Hue augmentation (fraction)
hsv_s: 0.3 # image HSV-Saturation augmentation (fraction)
hsv_v: 0.5 # image HSV-Value augmentation (fraction)
degrees: 0.2 # image rotation (+/- deg)
translate: 0.1 # image translation (+/- fraction)
scale: 0.4 # image scale (+/- gain)
shear: 0.0 # image shear (+/- deg)
perspective: 0.0 # image perspective (+/- fraction), range 0-0.001
flipud: 0.0 # image flip up-down (probability)
fliplr: 0.5 # image flip left-right (probability)
mosaic: 1.0 # image mosaic (probability)s
mixup: 0.2 # image mixup (probability)
copy_paste: 0.1 # segment copy-paste (probability)
60 changes: 60 additions & 0 deletions models/yolov5s-cbam-involution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license

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

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

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

[-1, 1, Conv, [512, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 4], 1, Concat, [1]], # cat backbone P3
[-1, 3, C3, [512, False]], # 19

[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 2], 1, Concat, [1]],
[-1, 3, C3, [256, False]], # 23 160*160 p2 head

[-1, 1, Conv, [256, 3, 2]],
[[-1, 19], 1, Concat, [1]],
[-1, 3, C3, [512, False]], # 26 80*80 p3 head

[-1, 1, Conv, [256, 3, 2]],
[[-1, 15], 1, Concat, [1]],
[-1, 3, C3, [256, False]], # 29 40*40 p4 head

[-1, 1, Conv, [512, 3, 2]],
[[-1, 11], 1, Concat, [1]],
[-1, 3, C3, [1024, False]], # 32 20*20 p5 head

[[23, 26, 29, 32], 1, Detect, [nc, anchors]], # Detect(P2, P3, P4, P5)
]