论文:Haar wavelet downsampling: A simple but effective downsampling module
GitHub地址 :https://github.com/apple1986/HWD
论文地址: https://www.sciencedirect.com/science/article/pii/S0031320323005174
这篇论文利用频域的小波变化来进行降采样,图像经过小波变化会得到1个低频特征A,和3个高频特征H、V、D。常规的下采样操作普遍面临的信息损失问题,应用Haar小波变换来降低特征图的空间分辨率,可以更完整的保留图像的信息。
```import torchimport torch.nn as nnfrom pytorch_wavelets
import DWTForward
class Down_wt(nn.Module):
def __init__(self, in_ch, out_ch):
super(Down_wt, self).__init__()
self.wt = DWTForward(J=1, mode='zero', wave='haar')
self.conv_bn_relu = nn.Sequential(
nn.Conv2d(in_ch * 4, out_ch, kernel_size=1, stride=1),
nn.BatchNorm2d(out_ch),
nn.ReLU(inplace=True),