当前位置:网站首页>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 .
边栏推荐
- OSV-q ValueError: axes don‘t match array
- 二进制的原码、反码、补码
- C语言学习内容总结
- [get mobile information] - get mobile information through ADB command
- What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
- Use PCL to batch convert point cloud.Bin files to.Pcd
- Imx6q GPIO multiplexing
- OSV_ Q write divergence operator div and Laplace stepped on the pit
- Winserver operation and maintenance technology stack
- LVS+KeepAlived高可用部署实战应用
猜你喜欢

Concise history of graphic technology

STM32 single chip microcomputer drive L298N

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

GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道

Quadruped robot | gem (elevation map) + fast_ Deployment records of Leo (odometry) environment

DIP-VBTV: Color Image Restoration Model Combining Deep Image Prior and Vector Bundle Total Variation

Paddlenlp text classification based on ernir3.0: take wos dataset as an example (hierarchical classification)
![UNET [basic network]](/img/b0/d1f6b7bb1a35c82204b6ff2eb225a7.jpg)
UNET [basic network]
![Fastflow [abnormal detection: normalizing flow]](/img/5e/984e5bd34c493039e3c9909fc4df05.png)
Fastflow [abnormal detection: normalizing flow]

记录一下关于三角函数交换积分次序的一道题
随机推荐
Paper reading vision gnn: an image is worth graph of nodes
GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道
Winserver operation and maintenance technology stack
771. The longest consecutive character in a string
JS get the current time (year month day hour minute second)
Common library code snippet pytorch_ based【tips】
[get mobile information] - get mobile information through ADB command
770. 单词替换
Lenovo r9000p installation matlab2018a+cuda10.0 compilation
简单的es高亮实战
The function of wechat applet to cut pictures
Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]
STM32 - Communication
For loops and functions
Ocr-gan [anomaly detection: Reconstruction Based]
Detection and tracking evaluation index
SSH password free login
JSON file to PNG image (batch conversion / image naming / migration / pixel value change) [tips]
Padim [anomaly detection: embedded based]
Configuration and official document of Freia library [tips]