CoT-Segmenter: Enhancing OOD Detection in Dense Road Scenes via Chain-of-Thought Reasoning

Jeonghyo Song, Kimin Yun, DaeUng Jo, Jinyoung Kim, Youngjoon Yoo

Semantic segmentation models in autonomous driving must reliably identify Out-of-Distribution (OOD) objects to ensure safety. However, current methods often fail in complex scenarios involving dense clusters, small distant objects, or large foreground anomalies. We present CoT-Segmenter, a novel framework that integrates Chain-of-Thought (CoT) reasoning from Large Language Models (LLMs) with open-vocabulary grounding and segmentation. By analyzing scene context and identifying semantic deviations, CoT-Segmenter significantly improves OOD detection accuracy, nearly doubling the performance of previous state-of-the-art methods on challenging benchmarks.

The Challenge of OOD Detection

In the context of autonomous driving, "Out-of-Distribution" (OOD) objects are entities not encountered during a model's training phase—such as a fallen tree, a stray animal, or debris on a highway. Detecting these anomalies is a safety-critical task. Traditional approaches typically rely on pixel-level uncertainty or global image statistics. While effective for simple cases, these methods suffer from three primary "failure modes":

  1. Densely Packed Objects: Overlapping boundaries make it difficult to distinguish individual OOD instances.
  2. Small and Distant Objects: Low resolution at a distance makes pixel-level uncertainty signals unreliable.
  3. Large Foreground Objects: Massive anomalies can dominate the frame, causing models to misinterpret them as part of the background or a known class.
Distant and small objects, such as rocks on a mountain road, pose a significant challenge for traditional OOD detection methods due to low pixel resolution.

Methodology: Reasoning Before Segmenting

CoT-Segmenter shifts the paradigm from pure visual processing to high-level semantic reasoning. The framework operates in two main stages:

1. CoT-Based Prompt Generation

Instead of direct classification, the system uses GPT-4 to perform a three-step Chain-of-Thought (CoT) analysis:

  • Scene Contextualization: Analyzing the typical layout (e.g., "This is a rural highway").
  • Deviation Identification: Identifying elements that violate spatial or semantic logic (e.g., "A cow should not be stationary in the fast lane").
  • Candidate Selection: Generating dual prompts—a descriptive "state + noun" (e.g., "Clustered sheep") and a simple "noun" (e.g., "sheep").

2. Grounded Segmentation

These prompts are processed by GroundedSAM, which combines GroundingDINO for object localization and the Segment Anything Model (SAM) for precise mask generation. The dual-prompt strategy ensures that the model captures both the specific context and the general category of the anomaly, preventing the detector from being misled by overly complex descriptions.

Experimental Results

The effectiveness of CoT-Segmenter was evaluated on the RoadAnomaly dataset and a newly curated "Challenging Subset" designed to test the three failure modes.

On the standard RoadAnomaly benchmark, CoT-Segmenter achieved a mean Intersection over Union (mIoU) of 0.912, a massive improvement over the previous state-of-the-art (S2M) score of 0.591. On the Challenging Subset, the performance gap was even more pronounced, with CoT-Segmenter reaching 0.838 mIoU compared to S2M's 0.417 mIoU.

Qualitative comparison between ground-truth masks (left) and CoT-Segmenter predictions (right) across the three identified failure modes: dense clusters, small distant objects, and large foreground anomalies.

Conclusion and Future Directions

By leveraging the "common sense" and world knowledge embedded in Large Language Models, CoT-Segmenter overcomes the limitations of purely vision-based OOD detection. While the system occasionally suffers from over-segmentation when prompts are excessively detailed, its zero-shot capability makes it a robust solution for real-world edge cases. Future research will focus on optimizing the communication between the LLM reasoning engine and the grounding models to further refine segmentation boundaries.

Summary updated

BibTeX
@inproceedings{song2025cot,
  author = {Jeonghyo Song and Kimin Yun and DaeUng Jo and Jinyoung Kim and Youngjoon Yoo},
  title = {{CoT-Segmenter: Enhancing OOD Detection in Dense Road Scenes via Chain-of-Thought Reasoning}},
  booktitle = {AVSS},
  year = {2025},
  doi = {10.1109/avss65446.2025.11149901},
}
Figure