当前位置:网站首页>Yolov5 improvement 5: improve the feature fusion network panet to bifpn
Yolov5 improvement 5: improve the feature fusion network panet to bifpn
2022-07-28 22:49:00 【Artificial Intelligence Algorithm Research Institute】
front said : As the current advanced deep learning target detection algorithm YOLOv5, A large number of trick, But when dealing with some complex background problems , It is still prone to the problem of mistakes and omissions . Subsequent articles , Focus on YOLOv5 How to improve is introduced in detail , The purpose is to provide their own meager help and reference for those who need innovation in scientific research or friends who need to achieve better results in engineering projects .
solve the problem : Join in BIFPN Weighted two-way pyramid structure , Improve the detection effect of different scales


Add method :
First step :common.py structure Concat_BIFPN modular .
class Concat_BIFPN(nn.Module):
# Concatenate a list of tensors along dimension
def __init__(self, c1, c2):
super(Concat_BIFPN, self).__init__()
self.relu = nn.ReLU()
self.w1 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True)
self.w2 = nn.Parameter(torch.ones(3, dtype=torch.float32), requires_grad=True)
self.epsilon = 0.0001
self.conv = nn.Conv2d(c1, c2, kernel_size=1, stride=1, padding=0)
self.swish = MemoryEfficientSwish()
def forward(self, x):
outs = self._forward(x)
return outs
def _forward(self, x):
if len(x) == 2:
# w = self.relu(self.w1)
w = self.w1
weight = w / (torch.sum(w, dim=0) + self.epsilon)
# Connections for P6_0 and P7_0 to P6_1 respectively
x = self.conv(self.swish(weight[0] * x[0] + weight[1] * x[1]))
elif len(x) == 3:
# w = self.relu(self.w2)
w = self.w2
weight = w / (torch.sum(w, dim=0) + self.epsilon)
x = self.conv(self.swish(weight[0] * x[0] + weight[1] * x[1] + weight[2] * x[2]))
return xThe second step :yolo.py Register in Concat_BIFPNt modular
elif m is Concat_BIFPN:
c2 = max([ch[x] for x in f])#2021.11.11 Change fit bifpn Use The third step : modify yaml file , Need modification head( Feature fusion network ).

Step four : take train.py In this article yaml File can , Start training .
junction fruit : I have done a lot of experiments on multiple data sets , For different data sets, the effect is different , There are also differences in the methods of adding locations to the same dataset , You need to experiment . Most cases are effective and improved .
Let me know : The next content sharing adds a small target detection layer . Interested friends can pay attention to me , If you have questions, you can leave a message or chat with me in private
PS:, Not only can it be added YOLOv5, It can also be added to any other deep learning network , Whether it is classification, detection or segmentation , Mainly in the field of computer vision , May have different degrees of improvement effect .
Last , I hope I can powder each other , Be a friend , Learn and communicate together .
边栏推荐
- 776. 字符串移位包含问题
- GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道
- Yolov5 improvement 4: add ECA channel attention mechanism
- 基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
- The blueprint of flask complements openpyxl
- STM32 single chip microcomputer drive L298N
- Summary of C language learning content
- 《Robust and Communication-Efficient Federated Learning From Non-i.i.d. Data》论文阅读
- Detection and tracking evaluation index
- 记录一下关于三角函数交换积分次序的一道题
猜你喜欢

Migration from IPv4 to IPv6

使用PCL批量将点云.bin文件转.pcd

STM32 - external interrupt application (exti) (use cubemx to configure interrupts)

Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels

【转载】token令牌在登录场景使用

shell脚本基础——Shell运行原理+变量、数组定义

PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)

STM32 - memory, I2C protocol

Summary of common error types in JS

Stm32subeide (10) -- ADC scans multiple channels in DMA mode
随机推荐
Labelme labels circular objects [tips]
PUA in the workplace, but it makes sense
What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
使用PCL批量显示PCD点云数据流
Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels
STM32 - memory, I2C protocol
Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]
STM32 board level support package for keys
Lenovo r9000p installation matlab2018a+cuda10.0 compilation
Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
Excel-vba quick start (XIII. Common usage of date)
OSV_ q The size of tensor a (704) must match the size of tensor b (320) at non-singleton dime
1e3是浮点数?
Att & CK Threat Intelligence
[virtual machine _2]-hyper-v and vmware/virtualbox cannot coexist
6K6w5LiA5qyh5pS75Ye75YiG5p6Q
The function of wechat applet to cut pictures
Winserver operation and maintenance technology stack
Using PCL to batch display PCD point cloud data flow
OSV-q ValueError: axes don‘t match array