HVI-CIDNet Tiny

Click a block to read its description, or select it with Tab and Enter.

HVI-CIDNet TinyLow-light RGB restoration,input3 × 256 × 256,native eval. Shapes exclude batch.LibreYOLOHVI-CIDNet TinyLow-light RGB restoration,input3 × 256 × 256,native eval. Shapes exclude batch.Learned HVI color transformInput RGB3 × 256 × 256Channel max/min and piecewise hueI=max(R,G,B); S=(max-min)/(max+1e-8)Color-sensitive factor Ck(sin(Iπ/2)+1e-8)^k; learnedk initially0.2Concat horizontal,vertical,intensityH=Ck*S*cos(2πh); V=Ck*S*sin(2πh); IHue is HSV sector hue from the maximal RGB channel.For achromatic pixels h=0; for I=0,saturation=0.HVI has3 channels. Intensity stream selects channel2.Concat predicted HV andI residuals2 channels +1 channel =3 × 256 × 256+PHVIT inverse color transformClamp,HVI-to-HSV reconstruction,HSV-to-RGBRestored RGB3 × 256 × 256Default saturation_scale=intensity_scale=1.HV encoder and decoderReplicationPad1;Conv3×33 to36;256²; skipJ0Downsample136 to36;128²; paired contextLCA1HV_LCA136 channels,2 heads; resultskipJ1Downsample236 to72;64²; paired contextLCA2HV_LCA2 (skip-only)72 channels,4 heads; resultskipJ2Downsample3 from pre-LCA2 feature72 to144;32²HV_LCA3144 channels,8 headsHV_LCA4144 channels,8 heads; usespairedLCA3 outputsUpsample3 + skipJ2144 to72;64²HV_LCA572 channels,4 headsUpsample2 + skipJ172 to36;128²; reads LCA5 outputHV_LCA636 channels,2 headsUpsample1 + skipJ036 to36;256²ReplicationPad1;Conv3×336 to2;256²Contexts are the paired stream features before each LCA update.I encoder and decoderReplicationPad1;Conv3×31 to36;256²; skipJ0Downsample136 to36;128²; paired contextLCA1I_LCA136 channels,2 heads; resultskipJ1Downsample236 to72;64²; paired contextLCA2I_LCA2 (skip-only)72 channels,4 heads; resultskipJ2Downsample3 from pre-LCA2 feature72 to144;32²I_LCA3144 channels,8 headsI_LCA4144 channels,8 heads; usespairedLCA3 outputsUpsample3 + skipJ2144 to72;64²I_LCA5 (result unused)72 channels,4 headsUpsample2 + skipJ172 to36;128²; reads pre-LCA5 featureI_LCA636 channels,2 headsUpsample1 + skipJ036 to36;256²ReplicationPad1;Conv3×336 to1;256²Contexts are the paired stream features before each LCA update.CAB channel cross-attentionC/heads:36/2,72/4,144/8. Every head has18 channels.Conv2d1×1 fromX36/72/144 tosameDepthwiseConv3×3Groups=outputchannels;s1,p1Conv2d1×1 fromcontext36/72/144 to72/144/288DepthwiseConv3×3Groups=outputchannels;s1,p1Split K,V; L2-normalize Q and KNormalize over spatial length, not channelsQ × transpose(K) × learned temperature18 × 18 channel-attention matrix per headSoftmax over key channels18 × 18 perheadAttention × VRestore36/72/144 spatial channelsConv2d1×136/72/144 to samechannelsV is the unchanged value half of the KV depthwise projection.All CAB convolutions use bias=False.LCA residual structureFeature X and paired context36,72 or144 channelsShared channel LayerNorm on bothepsilon1e-6; own module per LCACABContext supplies K/V; X supplies Q+Channel LayerNormSame LCA norm moduleIEL intensity-enhancement layerHidden widths95,191,383 respectivelyHV_LCA outputIEL result; no secondskip+I_LCA outputHV and I differ in the second residual connection.IELConv2d1×136/72/144 to190/382/766DepthwiseConv3×3190/382/766 channels/groups;s1,p1Split equal halvesEach half95/191/383 channelsDepthwiseConv3×395/191/383 groups;s1,p1Tanh+HalfDepthwiseConv3×395/191/383 groups;s1,p1Tanh+Half×Conv2d1×195/191/383 to36/72/144hidden=floor(2.66*C); two residual Tanh branches multiply.Downsample and upsampleDownsample:Conv3×336to36,36to72,72to144;s1,p1;biasFalseBilinear resize×0.5align_corners=TruePReLUOne learned slope; no optionalLayerNormUpsample:Conv3×3144to72,72to36,36to36;s1,p1Bilinear resize×2align_corners=TrueConcat with matching skip144,72,72 channels respectivelyConv1×1 thenPReLU144to72,72to36,72to36; noLayerNormAll sampling convolutions have bias=False; nearest-neighbor upsampling is not used.PHVIT inverse transformClamp H,V to[-1,1], I to[0,1]Recompute Ck from I and stored density kDivide H,V by Ck+1e-8Clamp normalized H,V again to[-1,1]atan2(V+eps,H+eps)/(2π) modulo1Hue; saturation=sqrt(H²+V²+eps),clamped[0,1]HSV sector conversionSix sector choices using I, I(1-S), q andtRGB output × intensity_scaleDefault intensity_scale=saturation_scale=1The inverse uses the same learned density k captured during the forward HVI transform.Source: libreyolo/models/hvi_cidnet/nn.py and model.py. Revision a4d0ecc9e17f.libreyolo.com