赞
踩
近年来遥感目标检测的研究主要集中在改进面向边界盒的表示,而忽略了遥感场景中独特的先验知识。这种先验知识可能是有用的,因为微小的遥感目标可能在没有参考足够的远程背景的情况下被错误地探测到,而不同类型的目标所需的远程背景可能有所不同。在本文中,我们考虑到这些先验因素,提出了大选择性核网络(LSKNet)。LSKNet可以动态调整其大空间感受场,更好地模拟遥感场景中各种物体的测距环境。据我们所知,这是第一次在遥感目标检测领域探索大型和选择性的内核机制。没有花哨的东西,LSKNet在标准基准上设定了新的最先进的分数,即HRSC2016 (98.46% mAP), DOTA-v1.0 (81.85% mAP)和FAIR1M-v1.0 (47.87% mAP)。基于类似的技术,我们在2022年大湾区国际算法大赛中获得第二名。
原文地址:Large Selective Kernel Network for Remote Sensing Object Detection
代码实现:
import torch
import torch.nn as nn
class LSKblock(nn.Module):
def __init__(self, dim):
super().__init__()
self.conv0 = nn.Conv2d(dim, dim, 5, padding=2, groups=dim)
self.conv_spatial = nn.Conv2d(dim, dim, 7, stride=1, padding=9, groups=dim, dilation=3)
self.conv1 = nn.Conv2d(dim, dim//2, 1)
self.conv2 = nn.Conv2d(dim, dim//2, 1)
self.conv_squeeze = nn.Conv2d(2, 2, 7, padding=3)
self.conv = nn.Conv2d(dim//2, dim, 1)
def forward(self, x):
attn1 = self.conv0(x)
attn2 = self.conv_spatial(attn1)
attn1 = self.conv1(attn1)
attn2 = self.conv2(attn2)
attn = torch.cat([attn1, attn2], dim=1)
avg_attn = torch.mean(attn, dim=1, keepdim=True)
max_attn, _ = torch.max(attn, dim=1, keepdim=True)
agg = torch.cat([avg_attn, max_attn], dim=1)
sig = self.conv_squeeze(agg).sigmoid()
attn = attn1 * sig[:,0,:,:].unsqueeze(1) + attn2 * sig[:,1,:,:].unsqueeze(1)
attn = self.conv(attn)
return x * attn
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。