Leaving No OOD Instance Behind: Instance-Level OOD Fine-Tuning for Anomaly Segmentation

Yuxuan Zhang, Zhenbo Shi, Han ye, Shuchang Wang, Zhidong Yu, Shaowei Wang, Wei YangNeurIPS 2025

TL;DR

LNOIB (Leaving No OOD Instance Behind) is a novel fine-tuning framework designed to prevent anomaly segmentation models from ignoring small, safety-critical objects. By shifting from global pixel-level losses to instance-level objectives and explicit feature separation, LNOIB significantly improves the detection of small anomalies without adding any computational overhead during inference.

Introduction: The "Dominant Instance Effect"

In autonomous driving, "Anomaly Segmentation" is the task of identifying objects the model has never seen before—known as Out-of-Distribution (OOD) instances. Current state-of-the-art methods typically use OOD fine-tuning, training on "mixed" images that contain both known (In-Distribution) and unknown (OOD) objects.

However, most current methods rely on global-level objectives. These loss functions treat every pixel equally. If an image contains a massive truck (thousands of pixels) and a tiny stray dog (a few dozen pixels), the loss is heavily dominated by the truck. Mathematically, the model can "afford" to ignore the dog to minimize the total error. The authors mathematically formalize this as the "Dominant Instance Effect," proving that global loss functions converge toward the loss of the largest anomaly. In safety-critical fields like self-driving, missing a small object can lead to catastrophic failures.

Comparison of standard global fine-tuning versus the LNOIB approach. Standard methods (c) miss the small dog, while LNOIB (d) successfully segments it.

Methodology: The LNOIB Framework

The authors introduce LNOIB, a framework designed to act as a "plug-in" paradigm for existing OOD fine-tuning strategies (like EM, PEBAL, or M2A). It consists of two primary novel components:

  1. Instance-Level Objective ($L_{ins}$): Instead of averaging the loss across all anomaly pixels globally, LNOIB identifies individual OOD instances and weights their contributions equally. This ensures that a small object in the distance is just as important to the model's learning process as a large object right in front of the camera.
  2. Feature Separation Objective ($L_{feat}$): Small objects are often "smoothed out" by the surrounding background during the convolution process. To combat this, LNOIB utilizes Prototype Learning. It calculates a "prototype" (a mean feature representation) for each OOD instance and explicitly pushes it away from the prototypes of known ID categories. A combination of a global semantic loss and a nearest-neighbor loss ensures OOD features don't get misclassified as a similar-looking known category.
Architecture of the LNOIB framework, detailing the instance-level anomaly scoring and the prototype-based feature separation.

Crucially, LNOIB is a training-time-only modification. Once the model is fine-tuned, the extra logic is discarded, meaning the inference speed remains exactly the same as the baseline model.

Experimental Setup

  • In-Distribution (ID): The Cityscapes dataset was used for pre-training the base semantic segmentation models.
  • Out-of-Distribution (OOD) for Fine-tuning: The authors used AnomalyMix, simulating anomalies by pasting objects from the COCO dataset into Cityscapes images.
  • Evaluation Benchmarks: The framework was tested on standard anomaly benchmarks including Fishyscapes (Static and Lost & Found), SMIYC (Road Anomaly and Road Obstacle), and the Road Anomaly dataset.

Key Results and Insights

  • Massive Gains on Small Objects: When integrated into the M2A (Mask2Anomaly) baseline, LNOIB boosted the component-level sIoU on the SMIYC-RA dataset from 51.47 to 63.15—a nearly 12-point jump.
  • Component-Level vs. Pixel-Level: The paper argues that standard pixel-level metrics (like mIoU) are deceptive for anomaly detection because they hide poor performance on small objects. They advocate for component-level metrics (sIoU, F1*), which treat each disjoint object as a single unit. Models equipped with LNOIB consistently outperformed previous methods across almost all benchmarks in these component-level metrics.
  • Preserving "Normal" Vision: Fine-tuning for anomalies often degrades a model's ability to see normal objects (catastrophic forgetting). LNOIB maintained competitive performance on the original Cityscapes task, experiencing less than a 1% drop in mIoU.
  • Versatility: Because LNOIB is a paradigm rather than a standalone model, the authors demonstrated its effectiveness by integrating it into three different existing OOD methods, yielding universal improvements.

Limitations and Future Work

While LNOIB is vastly superior at detecting small objects, qualitative results show that the segmentation boundaries for very tiny instances can still be somewhat noisy or incomplete. Additionally, while a unified set of hyperparameters worked for their tests, models with drastically different loss scales might require manual tuning to balance the feature separation term.

Finally, the current work focuses entirely on static images. The authors suggest that extending this instance-level logic to video tasks—where temporal consistency could further help identify small moving objects—is a highly promising direction for future research.

Summary updated

BibTeX
@inproceedings{zhang2025leaving,
  author = {YUXUAN ZHANG and Zhenbo Shi and Han ye and Shuchang Wang and Zhidong Yu and Shaowei Wang and Wei Yang},
  title = {{Leaving No OOD Instance Behind: Instance-Level OOD Fine-Tuning for Anomaly Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=oCOOe8tt8v},
}
Figure