This study uses YOLO11n as the baseline detector and develops DER-YOLO for lightweight small-object detection in complex traffic scenes. DER-YOLO addresses three main limitations of lightweight detectors: insufficient backbone context representation, inadequate cross-scale feature fusion, and limited pre-head feature calibration. To tackle these issues, DGC-C3k2, ECAF, and RLSK modules are introduced into the backbone, neck, and pre-head stages, respectively, forming a stage-wise feature calibration framework that enhances small-object representation while maintaining lightweight real-time performance.
3.2. DGC-C3k2 Module
In traffic scenes, small objects such as distant pedestrians, cyclists, and traffic signs often have weak textures, blurred boundaries, and low saliency. These characteristics require the backbone to capture not only local details but also broader contextual information. Although C3k2 in YOLO11n is efficient for lightweight feature extraction, its convolution-based structure mainly models local receptive fields and has limited ability to capture long-range dependencies. Therefore, DGC-C3k2 is designed by appending a lightweight global context enhancement unit, termed DGC-Net, to the original C3k2 structure. As shown in
Figure 2a, DGC-C3k2 first preserves the dual-branch local feature extraction of C3k2 and then performs global context calibration on the fused feature.
Let the input feature map of the DGC-C3k2 module be denoted as
, where
C,
H and
W represent the number of channels, height, and width, respectively. After an initial projection by a CBS module, the input feature is split along the channel dimension into two branch features, denoted as
and
. Specifically,
is fed into a CBS-based direct path to preserve shallow detailed information, while
is passed through the main branch composed of
cascaded Bottleneck blocks to extract deep semantic features. The two branch outputs are then concatenated along the channel dimension and integrated by another CBS module to obtain an intermediate feature
. The feature
is then fed into DGC-Net for global context modeling. The above process can be expressed as follows:
As shown in
Figure 2b, DGC-Net consists of two main components: Context Modeling and Transform. The Context Modeling component aggregates global contextual information along the spatial dimension using learnable spatial weights, while the Transform component maps the aggregated global descriptor into a channel enhancement vector.
In the Context Modeling component, the input feature
is first projected by a 1 × 1 convolution to generate a single-channel spatial response map. Softmax normalization is then applied along the spatial dimension to obtain the spatial weight
for the
-th location:
where
denotes the spatial response value at the corresponding location. Subsequently, these spatial weights are used to perform a weighted aggregation of the channel vectors over all spatial locations, yielding the global context vector
:
Different from global average pooling, this weighted aggregation allows DGC-Net to emphasize spatial regions that contribute more to object representation.
In the Transform branch, the global context vector
is further passed through two successive 1 × 1 convolution layers parameterized by
and
, respectively. Combined with LayerNorm and the ReLU activation function for nonlinear transformation, this process yields the channel enhancement vector
, which can be expressed as follows:
where
denotes the LayerNorm operation, and
represents the ReLU activation function. The role of this branch is to further map the global contextual information into the channel dimension, thereby generating selective channel enhancement responses and enhancing the representation capability of channels relevant to the detection targets.
During the module design, a Spatial Gating Branch was also explored as a candidate spatial enhancement component. Specifically, this branch employs a 3 × 3 depthwise convolution, batch normalization, and a Sigmoid activation function to generate a spatial gating response , which is used to perform element-wise spatial modulation on the input feature, thereby further emphasizing potential target regions while suppressing irrelevant background responses. However, the ablation results indicate that this spatial gating branch does not bring additional performance gains and instead slightly degrades the detection accuracy. Therefore, this branch is removed in the final model, and DGC-Net retains only the Context Modeling and Transform components.
Based on the final adopted structure, the channel-enhancement vector
is applied to the input feature
F as a residual multiplicative channel gate, rather than being added directly. The output of DGC-Net is therefore obtained as:
where ⊙ denotes element-wise multiplication broadcast over the spatial dimensions, with
. Owing to the residual term, this gate emphasizes informative channels according to their global-context relevance while preserving the original feature responses.
Through this design, DGC-C3k2 combines the local feature extraction capability of C3k2 with lightweight global context calibration. The “local encoding followed by global modulation” strategy enhances small-object-related semantic representation while avoiding the repeated insertion of attention modules inside the backbone.
Compared with SE and ECA, DGC-Net uses attention-based spatial aggregation rather than global average pooling to obtain the context descriptor. Compared with GCNet, DGC-Net uses the transformed context to modulate feature channels before combining them with the original feature, rather than adding it directly as a context residual.
3.3. ECAF Module
The conventional feature pyramid structure has two limitations for small-object detection. First, fixed upsampling lacks content awareness and may smooth the edges and textures of small objects. Second, direct concatenation treats high-level semantic features and shallow detailed features with equal importance, without adaptive contribution allocation. To address these limitations, an ECAF module is introduced into the P3 top-down fusion path, as shown in
Figure 3. ECAF first uses DySample to dynamically upsample the high-level low-resolution feature. It then applies ECA to both the reconstructed high-level feature and the shallow high-resolution feature. Finally, complementary channel-level fusion weights are generated by Softmax normalization to adaptively balance semantic and detailed information.
The feature map generated by the high-level branch is denoted as
, while the shallow feature from the lateral connection is denoted as
. The high-level feature contains stronger semantic information but has lower spatial resolution, whereas the shallow feature preserves more detailed spatial information. ECAF first applies DySample to reconstruct the high-level feature to the same resolution as
:
Then, ECA is applied to
and
to generate the channel response weights
and
. For an input feature
, global average pooling, denoted by GAP(⋅), produces a channel descriptor
, whose
-th component is:
The channel weights are then obtained by a local one-dimensional convolution followed by a Sigmoid activation:
Accordingly, the channel responses of the two branches are:
To adaptively allocate the contribution of the two branches, Softmax normalization is applied channel-wise to generate complementary fusion weights
:
where
for each channel
. The fused output is obtained by channel-wise weighted summation:
By combining dynamic upsampling with channel-wise complementary weighting, ECAF adaptively integrates high-level semantic information and shallow high-resolution details in the P3 branch. Rather than concatenating the two branches, it performs channel-wise weighted summation, preserving the channel dimension and avoiding the extra cost of subsequent channel-reduction convolution.
Unlike ECA, which independently recalibrates a single feature map, ECAF applies channel attention to both branches and converts their responses into complementary fusion weights through channel-wise Softmax normalization. DySample is used only to reconstruct the high-level feature, whereas the cross-scale fusion is completed by weighted summation. This design enables explicit cross-branch contribution allocation with limited additional complexity.
3.4. RLSK Module
In traffic scenes, object scales vary significantly. Distant pedestrians, cyclists, and traffic signs require fine local details, whereas larger nearby vehicles benefit from broader contextual responses. Fixed receptive-field convolutions are limited in adapting to such scale variation. To refine the high-resolution P3 feature before prediction, an RLSK module is inserted after the P3 C3k2 feature encoding block and before the P3 detection head, as shown in
Figure 4. After a 1 × 1 pre-mixing convolution, RLSK uses three parallel strip depthwise convolution branches with equivalent kernel sizes of 3 × 3, 5 × 5, and 7 × 7 to capture spatial responses at different granularities, where each branch decomposes a
k ×
k depthwise convolution into a 1 ×
k convolution followed by a
k × 1 convolution to enlarge the receptive field with fewer parameters. A lightweight adaptive selection mechanism is then used to assign branch weights and fuse these multi-granularity features, improving the discriminative representation of small-object regions with limited additional computational cost.
Let the input feature map be denoted as
, where
,
, and
represent the number of channels, height, and width, respectively. RLSK first applies a 1 × 1 pre-mixing convolution followed by batch normalization and a SiLU activation to obtain a mixed feature:
where
denotes the SiLU activation. Three parallel strip depthwise convolution branches then extract spatial features at different granularities:
where
denotes a strip depthwise convolution unit with equivalent kernel size
k ×
k, implemented as a 1 ×
k depthwise convolution followed by a
k × 1 depthwise convolution, each with batch normalization and SiLU activation. The three branch features correspond to local, medium-range, and larger receptive-field spatial responses. They are first aggregated to obtain a global descriptive feature:
Then, global average pooling is applied to
U to generate a compact channel descriptor
:
The descriptor is mapped by a lightweight weight generation function
, and Softmax is applied along the branch dimension to obtain adaptive branch weights:
where
denotes the channel-wise weight of the
-th branch, and
for each channel. The three branch features are then selectively fused as:
where
denotes element-wise multiplication. Finally, a 1 × 1 convolution and residual connection are used to obtain the output feature:
where
denotes the 1 × 1 convolution and
represents the ReLU activation.
RLSK differs from existing selective-kernel designs mainly in its lightweight implementation and placement. Unlike SKNet and LSKNet, which employ selective kernels for backbone feature extraction and receptive-field modeling, RLSK uses strip depthwise convolution branches with residual detail preservation as a pre-head refinement module. It is applied only to the high-resolution P3 feature before detection, enabling targeted spatial-response calibration for small objects with limited additional cost.