Language Prompt vs. Image Enhancement: Boosting Object Detection With CLIP in Hazy Environments
Authors: Jian Pang, Bingfeng Zhang, Jin Wang, Baodi Liu, Dapeng Tao, Weifeng Liu
Organizations: College of Control Science and Engineering, China University of Petroleum (East China), Qingdao 266580, Shandong, P.R. China · School of Information Science and Engineering, Yunnan University, Kunming 650091, Yunnan, P.R. China · Yunnan United Vision Technology Co., Ltd., Kunming 650504, Yunnan, P.R. China
Object detection in hazy environments is challenging because degraded objects are nearly invisible and their semantics are weakened by environmental noise, making it difficult for detectors to identify. Common approaches involve image enhancement to boost weakened semantics, but these methods are limited by the instability of enhanced modules. This paper proposes a novel solution by employing language prompts to enhance weakened semantics without image enhancement. Specifically, we design Approximation of Mutual Exclusion (AME) to provide credible weights for Cross-Entropy Loss, resulting in CLIP-guided Cross-Entropy Loss (CLIP-CE). The provided weights assess the semantic weakening of objects. Through the backpropagation of CLIP-CE, weakened semantics are enhanced, making degraded objects easier to detect. In addition, we present Fine-tuned AME (FAME) which adaptively fine-tunes the weight of AME based on the predicted confidence. The proposed FAME compensates for the imbalanced optimization in AME. Furthermore, we present HazyCOCO, a large-scale synthetic hazy dataset comprising 61258 images. Experimental results demonstrate that our method achieves state-of-the-art performance. The code and dataset will be released.
Figures & tables
Fig. 1: Pipeline comparison. Our method can detect overlooked objects using only language prompts.
Fig. 2: Failure cases of IA-YOLO. GT: Ground Truth. Involving image enhancement may lead to missed detections or misclassifications.
Fig. 3: Overall of our pipeline. In detection pipeline: The image is processed to obtain ROI features. The predicted logits of objects are combined with estimated weights to form CLIP-CE. In AME: We crop objects within the image and extract their visual embeddings. Meanwhile, we get text embeddings from mutually exclusive prompts. We calculate the negative similarity between these embeddings to determine the weight of AME. In FAME: We concatenate the ROI features with the visual embeddings to create adapted visual embeddings. We use negative similarities from adapted visual embeddings as weight offset. The final weight for FAME is averaged from the AME weight and the weight offset.
Dataset
Train
Test
Total
Environment
HazyCOCO
58800
2458
61258
Synthetic Haze
RTTS
2161
2161
4,322
Real Haze
Exdark
4411
2952
7363
Low light
TrashCan
5936
1147
7083
Underwater
TABLE I: Image statistics of the datasets.
Fig. 4: Left part: Using the clear image and its depth map to generate HazyCOCO image. Right part: Hazy images from VOC FOG [ 10 ] .
Fig. 5: Visualizations of the depth map with and without clamping. The depth map without clamping is directly generated by Depth-Anything. The HazyCOCO images are synthesized using the depth maps described above. In the depth map with clamping, the area within the orange box exhibits more hierarchical depth information.
Fig. 6: Visualizations for the HazyCOCO images with different hazy densities.
Strategy
Method
Detector
HazyCOCO
RTTS
Separation
Advancing [ 13 ]
Faster-RCNN
36.77
70.29
DCP [ 41 ]
42.82
74.26
Fusion
IA-YOLO [ 10 ]
YOLOV3
29.27
59.20
TogetherNet [ 12 ]
YOLOX
32.31
54.00
Direct
Focal Loss [ 16 ]
Faster-RCNN
39.67
70.20
Ours
44.92
76.76
TABLE II: Performance comparison in hazy environment. Bold is the best. Results are reported by mAP.
Strategy
Method
Detector
Exdark
TrashCan
Separation
RUSA [ 44 ]
Faster-RCNN
61.12
-
Zero-DCE [ 45 ]
68.77
-
UHDFour [ 46 ]
58.85
-
HCLR [ 47 ]
-
48.23
UFormer [ 48 ]
-
46.57
Fusion
IA-YOLO [ 10 ]
YOLOV3
51.50
-
TABLE III: Performance comparison in low-light and underwater environments. Bold is the best. Results are reported by mAP. “-” means that the method is not suitable for the environment.
Method
Cross-Entropy Loss (CE)
CLIP-CE
Deformable-DETR [ 32 ]
64.42
65.36
RT-DETR [ 31 ]
74.61
76.48
Faster-RCNN [ 30 ]
74.12
76.76
TABLE IV: Performance comparison of different detectors with and without the proposed CLIP-CE loss on the RTTS dataset.
Methods
HazyCOCO (synthetic hazy)
RTTS (real hazy)
ExDark (real dark)
TrashCan (real underwater)
CE (baseline)
42.40
74.12
68.59
52.03
CE w/ AME
44.58
75.91
69.77
58.52
CE w/ FAME
44.92
76.76
70.42
59.63
TABLE V: Ablation study. CE: Cross-Entropy loss. AME: Approximation of Mutual Exclusion. FAME: Fine-tuned AME. “CE w/ AME” means CE with the weight from AME, while “CE w/ FAME” means CE weighted by FAME. Bold is the best. Results are reported by mAP.
Fig. 7: Visualization for the AME weights and Focal weights. The AME weights are the similarity between object and negative prompt (“a photo without { cls }”). The focal weight is computed from the predicted logit of object.
Fig. 8: Visualization of detection results on HazyCOCO and RTTS datasets. We recommend examining the zoomed-in areas (highlighted with red dashed boxes) for a clearer comparison. GT: ground truth.
Fig. 9: Visualization of detection results. We recommend examining the zoomed-in areas for a clearer comparison. GT: ground truth. IA-YOLO, UHDFour and UFormer are image enhancement-based methods. Focal Loss refers to using Faster-RCNN with Focal loss. Ours is using Faster-RCNN with CLIP-CE.
Prompt
RTTS
AME
FAME
“a photo of a { cls }”
75.91
76.76
“a photo without { cls }”
“a foggy photo of a { cls }”
75.22
76.30
“a foggy photo without { cls }”
“it is a { cls }”
75.39
75.48
TABLE VI: Prompt comparison on the real hazy dataset RTTS. The first prompt is used in our paper. The second prompt additionally has environmental factors. The third prompt is similar to ours. Bold is the best.
Object detection in real-world scenarios remains challenging due to diverse image degradations and heterogeneous object distributions, which significantly hinder the generalization of existing detectors. Conventional approaches, including scene-specific representation learning and end-to-end pipeline design, are inherently limited by their reliance on predefined conditions and lack adaptability to dynamic environments. In this paper, we propose DetAS, an agentic detection framework that formulates object detection as a dynamic decision process. Instead of relying on static pipelines, DetAS leverages a Multimodal Large Language Model (MLLM) as a central agent to adaptively compose detection workflows by selecting from a toolbox of restoration modules and specialized detectors. Specifically, DetAS consists of two key components: Self-Adaptive Image Restoration, which dynamically determines whether and how to enhance images for downstream detection, and Multi-Expertise Detection, which integrates multiple domain-specialized detectors and resolves their predictions through instance-level reasoning. To further improve decision quality under fine-grained conditions, we introduce Self-Evolving Experience Harvesting and extend the framework to DetAS-X, which accumulates node-level decision experience from a small set of annotated data and enables experience-aware reasoning during inference. This mechanism allows the system to progressively refine its decision policy and adapt to diverse real-world scenarios. Extensive experiments on six challenging benchmarks demonstrate that DetAS-X significantly outperforms existing MLLM-based detectors, achieving an average improvement of 28.36% in F1 score, with up to 37.01% gain on DarkFace. These results demonstrate the promise of agentic detection and establish a solid foundation for its application in complex and dynamic environments.
Object detection in adverse weather remains challenging because severe degradations weaken visual quality and disrupt semantic feature representations across diverse scenes. Existing methods usually rely on condition-specific designs, which limits their ability to generalize within a unified detector. In this paper, we propose a Coarse-to-Fine Scene Expert Network (C2FXNet) that achieves unified detection through hierarchical scene guidance. Specifically, C2FXNet introduces a dual-level guidance mechanism consisting of a Multi-step Reasoning Router (MRR), which performs GRU-based recurrent scene reasoning over compressed multi-scale visual cues and frozen coarse scene prototypes, and a Fine Scene Refinement (FSR) module, which uses image-specific semantic cues to modulate high-level features for local variation handling. Furthermore, a Scene-aware Mixture-of-Experts (SMoE) dynamically combines scene-specific experts under the joint guidance of MRR and FSR. By coupling coarse scene reasoning with fine-grained semantic refinement, C2FXNet enables robust multi-scene detection without scene-specific training. Extensive experiments on RTTS, ExDark, and our newly constructed Adverse Weather Dataset (AWD) demonstrate that C2FXNet consistently outperforms state-of-the-art methods across foggy, dark, and clear conditions, reaching 63.70%, 71.14%, and 54.19% mAP on RTTS, ExDark, and AWD, respectively. The source code will be released at https://github.com/PolarisFTL/C2FXNet.
Tianle Fang, Zhenbing Liu, Chong Yin +2
School of Computer Science and Information Security Guilin University of Electronic Technology Guilin, Guangxi, China
Real-world detectors must often interpret functional or ambiguous prompts, yet conventional models such as YOLO remain restricted to fixed class lists. Even open-vocabulary models like YOLO-World frequently misalign vague language with the intended objects. Building on our prior work Commonsense-Guided Open-World Object Detection Using LLMs and Visual-Semantic Matching, we address YOLO-World's limitations in grounding task-driven queries. We propose Vague2Detect, a hybrid pipeline in which a fine-tuned Sentence-BERT retrieves candidates from a structured household Knowledge Base (KB), and YOLO-World verifies their presence in the image. For prompts outside the KB, a large language model (GPT-3.5-turbo) generates candidate descriptions, dynamically expanding the KB to cover novel concepts. On a benchmark of household scenes using custom images and an Open Images V7 subset, YOLO-World alone achieves only 32% Vague Prompt Success Rate (VPSR), the ability to map ambiguous queries to correct detections. In contrast, Vague2Detect improves performance to 61% VPSR with high precision, and up to 85% when augmented with GPT fallback.