sage.architecture.backend.resnet3d_cbam
Filename : resnet3d_cbam.py Description : Short description of the file
Created on 2026-03-05 13:52:22
__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, Sage __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]
GitHub Repository: NULL
Documentation: NULL
Classes
3D ResNet backbone with CBAM + detector-aware attention modules. |
Functions
|
Constructs a ResNet-18 model. |
|
Constructs a ResNet-34 model. |
|
Constructs a ResNet-50 model. |
|
Constructs a ResNet-101 model. |
|
Constructs a ResNet-152 model. |
Module Contents
- class ResNet(block, layers, num_classes=512, in_channels=1)[source]
Bases:
torch.nn.Module3D ResNet backbone with CBAM + detector-aware attention modules.
An extension of the standard 2D ResNet that processes detector feature volumes of shape
(B, 1, D=2, H, W)with 3D convolutions. In addition to the per-block CBAM gates, the backbone integrates:DetectorAttention in every residual block to weight each detector’s contribution channel-wise.
DetectorFusion after layer 2 to mix H1/L1 features.
CoherenceAttention after layer 2 to gate on inter-detector agreement.
TemporalTransformer after layer 4 for long-range context over the frequency axis.
Learned detector embedding added to the stem output for positional discrimination of the two detector channels.
- Parameters:
block (type) – Residual block class —
BasicBlockorBottleneck.layers (list[int]) – Number of blocks in each of the four stages.
num_classes (int) – Output feature dimension of the final FC layer (default
512).in_channels (int) – Number of input channels (default
1for single-channel 3D volume).state (Initialize internal Module)
ScriptModule. (shared by both nn.Module and)
- resnet18_cbam(pretrained=False, **kwargs)[source]
Constructs a ResNet-18 model.
- Parameters:
pretrained (bool) – If True, returns a model pre-trained on ImageNet
- resnet34_cbam(pretrained=False, **kwargs)[source]
Constructs a ResNet-34 model.
- Parameters:
pretrained (bool) – If True, returns a model pre-trained on ImageNet
- resnet50_cbam(pretrained=False, **kwargs)[source]
Constructs a ResNet-50 model.
- Parameters:
pretrained (bool) – If True, returns a model pre-trained on ImageNet