模块更新于 2026-11-20· 浏览 0· 下载 0
RCSSC 残差列空间自校正模块
三分支自校正:空间注意力分支增强关键区域的结构表征,列注意力分支用 (H,1) 核对每列做双路池化强化列特性,自校准分支经下采样-上采样建立远程依赖,融合后门控相乘、残差输出
结构图

三分支自校正:空间注意力分支增强关键区域的结构表征,列注意力分支用 (H,1) 核对每列做双路池化强化列特性,自校准分支经下采样-上采样建立远程依赖,融合后门控相乘、残差输出
论文信息
- 论文:ASCNet: Asymmetric Sampling Correction Network for Infrared Image Destriping
- 出处:IEEE TGRS 2025
核心痛点
红外焦平面阵列按列读出信号,条纹噪声沿列方向污染图像;现有去条纹方法缺少对列方向长程依赖的显式建模,分不清条纹噪声和场景自带的竖直结构,去条纹不彻底还容易误伤竖直边缘。
模块亮点
- 三分支自校正:空间注意力分支增强关键区域的结构表征,列注意力分支用 (H,1) 核对每列做双路池化强化列特性,自校准分支经下采样-上采样建立远程依赖,融合后门控相乘、残差输出
- 对症列向条带:同一列像素共享读出放大器,列注意力给同列特征相近的校正系数,专治条纹噪声的列间差异;空间注意力解耦条纹与背景结构,自校准微调全局一致性
- 整体模型涨点:RCSSC 无单独消融数字,它嵌在 CNCM 中支撑 ASCNet 在三个红外测试集、四种条纹噪声上全面超越十个 SOTA;INFRARED 均匀噪声下 PSNR 比 DSCGAN 高 0.43 dB、比 Restormer 高 3.01 dB,真实数据 NIQE 最优
适用场景
领域为红外图像去条纹 / 非均匀性校正;原文在高斯、均匀、周期、混合四种条纹噪声的合成数据和真实红外图像上验证,还做了红外小目标检测(IRSTD)下游任务;可迁移到遥感图像去条带等需要列向校正的复原任务。
插入位置建议
- U 型网络编码端,每次下采样器之后接一个 RCSSC,原文就放在 RHDWT 后
- U 型网络解码端,上采样与跳跃连接融合之后,用 RCSSC 细分条纹噪声、恢复纹理细节
- 嵌进密集连接残差结构堆叠多个 RCSSC 组成 CNCM,或直接替换复原网络里的普通残差卷积块
适用任务
- 红外图像去条纹
- 非均匀性校正
完整代码
rcssc.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class ChannelPool(nn.Module):
def forward(self, x):
# 将maxpooling 与 global average pooling 结果拼接在一起
return torch.cat((torch.max(x, 1)[0].unsqueeze(1), torch.mean(x, 1).unsqueeze(1)), dim=1)
class Basic(nn.Module):
def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, relu=True, bn=True, bias=False):
super(Basic, self).__init__()
self.out_channels = out_planes
self.conv = nn.Conv2d(in_channels=in_planes, out_channels=out_planes, kernel_size=kernel_size, stride=stride,
padding=padding, bias=bias)
self.bn = nn.BatchNorm2d(out_planes, eps=1e-5, momentum=0.01, affine=True) if bn else None
self.relu = nn.LeakyReLU() if relu else None
def forward(self, x):
x = self.conv(x)
if self.bn is not None:
x = self.bn(x)
if self.relu is not None:
x = self.relu(x)
return x
class CALayer(nn.Module):
def __init__(self, channel, reduction=16):
super(CALayer, self).__init__()
self.avgPoolW = nn.AdaptiveAvgPool2d((1, None))
self.maxPoolW = nn.AdaptiveMaxPool2d((1, None))
self.conv_1x1 = nn.Conv2d(in_channels=2 * channel, out_channels=2 * channel, kernel_size=1, padding=0, stride=1,
bias=False)
self.bn = nn.BatchNorm2d(2 * channel, eps=1e-5, momentum=0.01, affine=True)
self.Relu = nn.LeakyReLU()
self.F_h = nn.Sequential( # 激发操作
nn.Conv2d(channel, channel // reduction, 1, padding=0, bias=True),
nn.BatchNorm2d(channel // reduction, eps=1e-5, momentum=0.01, affine=True),
nn.ReLU(inplace=True),
nn.Conv2d(channel // reduction, channel, 1, padding=0, bias=True),
)
self.F_w = nn.Sequential( # 激发操作
nn.Conv2d(channel, channel // reduction, 1, padding=0, bias=True),
nn.BatchNorm2d(channel // reduction, eps=1e-5, momentum=0.01, affine=True),
nn.ReLU(inplace=True),
nn.Conv2d(channel // reduction, channel, 1, padding=0, bias=True),
)
self.sigmoid = nn.Sigmoid()
def forward(self, x):
N, C, H, W = x.size()
res = x
x_cat = torch.cat([self.avgPoolW(x), self.maxPoolW(x)], 1)
x = self.Relu(self.bn(self.conv_1x1(x_cat)))
x_1, x_2 = x.split(C, 1)
x_1 = self.F_h(x_1)
x_2 = self.F_w(x_2)
s_h = self.sigmoid(x_1)
s_w = self.sigmoid(x_2)
out = res * s_h.expand_as(res) * s_w.expand_as(res)
return out
class spatial_attn_layer(nn.Module):
def __init__(self, kernel_size=3):
super(spatial_attn_layer, self).__init__()
self.compress = ChannelPool()
self.spatial = Basic(2, 1, kernel_size, stride=1, padding=(kernel_size - 1) // 2, bn=False, relu=False)
def forward(self, x):
x_compress = self.compress(x)
x_out = self.spatial(x_compress)
scale = torch.sigmoid(x_out) # broadcasting
return x * scale
class RCSSC(nn.Module):
def __init__(self, n_feat, reduction=16):
super(RCSSC, self).__init__()
pooling_r = 4
self.head = nn.Sequential(
nn.Conv2d(in_channels=n_feat, out_channels=n_feat, kernel_size=3, padding=1, stride=1, bias=True),
nn.LeakyReLU(),
)
self.SC = nn.Sequential(
nn.AvgPool2d(kernel_size=pooling_r, stride=pooling_r),
nn.Conv2d(in_channels=n_feat, out_channels=n_feat, kernel_size=3, padding=1, stride=1, bias=True),
nn.BatchNorm2d(n_feat)
)
self.SA = spatial_attn_layer() ## Spatial Attention
self.CA = CALayer(n_feat, reduction) ## Channel Attention
self.conv1x1 = nn.Sequential(
nn.Conv2d(n_feat * 2, n_feat, kernel_size=1),
nn.Conv2d(in_channels=n_feat, out_channels=n_feat, kernel_size=3, padding=1, stride=1, bias=True)
)
self.ReLU = nn.LeakyReLU()
self.tail = nn.Conv2d(in_channels=n_feat, out_channels=n_feat, kernel_size=3, padding=1)
def forward(self, x):
res = x
x = self.head(x)
sa_branch = self.SA(x)
ca_branch = self.CA(x)
x1 = torch.cat([sa_branch, ca_branch], dim=1) # 拼接
x1 = self.conv1x1(x1)
x2 = torch.sigmoid(
torch.add(x, F.interpolate(self.SC(x), x.size()[2:])))
out = torch.mul(x1, x2)
out = self.tail(out)
out = out + res
out = self.ReLU(out)
return out
if __name__ == '__main__':
block = RCSSC(n_feat=64).to('cuda')
input = torch.rand(1, 64, 32, 32).to('cuda')
output = block(input)
print(f"Input size: {input.size()}")
print(f"Output size: {output.size()}")
环境与依赖
Python 3.9+
继续浏览
下一篇RDSBN 校正域特定批归一化一域一分支:每个域配独立 BN 支路,各自统计均值方差并归一化,避免跨域共享参数,先隔离域特定风格相关资源
模块2026-11-20
CPIA-SA 跨范式交互与对齐自注意力
双注意力各管一摊:输入按通道对半分流,一半走 SPC-SA 在通道维做转置注意力,用 EPGO 动态生成 K 值做 Top-K 稀疏;另一半走 SPR-SA 用卷积近似空间自注意力,专注雨纹与纹理恢复
计算机视觉图像复原CPIASA
计算机视觉MIT
模块2026-11-20
VolSA 体积自注意力
接力式立方交互:同时做光谱向投影(C×C 相似度矩阵)与空间向投影(HW×HW 注意力图),接力相乘再融合,把二维切片交互升级为 3D 立方体交互
高光谱图像复原VolSA
计算机视觉MIT
模块2026-11-20
AGCA 自适应图通道注意力
把图卷积搬进通道注意力:每个通道当作一个图节点,用"单位矩阵 + 自注意力对角矩阵 + 可学习邻接矩阵"三张图自适应建模通道间关系,在特征层面做非局部操作,避开逐像素计算
目标检测缺陷检测AGCA
计算机视觉MIT