YOLOV5 network architecture

tags: yolov5

YOLOV5 network architecture

Overall architecture

  • Backbone(Main):Focus, BottleneckCSP, CSP
  • Head : PANet + Dectect (Yolov3/Yolov4 Head)

Code part

# parameters
nc: 80  # NUMBER OF CLASSES Category Number
depth_multiple: 0.33  # Model Depth Multiple Control Model Depth (BottleneckCSP)
width_multiple: 0.50  # LAYER CHANNEL MULTIPLE controls the number of conv channels (number of convolutionary nuclear)
# depth_multiple The layer scaling factor of the BottleneckCSP module, multiplying all the Bottleneck's Bottleneck's Bottleneck to get the final number.
#width_multiple Indicates the scaling factor of the convolution channel, which is the setting of the Backbone and Head section inside the Conv channel, all multiplied by this coefficient.
# The model design of different complexity can be achieved by these two parameters.

# anchors
anchors:   #Prick box or anchor frame
  - [10,13, 16,30, 33,23]  # P3 / 8 Represents Stride = 8 is also 8 times the size of the size after the sampling scale is 10 lengths 13
  - [30,61, 62,45, 59,119]  # P4/16
  - [116,90, 156,198, 373,326]  # P5/32

# YOLOv5 backbone
backbone:
  # [from, number, module, args]
  # From column parameters: Current module input from which layer output; -1 represents the input obtained from the previous layer
  # Number column parameters: This module is repeated; 1 means only one, 3 indicates three identical modules
  [[-1, 1, Focus, [64, 3]],  # 0-P1/2
   [-1, 1, Conv, [128, 3, 2]],  # 1-p2 / 4; 128 Indicates 128 volume nucleus, 3 represents 3 x 3 of the convolutionary core, 2 indicates that the step length is 2.
   [-1, 3, BottleneckCSP, [128]],
   [-1, 1, Conv, [256, 3, 2]],  # 3-P3/8
   [-1, 9, BottleneckCSP, [256]],
   [-1, 1, Conv, [512, 3, 2]],  # 5-P4/16
   [-1, 9, BottleneckCSP, [512]],
   [-1, 1, Conv, [1024, 3, 2]],  # 7-P5/32
   [-1, 1, SPP, [1024, [5, 9, 13]]],
   [-1, 3, BottleneckCSP, [1024, False]],  # 9
  ]

# YOLOv5 head
# The author does not divide the NECK module, so the head section contains the PaNet + Detect section.
head:
  [[-1, 1, Conv, [512, 1, 1]],
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 6], 1, Concat, [1]],  # cat backbone P4
   [-1, 3, BottleneckCSP, [512, False]],  # 13

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

   [-1, 1, Conv, [256, 3, 2]],
   [[-1, 14], 1, Concat, [1]],  # cat head P4
   [-1, 3, BottleneckCSP, [512, False]],  # 20 (P4/16-medium)

   [-1, 1, Conv, [512, 3, 2]],
   [[-1, 10], 1, Concat, [1]],  # cat head P5
   [-1, 3, BottleneckCSP, [1024, False]],  # 23 (P5/32-large)

   [[17, 20, 23], 1, Detect, [nc, anchors]],  # Detect(P3, P4, P5)
  ]

Number of x ___multiple is the final number

The network is constantly deepening (how much is used), is constantlyIncrease network feature extractionwithFeature fusionAbility.

How much is the number of convolution, and it also affects the third dimension of the feature map of the convolution, iethickness, Big white here is the networkwidth

FOCUS

It is equivalent to twice the sample, the quantity is four times,Can reduce floating point calculations but will not increase speed, do not affect MAP

[b,c,h,w]------->[b,c*4,h//2,w//2]

Where RES Block is the residual module

Pool

You can increase your field and extract the most important characteristics but will not reduce the amount of operation.

After the filling of the above poolization operation, the feature is not reduced.

PANet

That is, when the picture is only sampled, the original picture is not good and the picture after the sample is characterized, in order to solve this problem.Another line green lineAfter the upper sampling, the feature map can be fused on the same scale, and finallySplicing

So get information is more rich

Intelligent Recommendation

YOLOV5 V6.1 network structure

YOLOV5 has been updated to V6.1 version, which is different from the previous version, and the network structure has been further optimized. Come and finish. The main reference of this articleThe big ...

YOLOV5 network structure analysis

The second analysis (the first code is retrieved, in the following section) Add the following code to YOLO.PY and run. Pay attention to the path of adding Utils and Models folders with sys.path.appen ...

YOLOV5 network code analysis

Share here to analyze the code of the main characteristics of YOLOV5 and the code analysis of the overall network, I hope to help everyone's work. Code source:https://github.com/bubbliiiing/yolov5-pyt...

The combination of YOLOV5 and network communication

The combination of YOLOV5 and network communication This blog is recorded in the actual application of YOLOV5. Use Socket network programming to realize the main program to send pictures to the YOLOV5...

YOLOV5 Series (3) - YOLOV5 Modify Network Structure

Article catalog First, set the network structure to mobilenet-V2 Second, add attention module First, set the network structure to mobilenet-V2 First, you need to implement the Bottleneck and PWCONV of...

More Recommendation

【YOLOV5】 YOLOV5 network configuration file interpretation

NoticeNote that the YOLOV5 version at this time is 6.0 Compared with 5.0, the main update is as follows: The following is the interpretation of the network configuration file Configuration file path:y...

[YOLOV5 Series] Enhance the adaptive contrast to the YOLOV5 network

Gamma transform image enhancement Data sets often appear these scenes with inconsistent contrast and brightness, such as: some scenarios are good for lighting and obvious effects; some overall scenes ...

YOLOV5-6.0 series | YOLOV5 model network construction

If there are mistakes, please point out. Articles directory 1. Calling relationship 2. PARSE_MODEL function analysis 3. Detect class analysis 4. Model class analysis Learn the code of YOLOV5. Here you...

YOLOV5 combined with lightweight network MOBILENETV3

Mobilenetv3 inherits the strengths of the previous two versions, introduces some novel modules, and uses the latest neural network architecture search(Neural Architecture Search, NAS)technologyFrom lo...

Detailed explanation of YOLOv5 network structure

A beginner of deep learning, I hope to take notes and record what I have learned, and I hope that it can help people who are also introductory, and I hope that the big guys can help correct mistakes~ ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top