RTMDet-S
Fit diagram
Read at 100%
Clear selection
Download SVG
Download PNG
Click a block to read its description, or select it with Tab and Enter.
RTMDet-S
Detection; 640 × 640 RGB; 80 classes; batch 1; unfused native PyTorch eval.
LibreYOLO
RTMDet-S
Detection; 640 × 640 RGB; 80 classes; batch 1; unfused native PyTorch eval.
CSPNeXt backbone
Input
3 × 640 × 640
ConvBNAct 3×3, s=2
16 × 320 × 320
ConvBNAct 3×3
16 × 320 × 320
ConvBNAct 3×3
32 × 320 × 320
ConvBNAct 3×3, s=2
64 × 160 × 160
CSPLayer B2
64 × 160 × 160; n=1
ConvBNAct 3×3, s=2
128 × 80 × 80
CSPLayer B3
128 × 80 × 80; n=2
ConvBNAct 3×3, s=2
256 × 40 × 40
CSPLayer B4
256 × 40 × 40; n=2
ConvBNAct 3×3, s=2
512 × 20 × 20
SPPBottleneck
512 × 20 × 20
CSPLayer B5 (no residual)
512 × 20 × 20; n=1
Backbone CSP layers include channel attention.
CSPNeXtPAFPN
ConvBNAct 1×1
256 × 20 × 20
Nearest upsample ×2
256 × 40 × 40
Concat with B4
512 × 40 × 40
CSPLayer
256 × 40 × 40; n=1
ConvBNAct 1×1
128 × 40 × 40
Nearest upsample ×2
128 × 80 × 80
Concat with B3
256 × 80 × 80
CSPLayer
128 × 80 × 80; n=1
ConvBNAct 3×3, s=2
128 × 40 × 40
Concat with red
256 × 40 × 40
CSPLayer
256 × 40 × 40; n=1
ConvBNAct 3×3, s=2
256 × 20 × 20
Concat with lat
512 × 20 × 20
CSPLayer
512 × 20 × 20; n=1
B5
B4
B3
red
lat
Neck CSP: no residuals and no channel attention.
ConvBNAct 3×3
P3: 128 × 80 × 80
N3 continuation
ConvBNAct 3×3
P4: 128 × 40 × 40
Nout4 continuation
ConvBNAct 3×3
P5: 128 × 20 × 20
Nout5 continuation
These three output projections make every head input 128 channels.
Detection head
Run separately at P3/P4/P5: grids 80/40/20, strides 8/16/32.
Pyramid feature
128 channels
ConvBNAct 3×3
128 channels
ConvBNAct 3×3
128 channels
Conv2d 1×1
80 output channels; bias=True
Raw class output
80 channels; no activation
Pyramid feature
128 channels
ConvBNAct 3×3
128 channels
ConvBNAct 3×3
128 channels
Conv2d 1×1
4 output channels; bias=True
Multiply by stride (linear)
4 l/t/r/b distances in canvas pixels
Class/reg 3×3 conv weights are shared across levels; BN is per level.
Class and regression towers have separate parameters.
No per-level learned Scale modules. No DFL bins.
Total locations: 8,400. Classes remain logits in native outputs.
ConvBNAct
Conv2d
k/stride/padding/channels from occurrence; no bias
BatchNorm2d
eps=0.00001; momentum=0.1
SiLU
x × sigmoid(x)
Unmarked strides/groups are 1. Conv 3×3 uses p=1; Conv 1×1 p=0.
DepthwiseSeparable
ConvBNAct depthwise 5×5
p=2; groups=Q; 32/64/128/256 channels
ConvBNAct pointwise 1×1
32/64/128/256 channels
Both depthwise and pointwise convolutions have BN and SiLU.
CSPNeXtBlock
Input
32/64/128/256 channels
ConvBNAct 3×3
32/64/128/256 channels
DepthwiseSeparable 5×5
32/64/128/256 channels
+
Identity addition only in backbone B2/B3/B4.
CSPLayer
Input
Output width from stage
ConvBNAct 1×1
32/64/128/256 hidden channels
ConvBNAct 1×1
32/64/128/256 hidden channels
CSPNeXtBlock repeated n times
n from backbone stage; r in neck
Concat two branches
64/128/256/512 channels
ChannelAttention (backbone only)
Neck bypasses this operation
ConvBNAct 1×1
Output channels from stage
neck bypass
ChannelAttention
Input
Backbone stage output width
AdaptiveAvgPool2d
1 ×1 spatial output
Conv2d 1×1
Same channels; bias=True
Hardsigmoid
Clamp(x+3,0,6) /6; range[0,1]
Multiply original input by gate
Broadcast channel weights
SPP
ConvBNAct 1×1
256 × 20 × 20
MaxPool5×5
s=1; p=2
MaxPool9×9
s=1; p=4
MaxPool13×13
s=1; p=6
Concat input and three parallel pools
1024 channels
ConvBNAct 1×1
512 × 20 × 20
Box decode: zero-offset grid points (0,8,16,... or stride 16/32) minus l/t and plus r/b. Sigmoid class logits; threshold; class NMS.
Source: models/rtmdet/nn.py; postprocess/rtmdet.py. Revision a4d0ecc9e17f.
libreyolo.com