3.1. Overall Framework
This study adopts YOLOv8l-worldv2 as the multimodal baseline and replaces only its original visual encoder with a compact branch, while retaining the original cross-modal fusion and text-conditioned detection pipeline. To reduce edge-side overhead, category-level text embeddings are generated offline, and the CLIP text encoder is excluded from online inference. The resulting framework is illustrated in
Figure 1.
As shown in
Figure 1, the proposed framework consists of three main stages. First, a lightweight visual encoder is constructed based on YOLOv7. Depthwise separable convolutions are used to replace computationally expensive 3 × 3 standard convolutions in the backbone network, and DyHead is introduced at the P3, P4, and P5 multi-scale output levels for dynamic feature enhancement. Subsequently, structured channel pruning is performed by combining layer-wise sensitivity analysis with the FPGM geometric median criterion, resulting in a compact visual encoder.
Second, the compact encoder is integrated into YOLO-World as an alternative visual branch. A lightweight semantic adaptation layer is inserted between the DyHead-enhanced features and the cross-modal fusion modules to alleviate the distribution discrepancy between closed-set visual features and the CLIP text semantic space. Meanwhile, multi-template text prompts are used to construct category-level text semantic prototypes, and the text encoder is kept frozen during multimodal fine-tuning.
Finally, edge deployment optimization is performed based on offline text semantic prototypes and a TensorRT mixed-precision inference engine. During online inference, the edge device mainly executes visual feature extraction, feature adaptation, cross-modal fusion, and text-contrastive detection, while the CLIP text encoder is excluded from the online inference pipeline.
The three stages are designed as a coupled process rather than as an independent sequence of existing techniques. DSC reconstruction and FPGM pruning reduce computational cost but may weaken multi-scale representation and alter the channel-wise distribution of visual features. DyHead is therefore retained to compensate for multi-scale feature degradation, while the pruning process is constrained to preserve the P3/P4/P5 interfaces required by the original fusion modules. The semantic adaptation layer subsequently addresses the remaining distribution mismatch before visual–text interaction, and the frozen multi-template text prototypes provide stable semantic references during multimodal fine-tuning. This dependency among compression, interface preservation, and semantic adaptation constitutes the central design rationale of the proposed framework.
3.2. Construction of the Lightweight Visual Encoder
To reduce visual-branch computation while preserving the P3/P4/P5 interfaces required for cross-modal fusion, a compact encoder is constructed based on YOLOv7 [
2,
30] and subsequently integrated into the original YOLOv8l-worldv2 multimodal framework. YOLOv7 is selected because its ELAN-W backbone contains explicit multi-branch convolution and feature concatenation paths, which facilitate partial DSC replacement, structured channel pruning, and preservation of the P3/P4/P5 output interfaces. Specifically, the computationally expensive
standard convolutions in ELAN-W can be replaced without removing its original multi-branch feature reuse structure and
channel-fusion layers. These characteristics make YOLOv7 suitable for constructing a compact visual branch that can subsequently be connected to DyHead and the cross-modal fusion modules.
Other YOLO backbones could also be used in the proposed framework. However, differences in stage depth, channel dimensions, feature aggregation structures, and multi-scale output interfaces would require redesigning the DSC replacement positions, pruning dependencies, and semantic adaptation layers. Therefore, the resulting accuracy–efficiency trade-off would depend on the selected backbone and cannot be directly transferred without retraining and interface adaptation. The improved DSC-ELAN-W structure adopted in this study is shown in
Figure 2.
Let the number of input channels be
, the number of output channels be
, and the convolution kernel size be
×
. The parameter count of a standard convolution can be expressed as:
Depthwise separable convolution decomposes a standard convolution into two stages: depthwise convolution and pointwise convolution. Its parameter count can be expressed as:
As illustrated in
Figure 2, each computationally expensive
standard convolution in the selected ELAN-W branches is replaced by a depthwise convolution followed by a
pointwise convolution. Equations (1) and (2) quantify the parameter costs of these two alternatives. According to the two equations, when
and the channel numbers are relatively large,
is substantially smaller than
. This explains the computational reduction provided by the DSC blocks shown in
Figure 2 while preserving the feature map size and output-channel interface.
After reconstructing the backbone network with DSC, the basic computational cost of the model is reduced. However, lightweight convolutions and subsequent channel pruning may weaken fine-grained feature representation, thereby affecting the detection performance for small objects and complex scenes. To address this issue, DyHead is introduced at the P3, P4, and P5 multi-scale outputs of the lightweight visual encoder. In this study, DyHead is used as a visual feature enhancement module rather than as a final category prediction head. During closed-set training, the enhanced visual features are connected to the YOLOv7 detection branch for encoder training and pruning evaluation. During multimodal integration, they are fed into the cross-modal fusion modules through the semantic adaptation layer and then fused with text embeddings.
To further compress the model size, sensitivity-guided FPGM structured pruning is introduced on the basis of DSC-based backbone reconstruction and DyHead-based feature enhancement. Considering that different convolutional layers have different sensitivities to channel pruning, layer-wise sensitivity analysis is adopted to evaluate the response of each layer to pruning. For the
-th convolutional layer, while keeping the parameters of other layers unchanged, temporary channel pruning is applied only to the current layer, and the change in model accuracy is evaluated on the pruning strategy evaluation subset. Let the original detection accuracy of the unpruned model be A, and let the detection accuracy of the current layer under pruning ratio (
) be
. The accuracy degradation can be expressed as:
As indicated by Equation (3), a larger means that the corresponding layer is more sensitive to channel pruning, whereas a smaller value suggests greater channel redundancy. The values of obtained at different pruning ratios are used to generate the layer-wise sensitivity curves. Based on these curves and the corresponding accuracy degradation defined in Equation (3), the layers are divided into sensitive, moderately sensitive, and robust groups, which are subsequently assigned different pruning ratios.
After determining the pruning ratio for each layer, the FPGM criterion is adopted to select the filters to be pruned within each layer. FPGM identifies redundant filters from the perspective of the geometric relationships among filters in the same convolutional layer and preferentially removes filters that are highly similar to others and therefore more replaceable. During pruning, the number of remaining channels is further constrained to ensure consistency among multi-branch feature concatenation, the P3/P4/P5 output channels, and the input interfaces of the subsequent semantic adaptation layer and cross-modal fusion modules. After pruning, the model is fine-tuned with a small learning rate, allowing the compressed visual encoder to adapt to the changed feature distribution.
The resulting compact encoder retains the P3/P4/P5 interfaces required for integration into the YOLOv8l-worldv2 multimodal framework.
3.3. Design of Multimodal Fusion Adaptation
After construction, the lightweight encoder replaces the original visual branch of YOLOv8l-worldv2. Because the encoder is trained and pruned under closed-set supervision, its output distribution may differ from that of the original visual branch and the CLIP text semantic space, potentially weakening visual–text matching. As shown in
Figure 3, the P3, P4, and P5 features are first enhanced by DyHead, transformed by the semantic adaptation layer, and then passed to the original cross-modal fusion and text-contrastive detection pipeline. DyHead is retained solely as a multi-scale feature enhancement module rather than an additional detection head.
To alleviate the distribution discrepancy between lightweight visual features and the text semantic space, a lightweight semantic adaptation layer is inserted between the DyHead output features and the cross-modal fusion modules. This adaptation layer consists of a single 1 × 1 convolution. The input and output channel numbers are kept the same, and the spatial resolution of the feature map remains unchanged. Therefore, the layer only performs linear reorganization of visual features along the channel dimension. For the
-th multi-scale feature
, the adaptation process is formulated as:
where
denotes the
-th visual feature output by DyHead,
denotes the adapted visual feature, and
denotes a
convolution parameterized by the weight
and bias
. The symbol
denotes the convolution operation, and the bias
is added channel-wise to the convolution output.
Equation (4) implements the semantic adaptation block in
Figure 3, mapping each DyHead-enhanced feature to the original Re-parameterizable Vision–Language Path Aggregation Network (RepVL-PAN) interface through a learnable channel transformation without changing its spatial resolution.
To avoid introducing an abrupt perturbation to the pretrained visual features, the adaptation convolution is initialized as an identity mapping. When the input and output channel numbers are equal, its weight tensor can be regarded as a channel transformation matrix. The diagonal channel coefficients are initialized to 1, the off-diagonal coefficients are initialized to 0, and the bias is initialized to 0. Therefore, at the exact initialization point, Equation (4) gives , rather than merely an approximate equality. After multimodal fine-tuning begins, and are updated by gradient descent; consequently, only during the initial training stage, after which the adaptation layer gradually learns a channel-wise transformation suitable for cross-modal fusion.
On the text side, multi-template text prompts are constructed according to the detection categories of BDD100K to improve the stability of category-level semantic prototypes. For each category, several prompt forms are designed, including direct category descriptions, image-scene descriptions, and road-scene-specific descriptions, such as “a photo of a car”, “a photo of a car on the road”, and “a car in a driving scene”. During training, different templates are randomly sampled to generate text inputs, thereby enhancing the robustness of the model to variations in prompt expressions. During validation and testing, the text embeddings generated from multiple templates for the same category are averaged and used as the semantic prototype of that category. The CLIP text encoder is kept frozen during multimodal fine-tuning to maintain the stability of the text semantic space and reduce training overhead.
3.4. Mixed-Precision Deployment on Edge Devices
To reduce the inference latency and storage footprint of the fusion-adapted multimodal detection model on edge devices, this study adopts post-training quantization (PTQ) to build a TensorRT mixed-precision inference engine [
29]. Unlike the structural lightweighting strategy described in
Section 3.2, mixed-precision deployment optimizes the model from the perspective of numerical precision during inference. Therefore, structural lightweighting and mixed-precision inference reduce model overhead from different but complementary aspects. The overall deployment process is shown in
Figure 4.
As shown in
Figure 4, the deployment process consists of offline preparation and online edge-side inference. During offline preparation, the frozen CLIP text encoder is first used to generate text semantic prototypes for each detection category. Meanwhile, 1000 images are randomly selected from the BDD100K training set to construct the quantization calibration set, and the validation set is not used for calibration. The fusion-adapted multimodal detection model is then exported to ONNX (Open Neural Network Exchange) format. During TensorRT engine construction, the calibration set is used to collect activation distributions, determine the quantization scale factors for INT8 execution, and generate the serialized inference engine.
For the quantization strategy, the lightweight visual encoder, DyHead feature enhancement module, and semantic adaptation layer are mainly executed in INT8 precision to reduce the computational cost of convolutional and linear operations. For the cross-modal fusion modules and the text-contrastive detection head, which directly interact with the text semantic prototypes, INT8/FP16 mixed-precision execution is adopted according to TensorRT operator support and calibration results. This strategy aims to reduce quantization errors in visual–text similarity computation. The CLIP text encoder is used only to generate category-level semantic prototypes offline and does not participate in online inference. The generated text embeddings are stored in FP16 precision and used as fixed constant inputs in the inference pipeline.
During online edge-side inference, the model receives only the input image and the pre-generated category-level text semantic prototypes. The complete text encoding process is no longer executed on the edge device, which reduces both memory usage and computational overhead. This deployment scheme is suitable for autonomous driving detection scenarios in which the category set is fixed or updated infrequently. If the text prompts need to be changed frequently in practical applications, the category-level text semantic prototypes should be regenerated offline or updated through a separate maintenance process. The effects of quantization on detection accuracy, model size, and inference speed are further analyzed in the experimental section.